function getCookie(_1,_2){var _3=(_2==null)?document:_2.document;var _4=_1+"=";var _5=_4.length;var _6=_3.cookie.length;var i=0;while(i<_6){var j=i+_5;if(_3.cookie.substring(i,j)==_4){return getCookieVal(j,_3);}i=_3.cookie.indexOf(" ",i)+1;if(i==0){break;}}return null;}function getCookieVal(_9,_a){var _b=_a.cookie.indexOf(";",_9);if(_b==-1){_b=_a.cookie.length;}return decodeURIComponent(_a.cookie.substring(_9,_b));}function findPos(_c){var _d=0;var _e=0;do{_d+=_c.offsetLeft;_e+=_c.offsetTop;}while(_c=_c.offsetParent);return [_d,_e];}var currentWidth=0;var com;addEventListener("load",function(){setTimeout(detectOrient,0);},false);function detectOrient(){if(window.innerWidth!=currentWidth){currentWidth=window.innerWidth;var _f=currentWidth<321?1:2;if(com==null){com=_f;}if(com!=_f){windowOrient();com=_f;}}}setInterval(detectOrient,400);window.onorientationchange=function(){windowOrient();};function windowOrient(){if($("feedForm").style.display=="block"){var par=document.body;var t=par.offsetTop;var _12=$("gyBG");_12.style.width=document.body.scrollWidth;_12.style.top=0;_12.style.height=document.body.scrollHeight;var _13=$("feedForm");var _14=(par.offsetWidth/2)-(_13.offsetWidth/2);_13.style.left=_14;_13.style.top=t+25;var _15=$("mainCont");_15.style.display="block";_15.style.left=_14+4;_15.style.top=t+85;window.scrollTo(0,t);}handleWindowOrient();}function $(id){return document.getElementById(id);}String.prototype.trim=new Function("return this.replace(/^\\s+|\\s+$/g,'')");function sendFeedBackMail(){var _17=$("feedfrom").value.trim();var _18=$("feedcont").value.trim();var _19=window.location;var _1a=echeckFeedBack(_17);if(!_1a||_18==""){if(!_1a){$("feederrmsg").innerHTML=propDataFeed.result.mailvalidate;}else{if(_18==""){$("feederrmsg").innerHTML=propDataFeed.result.contentvalidate;}}return;}$("submitBut").onclick=null;var _1b="&from="+encodeURIComponent(_17)+"&message="+encodeURIComponent(_18)+"&refererurl="+encodeURIComponent(_19);var _1c=getXmlhttpFeed();_1c.open("POST","/submitfeedback",true);_1c.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");_1c.send(_1b);_1c.onreadystatechange=function(){if(_1c.readyState==4){if((_1c.status==200)||(_1c.status==0)){showResult(propDataFeed.result.successmsg,true);closeForm();}else{showResult(propDataFeed.result.errormsg,false);closeForm();}}};}function getXmlhttpFeed(){if(window.XMLHttpRequest){var _1d=new XMLHttpRequest();}else{try{var _1d=new ActiveXObject("Microsoft.XMLHTTP");}catch(ee){try{var _1d=new ActiveXObject("Microsoft.XMLDOM");}catch(e){var _1d=new ActiveXObject("Msxml2.XMLHTTP");}}}return _1d;}function hideStatusMessage(){$("feedstatus").style.display="none";$("feedmsg").className="sucmsg";}function showResult(_1e,_1f){if(_1f){$("feedstatus").className="status";}else{$("feedstatus").className="err";$("feedmsg").className="errmsg";}$("feedstatus").style.display="block";$("feedmsg").innerHTML=_1e;setTimeout("hideStatusMessage()",2000);}function echeckFeedBack(str){var at="@";var dot=".";var lat=str.indexOf(at);var _24=str.length;if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==(_24-1)){return false;}if(str.indexOf(dot)==-1||str.indexOf(dot)==0){return false;}if(str.indexOf(at,(lat+1))!=-1){return false;}if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){return false;}if(str.indexOf(dot,(lat+2))==-1){return false;}return true;}function feedbackPop(mod){if($("submitBut").onclick==null){$("submitBut").onclick=sendFeedBackMail;}findCanvasDim();var par=document.body;var t=par.offsetTop;var _28=$("gyBG");var _29=$("feedForm");if(_28.parentNode!=document.body){document.body.appendChild(_28);document.body.appendChild(_29);}_28.style.display="block";_28.style.top=0;_28.style.height=document.body.scrollHeight;_28.style.width=document.body.scrollWidth;_29.style.display="block";var _2a=(par.offsetWidth/2)-(_29.offsetWidth/2);_29.style.left=_2a;_29.style.top=t+25;var _2b=$("mainCont");_2b.style.display="block";_2b.style.left=_2a+4;_2b.style.top=t+85;window.scrollTo(0,t);}var canvasWidth=0;var canvasHeight=0;function findCanvasDim(){var _2c=_2c;var _2d=_2d;if(typeof (window.innerWidth)=="number"){canvasWidth=window.innerWidth-(_2c&&_2c.scrollLeft);canvasHeight=window.innerHeight;}else{if(_2d&&(_2d.clientWidth||_2d.clientHeight)){canvasWidth=_2d.clientWidth;canvasHeight=_2d.clientHeight;}else{if(_2c&&(_2c.clientWidth||_2c.clientHeight)){canvasWidth=_2c.clientWidth;canvasHeight=_2c.clientHeight;}}}}function closeForm(){$("gyBG").parentNode.style.height="";$("feederrmsg").innerHTML="";$("feedfrom").value=$("userEml").value.trim();$("gyBG").style.display="none";$("feedForm").style.display="none";$("feedcont").value="";$("mainCont").style.display="none";window.scrollTo(0,1);}function footerTop(){window.scrollTo(0,1);}function setMailPreviewCookie(_2e){var dt=new Date();dt.setTime(dt.getTime()+365*24*60*60*1000);setCookie("ZOHOMOBILE_MAILPREVIEW",_2e,dt);}function getMailPreviewCookie(){return getCookie("ZOHOMOBILE_MAILPREVIEW");}function redirectMailPreview(_30){if("no"==getMailPreviewCookie()){return true;}switch(_30){case "inbox":window.location.href="/mail2?page=inbox#inbox/0/N/inbox/all/0";break;case "compose":window.location.href="/mail2#compose";break;case "unread":window.location.href="/mail2?page=unread#unread/0/N/all/unread/0";break;default:window.location.href="/mail2#folderslist";break;}}function switchToMail(_31){setMailPreviewCookie("new"==_31?"yes":"no");window.location.href=("new"==_31)?"/mail2":"/mail";}function getCookie(_32){try{var _33=document.cookie.split(";");var _34=_33.length;for(var i=0;i<_34;++i){var _36=_33[i];var _37=_36.split("=");if(_32==_37[0].trim()){return decodeURIComponent(_37[1]);}}}catch(e){}return null;}function setCookie(_38,_39,_3a,_3b,_3c,_3d){var _3e=_38+"="+encodeURIComponent(_39);if(_3a&&_3a instanceof Date){_3e+="; expires="+_3a.toGMTString();}if(_3b){_3e+="; path="+_3b;}if(_3c){_3e+="; domain="+_3c;}if(_3d){_3e+="; secure";}document.cookie=_3e;}function deleteCookie(_3f,_40){var exp=new Date();exp.setTime(exp.getTime()-1);var _42=getCookie(_3f);if(!_40){_40="/";}document.cookie=_3f+"="+_42+"; expires="+exp.toGMTString()+"; path="+_40;}function setMailPreviewCookie(_43){var dt=new Date();dt.setTime(dt.getTime()+365*24*60*60*1000);setCookie("ZOHOMOBILE_MAILPREVIEW",_43,dt);}function getMailPreviewCookie(){return getCookie("ZOHOMOBILE_MAILPREVIEW");}var isOpen=false;var startPos=startDiff=touchPosition=0;var hContainer=contStyle=scrollBar1=scrollBar2=appcont=null;function initDomGlobals(){hContainer=$("contd");if(!hContainer){return;}contStyle=hContainer.style;scrollBar1=$("scrollb");scrollBar2=$("scrollb1");appcont=$("appleCont");}function hSetPosition(_45){touchPosition=_45;contStyle.display="block";setTimeout("t3d("+touchPosition+")",20);var _46=window.innerHeight;if(touchPosition==_46){isOpen=true;var np=window.innerHeight;setHeight();gridLayout();setTimeout("t3d("+np+")",30);}else{if(touchPosition==0){isOpen=false;setHeight();setTimeout(hideContent,400);}}}function t3d(_48){contStyle.webkitTransform="translate3d(0,"+_48+"px,0)";}function hideContent(){contStyle.display="none";window.scrollTo(0,1);}function hTouchStart(e){var _4a=e.srcElement;var _4b=_4a.getAttribute("menuitem")||_4a.parentNode.getAttribute("menuitem");if(_4b){return;}scrollBar1.style.opacity="1";e.preventDefault();e.stopPropagation();contStyle.webkitTransitionDuration="0ms";startPos=touchPosition;startDiff=e.touches[0].pageY-touchPosition;appcont.addEventListener("touchmove",hTouchMove,false);appcont.addEventListener("touchend",hTouchEnd,false);scrollBar1.addEventListener("touchend",hTouchEnd,true);scrollBar2.addEventListener("touchend",hTouchEnd,true);}function hTouchMove(e){var _4d=e.touches[0].pageY-startDiff;var _4e=window.innerHeight;if(_4d<0){_4d=0;}else{if(_4d>_4e){_4d=_4e;}}touchPosition=_4d;}function hTouchEnd(e){var _50=(touchPosition>startPos)?(touchPosition-startPos):(startPos-touchPosition);var _51=window.innerHeight;contStyle.webkitTransitionDuration="400ms";var _52=e.srcElement;if(_52&&_52.getAttribute("pulldown")){hSetPosition(isOpen?0:_51);}else{if(_50>3){var n=(touchPosition==_51||!isOpen)?3:1;hSetPosition(touchPosition>_51/n?_51:0);}}scrollBar1.removeEventListener("touchend",hTouchEnd);scrollBar2.removeEventListener("touchend",hTouchEnd);appcont.removeEventListener("touchmove",hTouchMove);appcont.removeEventListener("touchend",hTouchEnd);}window.addEventListener("onresize",setHeight,true);window.addEventListener("onresize",setOrient,true);window.addEventListener("onorientationchange",setOrient,true);setInterval(setOrient,400);var cW=0;function setOrient(){if(window.innerWidth!=cW){cW=window.innerWidth;isOpen&&hSetPosition(0);}}function setHeight(){var sh=window.innerHeight;$("switchbg").style.height=sh-25+"px";contStyle.top="-"+sh+"px";}function changeService(_55){var map={"mail":"/mail2","docs":"/docs#docshome"};var url=map[_55];if(!_55){url="/";}else{if(!url){url="/"+_55;}}if(_55==curModule){hSetPosition(0);return;}hSetPosition(0);window.location.href=url;}function showSwitch(){contStyle.display=isOpen?"none":"block";if(!isOpen){contStyle.top="0px";gridLayout();}isOpen=!isOpen;}function gridLayout(){var els=["mailpos","createpos","docpos","calpos","invpos","crmpos","projpos"];var sh=window.innerHeight;$("toptile").style.display=(sh<=220)?"none":"block";var avH=sh-((sh<=220)?25:75);var avW=window.innerWidth;var _5c=parseInt(avW/100);var _5d=parseInt(avH/80);var _5e=_5c;var _5f=avW-(_5c*100);var _60=Math.ceil(7/_5e);var _61=avH-(_60*80);var _62=parseInt((_5f/_5e)/2)+"px";var _63=parseInt((Math.max(0,_61/_60))/2)+"px";for(var i=0;i<7;++i){var _65=$(els[i]).style;_65.marginLeft=_62;_65.marginRight=_62;_65.marginTop=_63;_65.marginBottom=_63;}}function hideSwitch(){return;}function domLoaded(){if(isDomLoadDone){return;}isDomLoadDone=true;initDomGlobals();if(hasAnimation()){scrollBar1.addEventListener("touchstart",hTouchStart,true);scrollBar2.addEventListener("touchstart",hTouchStart,true);scrollBar2.addEventListener("click",hTouchEnd,true);scrollBar1.addEventListener("click",hTouchEnd,true);appcont.addEventListener("touchstart",hTouchStart,false);}else{scrollBar1.addEventListener("click",showSwitch,true);scrollBar2.addEventListener("click",showSwitch,true);}setHeight();gridLayout();hSetPosition(0);window.layout&&layout();}var uAgent=navigator.userAgent;function hasAnimation(){return uAgent.match(/webkit/i);}var isDomLoadDone=false;if(document.addEventListener){document.addEventListener("DOMContentLoaded",domLoaded,false);}else{if(document.all&&!window.opera){document.write("<script type=\"text/javascript\" id=\"contentloadtag\" defer=\"defer\" src=\"javascript:void(0)\"></script>");var contentloadtag=document.getElementById("contentloadtag");contentloadtag.onreadystatechange=function(){if(this.readyState=="complete"){domLoaded();}};}}var _domTimer;if(/Safari/i.test(uAgent)){_domTimer=setInterval(handleDomLoaded,10);}function handleDomLoaded(){if(/loaded|complete/.test(document.readyState)){clearInterval(_domTimer);domLoaded();}}window.onload=function(){setTimeout(domLoaded,0);};
