﻿// JavaScript Document
function activxFlash(id, iWith, iHeight, strFileUrl, bId,fmode,bgcolor) {
	//alert(NaviType);
	var NaviType = navigator.appName;
	//alert(NaviType);
	if (NaviType == "Netscape"){	
		document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+iWith+"\" height=\""+iHeight+"\" align=\"middle\">");
		if (id != "textChatApp"){
			document.write("<param name=\"wmode\" value=\"transparent\">");
		}
		document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
		document.write("<param name=\"movie\" value=\""+strFileUrl+"?"+fmode+"\" id=\""+id+"\"/>");
		document.write("<param name=\"quality\" value=\"high\" />");
		if (bgcolor != ""){
		document.write("<param name=\"bgcolor\" value=\""+bgcolor+"\">");
		}
		document.write("<embed src=\""+strFileUrl+"?"+fmode+"\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+iWith+"\" height=\""+iHeight+"\" name=\""+bId+"\" id=\""+id+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
		document.write("</object>");
	}else{
		var str = "";	
		
		str += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+iWith+"\" height=\""+iHeight+"\" id=\""+id+"\" name=\""+bId+"\">";
		if (fmode != ""){
		str += "<param name=\"flashvars\" value=\""+fmode+"\">";
		}
		if (id != "textChatApp"){
			str += "<param name=\"wmode\" value=\"transparent\">";
		}
		str += "<param name=\"allowScriptAccess\" value=\"sameDomain\">";
		str += "<param name=\"movie\" value=\""+strFileUrl+"\">";
		str += "<param name=\"quality\" value=\"high\">";
		if (bgcolor != ""){
		str += "<param name=\"bgcolor\" value=\""+bgcolor+"\">";
		}
		str += "<embed src=\""+strFileUrl+"?"+fmode+"\" quality=\"high\" bgcolor=\"#ffffff\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+iWith+"\" height=\""+iHeight+"\" id=\""+id+"\"></embed>";
		str += "</object>";
		document.write(str);
	}

}


function ShowLayer(url,widthinfo,heightinfo)
{

	for(var i = 0; i < document.forms.length; i++) {
		for(var e = 0; e < document.forms[i].length; e++){
			if(document.forms[i].elements[e].tagName == "SELECT") {
				document.forms[i].elements[e].style.visibility="hidden";
			}
		}
	}
	
	
	var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
	if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1)
	{
		gHideSelects = true;
	}
	gPopupIsShown = true;

	gPopupSubMask = document.getElementById("popupSubMask");
	gPopupSubMask.style.display = "block";

	gPopupSubInner =document.getElementById("popupSubInner");
	gPopFrame = document.getElementById("popupSubFrame");
	gPopupSubInner.style.display = "block";

	
	//alert(navigator.userAgent.indexOf('Gecko'));
	if (navigator.userAgent.indexOf('Gecko') !=-1)
	{
		// we have to give NS6 a fraction of a second
		// to recognize the new IFrame
		window.setTimeout('setIFrameSRC(\'' + url + '\')', 10);
		//return false;
    }
    else
    {
		gPopFrame.src = url;	
    }



		gPopFrame.style.width = widthinfo+"px";
		gPopFrame.style.height = heightinfo+"px";
		
		var fullHeight = getViewportHeight();
		var fullWidth = getViewportWidth();
		
		//alert(height+" "+fullHeight);
		//alert(width+" "+fullWidth);

		var theBody = document.documentElement;

		var scTop
		if (document.documentElement && document.documentElement.scrollTop)
		{
			scTop = parseInt(theBody.scrollTop,10);
		}
		else if (document.body)
		{
			scTop = parseInt(document.body.scrollTop,10)
		}
		else
		{
			scTop = parseInt(theBody.scrollTop,10);
		}

		//var scTop = parseInt(theBody.scrollTop,10);
		var scLeft = parseInt(theBody.scrollLeft,10);				
		

		gPopupSubMask.style.borderTop='1px solid #B57E14';
		gPopupSubMask.style.borderBottom='1px solid #B57E14';
		gPopupSubMask.style.borderLeft='1px solid #B57E14';
		gPopupSubMask.style.borderRight='1px solid #B57E14';
		gPopupSubMask.style.width='150px';
		gPopupSubMask.style.fontFamily='verdana';
		gPopupSubMask.style.fontSize='10';
		gPopupSubMask.style.padding='3';
		gPopupSubMask.style.color='#000000';
		//gPopupSubMask.style.background='#FFFFFF';
		gPopupSubMask.style.background='#000000';
		gPopupSubMask.style.filter='alpha(opacity=50)';		// IE
		gPopupSubMask.style.opacity='0.5';						// Firefox
		
		//gPopupSubMask.style.filter='alpha(opacity=100)';		// IE
		//gPopupSubMask.style.opacity='0.99';					// Firefox
		
		
		bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
		bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;

		
		gPopupSubMask.style.height = fullHeight + "px";
		gPopupSubMask.style.width = fullWidth + "px";
		gPopupSubMask.style.top = bodyScrollTop + "px";
		gPopupSubMask.style.left = bodyScrollLet + "px";
		
				

					
		popupSubInner.style.top = (scTop + ((fullHeight - heightinfo) / 2)) + "px";

		//popupSubInner.style.left =  (scLeft + ((fullWidth - (widthinfo+400)) / 2)) + "px";
		popupSubInner.style.left =  "230px";


	//return true;

}

function getViewportHeight() {
	if (window.innerHeight!=window.undefined) return window.innerHeight;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
	if (document.body) return document.body.clientHeight; 
	return window.undefined; 
}
function getViewportWidth() {
	if (window.innerWidth!=window.undefined) return window.innerWidth; 
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; 
	if (document.body) return document.body.clientWidth; 
	return window.undefined; 
}


function setIFrameSRC(ifurl)
{
	gPopFrame.src = ifurl;
}



function HiddenChatLayer()
{

	for(var i = 0; i < document.forms.length; i++) {
		for(var e = 0; e < document.forms[i].length; e++){
			if(document.forms[i].elements[e].tagName == "SELECT") {
			document.forms[i].elements[e].style.visibility="visible";
			}
		}
	}
	
	gpopupSubMask	= document.getElementById("popupSubMask");
	gPopupSubInner	= document.getElementById("popupSubInner");
	gPopFrame		= document.getElementById("popupSubFrame");
	
	gPopFrame.src = "about:blank";
	
	
	gPopupSubInner.style.display	= "none";
	gpopupSubMask.style.display		= "none";
	
//	gPopupMask = document.getElementById("popupMask");	
//	gPopupMask.style.display = "none";
}





