﻿// JScript 文件

function showtips(url,width,height){
 //dhTipsLayer:author:haoren;
 if(document.getElementById("dhtipsiframe")==null){
  var iframe = document.createElement("IFRAME");
  iframe.id = "dhtipsiframe";
  iframe.style.position = "absolute";
  iframe.style.left = 0;
  iframe.style.top = 0;
  iframe.style.width = (document.body.scrollWidth>document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
  iframe.style.height = (document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight+20:document.body.offsetHeight;
 // iframe.src=url;

  var div = document.createElement("DIV");
  div.id = "dhtipsdiv";
  div.oncontextmenu = function(){return false}
  div.onselectstart = function(){return false}
   with(div.style)
  {
   position = "absolute";
   left = 0;
   width = (document.body.scrollWidth>document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
   height = (document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight+20:document.body.offsetHeight;
   top = 0;
  }
 
        
  var div2 = document.createElement("DIV");
  div2.id = "dhtipscontent";
  div2.style.position = "absolute";
  div2.style.width=width;
  div2.style.left = document.body.offsetWidth/2-150+document.body.scrollLeft;
  div2.style.top = document.body.offsetHeight/2-150+document.body.scrollTop;
  div2.innerHTML = "<div style=\"width:500px; height:110px; overflow:hidden; border:1px solid green;  position:absolute;  right:100; bottom:400px; background:#FFFFFF;\"><div style=\"width:500px; height:30px; overflow:hidden; background: green; text-align:left; line-height:30px;font-size:14px;\"><img style=\"float:right; padding:5px;\" src=\"img/dialogCloseF.gif\"  onclick=\"document.body.style.overflow='auto';document.getElementById('dhtipsiframe').style.display='none';document.getElementById('dhtipsdiv').style.display='none';document.getElementById('dhtipscontent').style.display='none';\"/>请选择您要定制的城市：</div> <div style=\"width:500px; height:80px; overflow:hidden;\"><iframe src="+url+" allowTransparency=\"true\" frameborder=\"0\"  width=\"100%\" height=\"100%\" scrolling=\"no\"></iframe></div><div class=\"closediv\"></div></div>";
  div2.oncontextmenu = function(){return false}

   document.body.appendChild(iframe);
   document.body.appendChild(div);
  document.body.appendChild(div2);
 }
 else{
  document.getElementById("dhtipsiframe").style.display = "block";
  document.getElementById("dhtipsdiv").style.display = "block";
  document.getElementById("dhtipscontent").style.display = "block";
  document.getElementById("dhtipscontent").innerHTML ="<div style=\"width:500px; height:110px; overflow:hidden; border:1px solid green; position:absolute;  right:100; bottom:400px; background:#FFFFFF;\"><div style=\"width:500px; height:30px; overflow:hidden; background: green; text-align:left; line-height:30px;font-size:14px;\"><img style=\"float:right; padding:5px;\" src=\"img/dialogCloseF.gif\"  onclick=\"document.body.style.overflow='auto';document.getElementById('dhtipsiframe').style.display='none';document.getElementById('dhtipsdiv').style.display='none';document.getElementById('dhtipscontent').style.display='none';\"/>请选择您要定制的城市：</div> <div style=\"width:500px; height:80px; overflow:hidden;\"><iframe src="+url+" allowTransparency=\"true\" frameborder=\"0\"  width=\"100%\" height=\"100%\" scrolling=\"no\"></iframe></div><div class=\"closediv\"></div></div>";
   document.getElementById("dhtipscontent").style.left = document.body.offsetWidth/2-150+document.body.scrollLeft;
  document.getElementById("dhtipscontent").style.top = document.body.offsetHeight/2-150+document.body.scrollTop;
 }
 var l = document.body.scrollLeft;
 var t = document.body.scrollTop;
 //document.body.disabled=true;
 document.body.style.overflow = "hidden";
 document.body.scrollLeft = l;
 document.body.scrollTop = t;
}


function hiddenIframe()
{
    if(parent.document.getElementById("dhtipsiframe")!=null)
   {
       parent. document.body.style.overflow='auto';
        parent.document.getElementById('dhtipsiframe').style.display='none';
        parent.document.getElementById('dhtipsdiv').style.display='none';
        parent.document.getElementById('dhtipscontent').style.display='none';
    } 
}


//隐藏层
function hiddenIframe()
{
    if(parent.document.getElementById("dhtipsiframe")!=null)
   {
       parent. document.body.style.overflow='auto';
        parent.document.getElementById('dhtipsiframe').style.display='none';
        parent.document.getElementById('dhtipsdiv').style.display='none';
        parent.document.getElementById('dhtipscontent').style.display='none';
    } 
}

