﻿// JScript 文件
//document.oncontextmenu=new Function("event.returnValue=false;");
//document.onselectstart=new Function("event.returnValue=false;");
function getUrlParam( paramName )
{
 var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
 var oMatch = oRegex.exec( window.top.location.search ) ;
 if ( oMatch && oMatch.length > 1 )
  return unescape( oMatch[1] ) ;
 else
  return '' ;
}
function setCookie(sName,sValue,oExpires,sPath,sDomain,bSecure){
    var sCookie = sName + "=" + decodeURIComponent(sValue);
    if(oExpires){
        sCookie += "; expires =" + oExpires.toGMTString();
    }
    if(sPath){
        sCookie += "; path =" + sPath;
    }
    if(sDomain){
        sCookie += "; domain =" + sDomain;
    }
    if(bSecure){
        sCookie += "; secure";
    }
    
    document.cookie = sCookie;
    
}
function bodyonload(){
    var str = getUrlParam('languagetype');
    if( str == 'us'){
       setCookie("SunDooLanguage","en-us",new Date(Date.parse("Jan 1,2906"))); 
       window.location.href = window.location.href.split('?')[0];
    }else if(str == 'cn'){
        setCookie("SunDooLanguage","zh-CN",new Date(Date.parse("Jan 1,2906")));
        window.location.href = window.location.href.split('?')[0];
    }

}
