
function blanket_size(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
	var blanket = document.getElementById('blanket');
	blanket.style.height = blanket_height + 'px';
	blanket.style.width = document.body.offsetWidth + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	popUpDiv_height=blanket_height/2-150;//150 is half popup's height
	popUpDiv.style.top = popUpDiv_height + 'px';
}
function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
			window_width = document.body.parentNode.clientWidth;
		} else {
			window_width = document.body.parentNode.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	window_width=window_width/2-175;//150 is half popup's width
	popUpDiv.style.left = window_width + 'px';
}
function toggle(div_id) {

var el = document.getElementById(div_id);

if (el.style.display == 'none') { 

el.style.display = 'block';

}else {

el.style.display = 'none';
document.getElementById('e00').innerHTML = '';
document.getElementById('h00').innerHTML = '';
}
}

function popup(windowname) {
	try{
		var div_e = document.getElementById("flash_eng");
		var div_h = document.getElementById("flash_hi");
		if((div_e!=null || div_e!="undefined") && (div_h!=null || div_h!="undefined")){
			if(div_e.innerHTML!=""){div_e.innerHTML = "";}
			else{
				var str1 = "";
				str1 = str1 + "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"100%\" height=\"288\">";
				str1 = str1 + "<param name=\"movie\" value=\"banner.swf\" />";
				str1 = str1 + "<param name=\"quality\" value=\"high\" />";
				str1 = str1 + "<embed src=\"banner.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"288\"></embed>";
				str1 = str1 + "</object>";
				div_e.innerHTML = str1;
			}
			if(div_h.innerHTML != ""){div_h.innerHTML = "";}
			else{
				var str2 = "";
				str2 = str2 + "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"100%\" height=\"288\">";
				str2 = str2 + "<param name=\"movie\" value=\"banner.swf\" />";
				str2 = str2 + "<param name=\"quality\" value=\"high\" />";
				str2 = str2 + "<embed src=\"banner.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"288\"></embed>";
				str2 = str2 + "</object>";
				div_h.innerHTML = str2;		
			}
		}		
		blanket_size(windowname);
		window_pos(windowname);
		toggle('blanket');
		toggle(windowname);
		document.getElementById('userId').focus();
	}catch(e){
		blanket_size(windowname);
		window_pos(windowname);
		toggle('blanket');
		toggle(windowname);
		document.getElementById('userId').focus();
	}
}


