﻿// JScript 文件

   var adLeftSrc = "images/ad-02.swf"//图片地址

   var adLeftHref = "http://www.mq160.com"
   var adLeftWidth = 85
   var adLeftHeight = 255
   var adRightSrc = "images/ad-02.swf"//图片地址

   var adRightHref = "http://www.mq160.com"
   var adRightWidth = 85
   var adRightHeight = 255
   var marginTop = 250 //在这里更改距离浏览器底端的高度
   var marginLeft = 5//在这里更改距离浏览器右端的高度
   var navUserAgent = navigator.userAgent
   function load(){
        judge();
        move();
   }
   function move() {
        judge();
        setTimeout("move();",200)
   }
   function judge(){
    if (navUserAgent.indexOf("Firefox") >= 0 || navUserAgent.indexOf("Opera") >= 0) {
     if (adLeftSrc != "") {document.getElementById("adLeftFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.body.clientHeight > document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight) - adLeftHeight - marginTop + 'px';}
     if (adRightSrc != "") {
      document.getElementById("adRightFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.body.clientHeight > document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight) - adRightHeight - marginTop + 'px';
      document.getElementById("adRightFloat").style.left = ((document.body.clientWidth > document.documentElement.clientWidth)?document.body.clientWidth:document.documentElement.clientWidth) - adRightWidth - marginLeft + 'px';
     } 
    }
    else{
     if (adLeftSrc != "") {document.getElementById("adLeftFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.documentElement.clientHeight == 0)?document.body.clientHeight:document.documentElement.clientHeight) - adLeftHeight - marginTop + 'px';}
     if (adRightSrc != "") {
      document.getElementById("adRightFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.documentElement.clientHeight == 0)?document.body.clientHeight:document.documentElement.clientHeight) - adRightHeight - marginTop + 'px';
      document.getElementById("adRightFloat").style.left = ((document.documentElement.clientWidth == 0)?document.body.clientWidth:document.documentElement.clientWidth) - adRightWidth - 15 - marginLeft + 'px';  //我自己多减了15
     }
    }
    if (adLeftSrc != "") {document.getElementById("adLeftFloat").style.left = marginLeft + 'px';}
   }
   
   



function close_float_left(){
document.getElementById("adLeftFloat").style.display="none"; 
}

function close_float_right(){
document.getElementById("adRightFloat").style.display="none"; 
}