var currentPage = location.href;

if(currentPage.indexOf(".aspx")>0)
{
    if(currentPage.indexOf("_cn.aspx")>0)
    {
    }
    else
    {
        currentPage = currentPage.replace(".aspx","_cn.aspx");
    }
}

if(currentPage=="http://cms.nederlanderworld.com/")
    currentPage="http://cms.nederlanderworld.com/default_cn.aspx";


//currentPage = currentPage.replace("www.","ch.");
//var currentPage = currentURL.replace("staging.","ch.");
//currentPage = currentPage.replace("cms.","ch.");
function selectFocusTextarea(n)
{
    var select_val = document.getElementById(n);
    select_val.focus();
    select_val.select();
}

 function selectTextarea(n)
 {
    var select_val = document.getElementById(n);
    select_val.select();
 }

function addressPopup(id)
{
	var url = "http://maps.google.com/?q=" + escape(id);
	openCenteredWindow(url, "", 740, 660, false, false);
}

function isEnterKeyPressed(e)
{
	var whichCode = (window.Event) ? e.which : e.keyCode;
	return (whichCode==13);
}

function opWinScroll(w,h,url,nam) {
 specs = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=" + w + ",height=" + h
	window.open(url,nam,specs)
}

function opWin(w,h,url,nam) {
 specs = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no,width=" + w + ",height=" + h
	window.open(url,nam,specs)
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeCss(id, newClass) {
    var switch_id = document.getElementById(id);
    switch_id.className = newClass;
}

function changeCssHelp(id) {
    var switch_id = document.getElementById(id);
    
    if(switch_id.className == 'hideHelp')
    {
        switch_id.className = 'showHelp';
    }
    else
    {
        switch_id.className = 'hideHelp';
    }
}

function changeCss_MapAllOff() {
    document.getElementById("mapid_Anhui").className = "mapid_Off";
    document.getElementById("mapid_Beijing").className = "mapid_Off";
    document.getElementById("mapid_Hubei").className = "mapid_Off";
    document.getElementById("mapid_Jiangsu").className = "mapid_Off";
    document.getElementById("mapid_Shaanxi").className = "mapid_Off";
    document.getElementById("mapid_Shanghai").className = "mapid_Off";
    document.getElementById("mapid_Tianjin").className = "mapid_Off";
    document.getElementById("mapid_Zhejiang").className = "mapid_Off";
}

function changeCss_CityAllOff() {
    document.getElementById("divContent_Left_CityList_Anhui").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Beijing").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Hubei").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Jiangsu").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Shaanxi").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Shanghai").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Tianjin").className = "cityDisplay_No";
    document.getElementById("divContent_Left_CityList_Zhejiang").className = "cityDisplay_No";
}