var DOM=document.getElementById?1:0;var isIE=(navigator.appName.indexOf("Microsoft") != -1)?true:false;
var isNS6=(DOM && parseInt(navigator.appVersion) >= 5)?1:0;var def_dhlAlert="1.0";
var defWt=300;var defHt=200;var maxHt=screen.availHeight/2;
var win;var winpop;var winStats='toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width=694,height=525';var dhlglobal=null;
function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr == -1) endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}
function FixCookieDate(date){var base=new Date(0);var skew=base.getTime();if(skew > 0) date.setTime(date.getTime()-skew);}
function GetCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i < clen){var j=i+alen;if(document.cookie.substring(i,j) == arg) return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i == 0) break;}return null;}
function SetCookie(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+((expires) ? "; expires="+expires.toGMTString():"")+((path) ? "; path="+path : "")+((domain) ? "; domain="+domain : "")+((secure) ? "; secure" : "");}
function DeleteCookie(name,path,domain){if(GetCookie(name)){document.cookie=name+"="+((path) ? "; path="+path : "")+((domain) ? "; domain="+domain : "")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function setCookies(locn){expiry=60*60*24*365;var expDate=new Date();FixCookieDate(expDate);expDate.setTime(expDate.getTime()+expiry);SetCookie("dhlcom",locn,expDate,'/',null,null);}
if (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion) >= 4) {var aboveNN4=true;}
if (navigator.appName.indexOf("Explorer") >= 0 && parseInt(navigator.appVersion) >= 4) {var aboveIE4=true;}
if(typeof(def_validateForm)!= "undefined") {alertMethod="dhlAlert";alertMIME="html";}
function keyPress(d){key=aboveNN4 ? d.which : win.event.keyCode;if(key == 13) winClose();}
function winClose(selfRef){if(typeof(win) == 'object' && !win.closed) win.close();else if (typeof(selfRef) == 'object') selfRef.close();return true;}
function dhlAlert(name,text,Wt,Ht){winClose();Wt=defWt;Ht=defHt;if(Ht>maxHt) Ht=maxHt;win=open("","dhl_alert","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+Wt+",height="+Ht);
win.document.write('<html><head><title>'+name+'</title>'+'<link rel="stylesheet" type="text/css" href="'+instance+'http://www.cn.dhl.com/css/general/generalPopup.css"/></head>'+'<body onload=focus(); leftmargin=0 topmargin=0 marginwidth="0" marginheight="0">'+'<table border="0" cellpadding="6" width="100%" height="5%">'+'<tr><td height="16" class="helpHeading">'+name+'</td></tr>'+'</table>'+'<table border="0" cellpadding="6" width="100%" height="95%">'+'<tr><td valign="top" height="75%">'+text+'</td></tr>'+'<tr><td align="center" valign="bottom" width="100%" height="25%"><a href="javascript:opener.winClose(this)">Close</a></td></tr>'+'</table></body></html>');
if (aboveNN4 && typeof(win) == 'object' && !win.closed){win.captureEvents(Event.KEYDOWN);win.onkeydown=keyPress;}else if (aboveIE4 && typeof(win) == 'object' && !win.closed){win.document.onkeydown=keyPress;}win.document.close();win.focus();return win;}
function popupGlobal(url,winWt,winHt,menu,posLinks,posTop,winName,scrollBars)
{var scrWt=(screen.availWidth) ? screen.availWidth : 800;var scrHt=(screen.availHeight) ? screen.availHeight : 600;
	if ((winWt == null) || (winWt <= 100) || (winWt > scrWt)) winWt=scrWt-100;if ((winHt == null) || (winHt <= 100) || (winHt > scrHt-75)) winHt=scrHt-75;
	if ((posLinks == null) || (posLinks < 0) || (scrWt < posLinks+winWt)) posLinks=(scrWt-winWt)/2;if ((posTop == null) || (posTop < 0) || (scrHt < posTop+winHt)) posTop=(scrHt-winHt)/2-20;
	if (posTop < 0) posTop=0;if ((menu != 0) && (menu != 1)) menu=0;
	if (winpop && (winpop.closed != true)) winpop.close();if (winName == null) winName='w1' ;
	if (scrollBars == null) scrollBars=0 ;winpop=window.open(url,winName,'toolbar=0,location=0,directories=0,status=0,menubar='+menu+',scrollbars='+scrollBars+',resizable=0,width='+winWt+',height='+winHt+',left='+posLinks+',top='+posTop);
	winpop.focus();if (winpop.opener == null){self.name='text';winpop.opener=self;}return false;}
function popupclose(){if (winpop && (winpop.closed == false)) winpop.close();}
function popup(url,winWt,winHt,menu,posLinks,posTop){return popupGlobal(url,winWt,winHt,menu,posLinks,posTop);}
function popuphelp(url,winWt,winHt,menu,posLinks,posTop){return popupGlobal(url,winWt,winHt,menu,posLinks,posTop);}
function checkDPLogo(){menuBottom=getlayerheight('menu');var dhlLogoht=getlayerheight('logodpwn');if(getElt("logodpwn")==null){return;}newXPos=14;newYPos=Math.max(getwindowheight()-dhlLogoht,menuBottom+dplogoDist);moveLayer("logodpwn",newXPos,newYPos);if( dplogoTimer!=null){clearTimeout(dplogoTimer);}dplogoTimer=setTimeout("checkDPLogo()",dplogoDelay);}
function checkTrack(){awbValue=document.fastTrack.elements['AWB'].value;if(awbValue=="" || (awbValue).indexOf(" ") != -1){dhlAlert(fasttrack_msg001,fasttrack_msg002);document.fastTrack.elements['AWB'].value="";return false;}else{return true;}}
function getTOD(){mydate=new Date();hour=mydate.getHours();if(hour<12) return date_msg001;if(hour<19)return date_msg002;return date_msg003;}