﻿function prepage(x)
{
    var m = "div" + x;
    var n = document.getElementById("hdnPage").value;
    document.getElementById("hdnPage").value = m;
    document.getElementById(n).style.display = "none";
    document.getElementById(m).style.display = "block";
    var p = "href" + x;
    var q = document.getElementById("hdnHref").value;
    document.getElementById("hdnHref").value = p;
    document.getElementById(q).disabled = false;
    document.getElementById(p).disabled = true;
}

function prepage1(x)
{
    var m = "1div" + x;
    var n = document.getElementById("hdn1Page").value;
    document.getElementById("hdn1Page").value = m;
    document.getElementById(n).style.display = "none";
    document.getElementById(m).style.display = "block";
    var p = "1href" + x;
    var q = document.getElementById("hdn1Href").value;
    document.getElementById("hdn1Href").value = p;
    document.getElementById(q).disabled = false;
    document.getElementById(p).disabled = true;
}

function prepage2(x)
{
    var m = "2div" + x;
    var n = document.getElementById("hdn2Page").value;
    document.getElementById("hdn2Page").value = m;
    document.getElementById(n).style.display = "none";
    document.getElementById(m).style.display = "block";
    var p = "2href" + x;
    var q = document.getElementById("hdn2Href").value;
    document.getElementById("hdn2Href").value = p;
    document.getElementById(q).disabled = false;
    document.getElementById(p).disabled = true;
}

function autoResize1(iframeObj) {
// if (isFirefox=navigator.userAgent.indexOf("Firefox")>0){//ff
//     mainFrame.style.height=parseInt(mainFrame.contentWindow.document.documentElement.scrollHeight) +'px';
// }
// else if(navigator.userAgent.indexOf("MSIE")>0){//ie
//     //mainFrame.style.height=mainFrame.document.body.scrollHeight + 'px';
//     mainFrame.style.height=parseInt(mainFrame.contentWindow.document.documentElement.scrollHeight) +'px';
// }
// else if(isSafari=navigator.userAgent.indexOf("Safari")>0)
// {
//     mainFrame.style.height=parseInt(mainFrame.contentWindow.document.documentElement.scrollHeight) +'px';
// }
 
  if (iframeObj){
    if (iframeObj.contentDocument && iframeObj.contentDocument.body.offsetHeight){
      iframeObj.height = iframeObj.contentDocument.body.offsetHeight;
      } else if (document.frames[iframeObj.name].document && document.frames[iframeObj.name].document.body.scrollHeight){  iframeObj.height = document.frames[iframeObj.name].document.body.scrollHeight;
      }
    }
}

function g(o){return document.getElementById(o);}
function showimgs(val)
{
if(g(val).style.display=="none"){g(val).style.display="block"}
else{g(val).style.display="none"}
}

function cdest(num)
{
    if(num != 0)
    {
	for(var i=1;i<=3;i++)
	{
	g("btn"+i).className="dest_tabnav";
	g("tp_sct_box"+i).style.display="none";
	}
	g("btn3").className="dest_tabnav dest_small";
	g("btn"+num).className="dest_tabnav dest_now";
	if(num=="3"){g("btn"+num).className="dest_tabnav dest_smallnow";}
	g("tp_sct_box"+num).style.display="block";
    }
}

function GetMore(x)
{
    if(x == 1)
    {
        g("LCityBase").style.display="none";
        g("LCityBaseMore").style.display="block";
    }
    else
    {
        g("LCityBase").style.display="block";
        g("LCityBaseMore").style.display="none";
    }
}

function pageopen(x,y)
{
    var url;//地址
    var tipheight;//高度
    var tipwidth;//宽度
    var tiptop;//Y坐标
    var tipleft;//X坐标
    
    url="/Destinations/UploadGallery.aspx";
    tipheight = 480;
    tipwidth = 530;

    tiptop =( window.screen.availHeight - tipheight)/2 ;
    tipleft =( window.screen.availWidth   - tipwidth)/2 ;
    
    SL();

    window.showModalDialog(url,window,"dialogHeight:"+tipheight+"px; dialogWidth:"+tipwidth+"px ; dialogTop:"+tiptop+"px; dialogLeft: "+tipleft+"px; edge: Raised; center: no; help: no; resizable: no; status: no;");  
    
    var _bgDiv = document.getElementById("_bgDiv");
    if(_bgDiv != null) {
        document.body.removeChild(_bgDiv);
    }
      
   if(x == "1")
   {
    window.location.href=window.location.href;
   }
}

function SL()
{
    var sT=document.body.scrollTop; var sH=window.screen.availHeight;
    if(sT==0)sT=document.documentElement.scrollTop;
    if(document.getElementById("_bgDiv")){document.getElementById("_bgDiv").className="dis";return;}
    bgObj=document.createElement("div");bgObj.setAttribute('id','_bgDiv');
    with(bgObj.style){position="absolute";top="0";left="0";width=document.documentElement.clientWidth + "px";height=document.documentElement.clientHeight  + "px";
    if (document.documentElement.scrollWidth>document.documentElement.clientWidth)width=document.documentElement.scrollWidth+20+"px";
    if (document.documentElement.scrollHeight>document.documentElement.clientHeight)height=document.documentElement.scrollHeight+20+"px";zIndex = "100";}
    bgObj.className = "dis";document.body.appendChild(bgObj);
}

function rdoClick(x)
{
    document.getElementById("hdnRdo").value = x;
    if(x == 3)
    {
        document.getElementById("divLink").style.display = 'none';
    }
    else
    {
        document.getElementById("divLink").style.display = 'block';
    }
}