﻿// JavaScript Document

var smallrightshowad = true;
var smallrightToppx = 180;   //上端位置
var smallrightAdDivW = 96;  //宽度
var smallrightAdDivH = 231;  //高度
var smallrightPageWidth = 1000; //页面多少宽度象素下正好不出现左右滚动条
var smallrightMinScreenW = 1024; //显示广告的最小屏幕宽度象素 

var AdRightHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"><a href=/tabid/94/Default.aspx><img src="/Portals/0/skins/tacoachphase2/images/RightBanner.jpg" width=96 height=231 border=0></a></div>';
var CloseRightbuttonHtml = '<div align="center" style="position: absolute;top:231px;right:0px;padding:4px 0px;z-index:2000;width:96px;background-color:#f6f6f6"><a href="javascript:hidesmallrightad();" style="color:black;text-decoration:none;font-size:12px;">关闭</a></div>';
document.write ('<div id="smallRightDiv" style="position: absolute;background-color:white;z-index:1000;width:'+smallrightAdDivW+'px;height:'+smallrightAdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+AdRightHtml+CloseRightbuttonHtml+'</div>');

function smallrightscall(){
 if(!smallrightshowad){return;}
 
 if (window.screen.width<smallrightMinScreenW){
  //alert("临时提示：\n\n显示器分辨率宽度小于"+MinScreenW+",不显示广告");
  smallrightshowad = false;  
  document.getElementById("smallRightDiv").style.display="none";
  return;
 } 
  
 var Borderpx = ((window.screen.width-smallrightPageWidth)/2-smallrightAdDivW)/2; 
 
 document.getElementById("smallRightDiv").style.display="";
 document.getElementById("smallRightDiv").style.top=document.body.scrollTop+smallrightToppx;
 document.getElementById("smallRightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("smallRightDiv").offsetWidth-Borderpx; 
 setTimeout("smallrightscall();",20);
  
}

function hidesmallrightad()
{
 smallrightshowad = false; 
 document.getElementById("smallRightDiv").style.display="none";
}
//window.onscroll=smallrightscall;
//window.onload=scall;
smallrightscall();

var smallleftshowad = true;
var smallleftToppx = 180;   //上端位置
var smallleftAdDivW = 96;  //宽度
var smallleftAdDivH = 231;  //高度
var smallleftPageWidth = 1000; //页面多少宽度象素下正好不出现左右滚动条
var smallleftMinScreenW = 1024; //显示广告的最小屏幕宽度象素 

var AdLeftHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"><a href=/forum/Enneagram.php target=_blank><img src="/Portals/0/skins/tacoachphase2/images/LeftBanner.jpg" width=96 height=231 border=0></a></div>';
var ClosebuttonHtml = '<div align="center" style="position: absolute;top:231px;right:0px;padding:4px 0px;z-index:2000;width:96px;background-color:#f6f6f6"><a href="javascript:hidesmallleftad();"  style="color:black;text-decoration:none;font-size:12px;">关闭</a></div>';
document.write ('<div id="smallLeftDiv" style="position: absolute;background-color:white;z-index:1000;width:'+smallleftAdDivW+'px;height:'+smallleftAdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+AdLeftHtml+ClosebuttonHtml+'</div>');

function smallleftadv(){
 if(!smallleftshowad){return;}
 
 if (window.screen.width<smallleftMinScreenW){
  //alert("临时提示：\n\n显示器分辨率宽度小于"+MinScreenW+",不显示广告");
  smallleftshowad = false;
  document.getElementById("smallLeftDiv").style.display="none";  
  return;
 } 
  
 var Borderpx = ((window.screen.width-smallleftPageWidth)/2-smallleftAdDivW)/2; 
 
 document.getElementById("smallLeftDiv").style.display="";
 document.getElementById("smallLeftDiv").style.top=document.body.scrollTop+smallleftToppx;
 document.getElementById("smallLeftDiv").style.left=document.body.scrollLeft+Borderpx;
 
 setTimeout("smallleftadv();",20);  
}

function hidesmallleftad()
{
 smallleftshowad = false;
 document.getElementById("smallLeftDiv").style.display="none"; 
}
//window.onresize=smallscall;
//window.onload=scall;
smallleftadv();

