
function pageWidth() 
{return window.innerWidth != null? 
window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;}
function pageHeight() 
{return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}
function posLeft() 
{return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;}
function posTop() {return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;}
function $(x)
{
	return document.getElementById(x);
}
function scrollFix(){var obol=$('ol');
obol.style.top=posTop()+'px';obol.style.left=posLeft()+'px'}

function sizeFix(){var obol=$('ol');
obol.style.height=pageHeight()+'px';
obol.style.width=pageWidth()+'px';
}
function kp(e){ky=e?e.which:event.keyCode;
if(ky==88||ky==120)hm();
return false}
function inf(h){tag=document.getElementsByTagName('select');
for(i=tag.length-1;	i>=0;i--)tag[i].style.visibility=h;
tag=document.getElementsByTagName('iframe');
for(i=tag.length-1;i>=0;i--)tag[i].style.visibility=h;tag=document.getElementsByTagName('object');
for(i=tag.length-1;i>=0;i--)tag[i].style.visibility=h;}
function sm(obl, wd, ht){
	var h='hidden';var b='block';
	var p='px';var obol=$('ol'); 
	var obbxd = document.getElementById('mbd');
	obbxd.innerHTML = document.getElementById(obl).innerHTML;
	obol.style.height=pageHeight()+p;
	obol.style.width=pageWidth()+p;
	obol.style.top=posTop()+p;
	obol.style.left=posLeft()+p;
	obol.style.display=b;
	var tp=posTop()+((pageHeight()-ht)/2)-12;
	var lt=posLeft()+((pageWidth()-wd)/2)-12;
	var obbx=document.getElementById('mbox');
	obbx.style.top=(tp<0?0:tp)+p;
	obbx.style.left=(lt<0?0:lt)+p;
	obbx.style.width=wd+p;obbx.style.height=ht+p;
	inf(h);obbx.style.display=b;
	return false;}
function hm(){
	var v='visible';
	var n='none';
	//alert(document.getElementById('ol').style);
	document.getElementById('ol').style.display=n;
	document.getElementById('mbox').style.display=n;
	dcsMultiTrack('WT.ti','ZNA splash To ZurichCom','DCS.dcsuri','/main/home/ZNASplashToZurichCom.htm','WT.es',window.location.hostname+'/main/home/ZNASplashToZurichCom.htm');
	inf(v);
	document.onkeypress=''}
function initmb(){
	var ab='absolute';
	var n='none';
	var obody=document.getElementsByTagName('body')[0];
	var frag=document.createDocumentFragment();
	var obol=document.createElement('div');
	obol.setAttribute('id','ol');
	obol.style.display=n;obol.style.position=ab;
	obol.style.top=0;obol.style.left=0;obol.style.zIndex=998;obol.style.width='100%';
	frag.appendChild(obol);
	var obbx=document.createElement('div');
	obbx.setAttribute('id','mbox');
	obbx.style.display=n;
	obbx.style.position=ab;
	obbx.style.zIndex=999;
	var obl=document.createElement('span');
	obbx.appendChild(obl);
	var obbxd=document.createElement('div');
	obbxd.setAttribute('id','mbd');
	obl.appendChild(obbxd);
	frag.insertBefore(obbx,obol.nextSibling);
	obody.insertBefore(frag,obody.firstChild);
window.onscroll = scrollFix;
window.onresize = sizeFix;

}
function setCookie2(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function getCookie2(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}
function checkCookie2()
{
//alert("check cookie");
	var pref=getCookie2('dontPrompt');
	//alert(pref);
	if (pref!=null && pref!="")
	{
		//alert("calling hm");
			hm();
		//{
		
	}
	else 
	{
			
		var iStrCountryShortCode=trim(strCountryShortCode," ");
		//alert("1"+strCountryShortCode+"1");
		//alert("1"+iStrCountryShortCode+"1");
		if(iStrCountryShortCode != ""){
			
			//alert(strCountryShortCode);
			//alert( "Country Identified : "+iStrCountryShortCode);
			doModal();
		}
		
		
		//}
	}
}
function trim(str, chars) 
{
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function handleCheckBox()
{
	
	var chkPref=document.getElementById("chkPreferences");
	
	if (chkPref.checked==true)
	{
		setCookie2('dontPrompt',"true",95);
		
	}
	else
	{
		setCookie2('dontPrompt',"",-1);

	}
}


function doModal()
{
dcsMultiTrack('WT.ti','ZNA splash page','DCS.dcsuri','/main/home/zna-splash.htm','WT.es',window.location.hostname+'/main/home/zna-splash.htm');
sm('box',560,310); 
}

function initialize()
{
//alert("Initialize");
initmb();
checkCookie2();
//doModal();
}

                  