
var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var isDebug="false";var App=new Object();App.core=new Object();App.tool=new Object();var Request=new Object();var version="1006151553";function handleError(){return true;}
if(isDebug=="false")window.onerror=handleError;function changetheme(){try{changetheme2();}catch(err){}}
var UserContext=new Object();UserContext.ua=new Object();UserContext.cnhost="cn.veivo.com";UserContext.myhost="my.veivo.com";UserContext.mainhost="www.veivo.com";UserContext.isbase=true;if(window.location.href.indexOf(UserContext.myhost)>-1){UserContext.isbase=false;}
var pResize;UserContext.ua.isIE=window.ActiveXObject?true:false;UserContext.ua.isFirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);function init(){var header=document.getElementsByTagName('head')[0];var s=document.createElement('script');s.setAttribute('src','/js/core.gjs?v='+version);s.setAttribute('type','text/javascript');if(UserContext.ua.isFirefox){header.appendChild(s);s.onload=function(){UserContext.checkLogin();window.onresize=publishResize;}}else{header.appendChild(s);fixie();}}
function fixie(){if(UserContext.checkLogin){UserContext.checkLogin();window.onresize=publishResize;}else{setTimeout(fixie,1);}}
function gc(){}
Request.send=function(url,method,callback,data,urlencoded,args){var req;if(window.XMLHttpRequest){req=new XMLHttpRequest();}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");}
req.onreadystatechange=function(){if(callback==null)
return;if(req.readyState==4){if(req.status<400){(method=="POST")?callback(req,args):callback(req,data);}}};if(method=="POST"){req.open("POST",url,true);if(urlencoded)req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');req.send(data);}else{req.open("GET",url,true);req.send(null);}
return req;};Request.sendRawPOST=function(url,data,callback){Request.send(url,"POST",callback,data,false);};Request.sendPOST=function(url,data,callback,args){if(UserContext!=null&&UserContext.defaultPage!=null)
data=data+'&pageid='+UserContext.page[UserContext.defaultPage].id;Request.send(url,"POST",callback,data,true,args);};Request.sendGET=function(url,callback,args){if(UserContext!=null&&UserContext.defaultPage!=null){if(args!=null&&UserContext.page[UserContext.defaultPage]==null){return Request.send(url+'&sessionid='+UserContext.sessionId+'&v='+Math.random()+'&pageid='+args,"GET",callback,args);}else
return Request.send(url+'&sessionid='+UserContext.sessionId+'&v='+Math.random()+'&pageid='+UserContext.page[UserContext.defaultPage].id,"GET",callback,args);}
return Request.send(url+'&sessionid='+UserContext.sessionId+'&v='+Math.random(),"GET",callback,args);};function syncXmlHttpRequest(url){req=false;url=url+'&r='+Math.random();if(window.XMLHttpRequest){try{req=new XMLHttpRequest();}catch(e){req=false;}}else if(window.ActiveXObject){try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){req=false;}}}
if(req){req.open("GET",url,false);req.send("");if(req.status==200){return req.responseXML;}}}
function xmlAttributes(oNode){var tAttributes={};for(var i=0;i<oNode.attributes.length;++i)
tAttributes[oNode.attributes.item(i).name]=oNode.attributes.item(i).value;return tAttributes;}
function xmlChildNodes(oParent,sChildName){var tNodes=[];var e=oParent.firstChild;while(e!=null){if(e.nodeName==sChildName)
tNodes.push(e);e=e.nextSibling;}
return tNodes;}
function syncXmlHttpRequestText(url){req=false;url=url+'&v='+Math.random();if(window.XMLHttpRequest){try{req=new XMLHttpRequest();}catch(e){req=false;}}else if(window.ActiveXObject){try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){req=false;}}}
if(req){req.open("GET",url,false);req.send("");if(req.status==200){return req.responseText;}}}
function encode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+
keyStr.charAt(enc3)+keyStr.charAt(enc4);}while(i<input.length);return output;}
function decode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}
if(enc4!=64){output=output+String.fromCharCode(chr3);}}while(i<input.length);return output;}
function userOnLoad(){checkUser();}
function checkUser(){var user=getCookie("u");var pass=getCookie("p");if(user!=null&&pass!=null){var result=syncXmlHttpRequest("/UserAdmin?atx=VerifyPassword&username="+user+"&password="+decode64(pass));if(result){if(result.documentElement.childNodes[0].nodeValue=="true"){window.location.href="/";}}}}
function userVerify(){document.login_form.j_username.value=_trim(document.login_form.j_username.value);var res;if(document.login_form._persistent.checked){res=syncXmlHttpRequest("/UserAdmin?atx=Persist&pass="
+encode64(document.login_form.j_password.value)
+"&user="+document.login_form.j_username.value);}else{res=syncXmlHttpRequest("/UserAdmin?atx=NoPersist&pass="
+encode64(document.login_form.j_password.value)
+"&user="+document.login_form.j_username.value);}
if(res){window.location.href="/";}else{alert(App.locale.pageloginerror);}
return false;}
function _trim(a){return a.replace(/^\s*|\s*$/g,"")}
function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));}
function setCookie(name,value,expiretime){document.cookie=name+'='+value+'; expires='+expiretime+'; domain=.veivo.com; path=/;';}