﻿function ReImgSize(img){ 
  if (img.width>580) 
  { 
      var oWidth=img.width; 
      var oHeight=img.height; 
      img.width="580"; 
      img.height=oHeight*580/oWidth; 
      img.outerHTML='<a href="'+img.src+'" target="_blank" title="在新窗口打开图片">'+img.outerHTML+'</a>' 
    } 
}
function msg(){
    var p=document.createElement("DIV");
    p.id="p";
    p.style.position="absolute";
    p.style.width=document.body.scrollWidth;
    p.style.height=(document.body.offsetHeight>document.body.scrollHeight)?'100%':document.body.scrollHeight;
    p.style.zIndex='998';
    p.style.top='0px';
      p.style.left='0%';
    p.style.backgroundColor="gray";
    p.style.opacity='0.5';
    p.style.filter="alpha(opacity=80)";
    document.body.appendChild(p);
    var p1=document.createElement("DIV");
    var top=50;
    p1.style.position="absolute";
    p1.style.width="300px";
    p1.id="p1";
    var left=Math.ceil(((document.body.scrollWidth)-parseInt(p1.style.width.replace('px','')))/2)+document.body.scrollLeft;
    p1.style.height="200px";
    p1.style.zIndex='999';
    p1.style.top=top+'px';
      p1.style.left=left+'px';
    p1.style.border="0px solid green";
    var html="";
      html+="<center>"
      html+="<div class='p3' style='height:1px;overflow:hidden;background:green;width:294px;border-left:1px solid green;border-right:1px solid green;'></div>"
      html+="<div class='p2' style='height:1px;overflow:hidden;background:green;width:296px;border-left:1px solid green;border-right:1px solid green;'></div>"
      html+="<div class='p2' style='height:1px;overflow:hidden;background:green;width:298px;border-left:1px solid green;border-right:1px solid green;'></div>"
      html+="<div class='p1' style='height:20px;overflow:hidden;background:green;width:300px;border-left:1px solid green;border-right:1px solid green;color:#fff;font-size:9pt;font-weight:bold;text-align:left;'>  &nbsp;&nbsp;⊙上林网会员登陆   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<a href='javascript:this.cancle()' style='color=#FFF'>关闭</a>]</div>"
    html+="<div id='c' style='height:150px;width:300px;background-color:#F6F6F6;overflow:hidden;border-left:1px solid green;border-right:1px solid green;padding-top:2px;font-size:9pt;'><iframe id=login border=0 vspace=0 hspace=0 marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width='300' height=150  src=\"/user/login.aspx\"></iframe></div>"
      html+="<div class='p1' style='height:1px;overflow:hidden;background:#F6F6F6;width:298px;border-left:1px solid green;border-right:1px solid green;'></div>"
      html+="<div class='p2' style='height:1px;overflow:hidden;background:#F6F6F6;width:296px;border-left:1px solid green;border-right:1px solid green;'></div>"
      html+="<div class='p3' style='height:1px;overflow:hidden;background:green;width:294px;border-left:1px solid green;border-right:1px solid green'></div>"
      html+="</center>"
    document.body.appendChild(p1);
    p1.innerHTML=html;
    var arr=document.getElementsByTagName("select");
    var i=0;
    while(i<arr.length){
      arr[i].style.visibility='hidden';
      i++;
    }
    this.cancle=function(){
    document.body.removeChild(document.getElementById('p'));
    document.body.removeChild(document.getElementById('p1'));
    var arr=document.getElementsByTagName("select");
      var i=0;
      while(i<arr.length){
      arr[i].style.visibility='visible';
      i++;
      }
    }
}

function bookmarkit(){
    window.external.addFavorite('http://www.shanglin.net','上林网-广西上林县本地强势网站,贝侬,欢迎您的到来！');
}