// JavaScript Document
	var isIe=(document.all)?true:false;
	//redim the background when the size of window changed
	function ReFresh()
	{
		var rback=document.getElementById("back");
		var rmesW=document.getElementById("mesWindow");
		var rindexFlash=document.getElementById("indexFlash");
		var bWidth=parseInt(document.documentElement.scrollWidth);
		var bHeight=parseInt(document.documentElement.scrollHeight);
		var vWidth=parseInt(document.documentElement.clientWidth);
		var styleStr="top:0px;left:0px;position:absolute;background:black;width:"+(vWidth>980?vWidth:980)+"px;height:"+bHeight+"px;";
		// check browser type
		styleStr+=(isIe)?"filter:alpha(opacity=70);":"opacity:0.7;";
		if (rback!=null)
		{
			rback.style.cssText=styleStr;
		}
		if (rindexFlash!=null)
		{
			styleStr="left:"+((bWidth-rindexFlash.width)<0?0:((bWidth-rindexFlash.width)/2))+"px;top:205px;position:absolute;width:"+rindexFlash.width+"px;";
			if (rmesW!=null)
			{
				rmesW.style.cssText=styleStr;
			}
		}
	}
	//pop up flash window
	function showFlashWindow(wTitle,wWidth,wHeight,flashName)
	{
		closeWindow();
		var bWidth=parseInt(document.documentElement.scrollWidth);
		var bHeight=parseInt(document.documentElement.scrollHeight);
		var vWidth=parseInt(document.documentElement.clientWidth);
		var vHeight=parseInt(document.documentElement.clientHeight);
		var back=document.createElement("div");
		back.id="back";
		var styleStr="top:0px;left:0px;position:absolute;background:black;width:"+bWidth+"px;height:"+bHeight+"px;";
		// check browser type
		styleStr+=(isIe)?"filter:alpha(opacity=0);":"opacity:0;";
		back.style.cssText=styleStr;
		document.body.appendChild(back);
		showBackground(back,70);
		var mesW=document.createElement("div");
		mesW.id="mesWindow";
		mesW.className="mesWindow";	
		mesW.innerHTML="<div class='mesWindowContent' id='mesWindowContent'><table><tr><td colspan='2'>"+wTitle+"</td></tr><tr><td width='90%'><embed id = 'indexFlash' src='"+flashName+".swf' quality='high' width='"+wWidth+"' height='"+wHeight+"' name='"+flashName+"' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' /></td><td width='10%' style='vertical-align:top;'><input type='button' onclick='closeWindow();' title='Close flash window' class='close' value='X' /></td></tr></div>";
		// compute the position of flash pop up
		styleStr="left:"+((bWidth-wWidth)<0?0:((bWidth-wWidth)/2))+"px;top:205px;position:absolute;width:"+wWidth+"px;";
		mesW.style.cssText=styleStr;
		document.body.appendChild(mesW);
	}
	//dim the background
	function showBackground(obj,endInt)
	{
		if(isIe)
		{
			obj.filters.alpha.opacity+=2;
			if(obj.filters.alpha.opacity<endInt)
			{
				setTimeout(function(){showBackground(obj,endInt)},5);
			}
		}else{
			var al=parseFloat(obj.style.opacity);al+=0.02;
			obj.style.opacity=al;
			if(al<(endInt/100))
			{setTimeout(function(){showBackground(obj,endInt)},5);}
		}
	}
	//chose the pop up window
	function closeWindow()
	{
		if(document.getElementById('back')!=null)
		{
			document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
		}
		if(document.getElementById('mesWindow')!=null)
		{
			document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
		}
	}
	//test pop up
	function popFlash(ev,flashName,title,width,height)
	{
		showFlashWindow(title,width,height,flashName);
	}
