function openpop(page_link, popwidth, popheight, time) {
	switchit(1);
  var node=document.createElement("div");
  node.innerHTML = "<div style='height:30px;width:"+(popwidth+7)+"' id='header'>	<div id='pop_up_header_left' style='height:30px;width:10px;float:left;background-image:url(./images/pop_up_bar_bkg_left.gif);'>&nbsp;</div>	<div id='pop_up_header_back'style='float:left;height:30px;margin:0px;padding:0px;background-color:transparent;background-image:url(./images/pop_up_bar_bkg.gif);width:"+(popwidth+7-19)+";'><a id='pop_up_icon' style='float:left;' href='http://www.310webdesign.com/contact.php' target='_blank'><img src='./images/pop_up_icon.gif' alt='EyeWorldBrowser' style='border:0px solid transparent;margin-left:0px;margin-top:5px;width:21px;height:21px;' /></a><a id='pop_up_close' style='float:right;' href='#' onclick='switchit(0)'><img src='./images/pop_up_close.gif' alt='CLOSE' style='border:0px solid transparent;margin-right:10px;margin-top:5px;width:21px;height:21px;' /></a></div><div id='pop_up_header_right' style='width:9px;float:left;background-image:url(./images/pop_up_bar_bkg_right.gif);height:30px;'>&nbsp;</div></div><div style='width:"+popwidth+"; height:"+popheight+";text-align:center;border:4px double #FFD400;background-color:transparent;'><div style='background-color:#EDEDED;width:"+popwidth+"; height:"+popheight+";'><iframe style='margin-top:25px;' src='"+page_link+"' width='"+(popwidth-50)+"' height='"+(popheight-50)+"'>Page Not Avaliable!</iframe></div></div>";
  document.getElementById("pop_up").appendChild(node);
}
function AddText(elem, text) {
   var sentence=text;
   var node=document.createElement("div");
   node.innerHTML = sentence;
   document.getElementById(elem).appendChild(node);
}

function switchit(stat) {
	if (stat == 1) {
		document.getElementById('opacity_bg').style.display = 'block';
		document.getElementById('pop_up').style.display = 'block';
		dark_or_light('opacity_bg', 0, 65, 500);
		dark_or_light('pop_up', 0, 100, 500);
	} else {
		dark_or_light('opacity_bg', 65, 0, 500);
		setTimeout("document.getElementById('opacity_bg').style.display='none';",500);
		dark_or_light('pop_up', 100, 0, 500);
		setTimeout("element = document.getElementById('pop_up');while (element.firstChild) {element.removeChild(element.firstChild);}", 500);
	}
}

function dark_or_light(id, start, end, msec) {
	speed = Math.round(msec / 100);
	timer = 0;
	if(start > end) {
		for(i = start; i >= end; i--) {
			setTimeout("addopacity(" + i + ",'" + id + "')",timer * speed);
			timer++;
   	}
	} else if(start < end) {
		for(i = start; i <= end; i++) {
			setTimeout("addopacity(" + i + ",'" + id + "')",timer * speed);
			timer++;
		}
	}
}

//change the opacity for different browsers
function addopacity(op, id) {
		var object = document.getElementById(id).style;
    object.opacity = (op / 100);
    object.MozOpacity = (op / 100);
    object.KhtmlOpacity = (op / 100);
    object.filter = "alpha(opacity=" + op + ")";
}