var popWinoldonloadHndlr=window.onload, popWinpopupHgt, popWinactualHgt, popWintmrId=-1, popWinresetTimer;
var popWintitHgt, popWincntDelta, popWintmrHide=-1, popWinhideAfter=5000, popWinhideAlpha, popWinhasFilters=true;
var popWinnWin, popWinshowBy=null, popWindxTimer=-1, popWinpopupBottom;

var popWinnText,txtPopMessage,txtPopTitle,boolPopChange=false;

//window.onload=popWinCN_winLoad;
//boolPopChange to trigger title and text change, txtPopMessage for message, txtPopTitle for title.
	popWinnText="<head><title>COR CFRS</title><style type=\"text/css\">body {    background:#E0E9F8; padding:5px;    filter:progid:DXImageTransform.Microsoft.Gradient(     GradientType=0,StartColorStr='#FFE0E9F8', EndColorStr='#FFFFFFFF');  }  h1 {    font:bold 16px arial,sans-serif; color:#1F336B;     text-align:center; margin:0px;  }  p {    font:14px arial,sans-serif; color:#1F336B;  }</style></head><body><h1>COR CRS</h1><p>Text to display in new window.</p></body>";

function popWinCN_ShowPopup(show)
{
	try{
		if (popWindxTimer!=-1 && typeof(el.filters.blendTrans)!="undefined")
			el.filters.blendTrans.stop();
	}catch(e){}
	
	if ((popWintmrHide!=-1) && ((show!=null) && (show==popWinshowBy)))
	{
		clearInterval(popWintmrHide);
		popWintmrHide=setInterval(popWinCN_tmrHideTimer,popWinhideAfter);
		return;
	}
	if (popWintmrId!=-1) return;
	popWinshowBy=show;

	elCnt=document.getElementById('popWin_content')
	elTit=document.getElementById('popWin_header');
	el=document.getElementById('popWin');
	el.style.left='0';
	el.style.top='';
	el.style.filter='';

	if (popWintmrHide!=-1) clearInterval(popWintmrHide); popWintmrHide=-1;

	document.getElementById('popWin_header').style.display='none';
	document.getElementById('popWin_content').style.display='none';
	
	
	if(null!=show){
		el.style.bottom=''
		el.style.top=show.style.height;
		el.style.right=show.style.width;
	}else{
		if (navigator.userAgent.indexOf('Opera')!=-1)
			el.style.bottom=(document.body.scrollHeight*1-document.body.scrollTop*1
				-document.body.offsetHeight*1+1*popWinpopupBottom)+'px';
	}
	if (boolPopChange)
	{
		boolPopChange=false;
		document.getElementById('popWinaCnt').innerHTML=txtPopMessage;
		document.getElementById('popWintitleEl').innerHTML=txtPopTitle;
	}

	popWinactualHgt=0; el.style.height=popWinactualHgt+'px';
	el.style.visibility='';
	if (!popWinresetTimer) el.style.display='';
	popWintmrId=setInterval(popWinCN_tmrTimer,(popWinresetTimer?1000:20));
}

	function popWinCN_winLoad()
	{
		if (popWinoldonloadHndlr!=null) popWinoldonloadHndlr();

		elCnt=document.getElementById('popWin_content')
		elTit=document.getElementById('popWin_header');
		el=document.getElementById('popWin');
		popWinpopupBottom=el.style.bottom.substr(0,el.style.bottom.length-2);

		popWintitHgt=elTit.style.height.substr(0,elTit.style.height.length-2);
		popWinpopupHgt=el.style.height;
		popWinpopupHgt=popWinpopupHgt.substr(0,popWinpopupHgt.length-2); popWinactualHgt=0;
		popWincntDelta=popWinpopupHgt-(elCnt.style.height.substr(0,elCnt.style.height.length-2));

		if (false)
		{
			popWinresetTimer=true;
			popWinCN_ShowPopup(null);
		}
	}

	function popWinCN_tmrTimer()
	{
		el=document.getElementById('popWin');
		if (popWinresetTimer)
		{
			el.style.display='';
			clearInterval(popWintmrId); popWinresetTimer=false;
			popWintmrId=setInterval(popWinCN_tmrTimer,20);
		}
		popWinactualHgt+=5;
		if (popWinactualHgt>=popWinpopupHgt)
		{
			popWinactualHgt=popWinpopupHgt; clearInterval(popWintmrId); popWintmrId=-1;
			document.getElementById('popWin_content').style.display='';
			if (popWinhideAfter!=-1) popWintmrHide=setInterval(popWinCN_tmrHideTimer,popWinhideAfter);
		}
		if (popWintitHgt<popWinactualHgt-6)
			document.getElementById('popWin_header').style.display='';
		if ((popWinactualHgt-popWincntDelta)>0)
		{
			elCnt=document.getElementById('popWin_content')
			elCnt.style.display='';
			elCnt.style.height=(popWinactualHgt-popWincntDelta)+'px';
		}
		el.style.height=popWinactualHgt+'px';
	}

	function popWinCN_tmrHideTimer()
	{
		clearInterval(popWintmrHide); popWintmrHide=-1;
		el=document.getElementById('popWin');
		if (popWinhasFilters)
		{
			backCnt=document.getElementById('popWin_content').innerHTML;
			backTit=document.getElementById('popWin_header').innerHTML;
			document.getElementById('popWin_content').innerHTML='';
			document.getElementById('popWin_header').innerHTML='';
			el.style.filter='blendTrans(duration=1)';
			el.filters.blendTrans.apply();
			el.style.visibility='hidden';
			el.filters.blendTrans.play();
			document.getElementById('popWin_content').innerHTML=backCnt;
			document.getElementById('popWin_header').innerHTML=backTit;
		  
			popWindxTimer=setInterval(popWinCN_dxTimer,1000);
		}
		else el.style.visibility='hidden';
	}

	function popWinCN_dxTimer()
	{
		clearInterval(popWindxTimer); popWindxTimer=-1;
	}

	function popWinCN_Close()
	{
		if (popWintmrId==-1)
		{
			el=document.getElementById('popWin');
			el.style.filter='';
			el.style.display='none';
			if (popWintmrHide!=-1) clearInterval(popWintmrHide); popWintmrHide=-1;
		  
		}
	}
	function popWinCN_ShowDialog(strURL, strWidth, strHeight)
	{
		if (popWinnWin!=null) popWinnWin.close();
		popWinnWin=window.open(strURL,'popWinnWin','width='+strWidth +', height='+strHeight +', scrollbars=no, '+
			'menubar=no, resizable=no, status=no, toolbar=no, location=no, titlebar=no');
		//popWinnWin.document.write(popWinnText);
	}


