
function initAd() {
document.all.AdLayer.style.posTop = -200;//设置onLoad事件激发以后，广告层相对于固定后的y方向位置
document.all.AdLayer.style.visibility = 'visible'//设置层为可见
MoveLayer('AdLayer');//调用函数MoveLayer()
}
function MoveLayer(layerName) {
var x = leftmarg-120 //浮动广告层固定于浏览器的x方向位置  左 leftmarg-120 右 leftmarg+880
var y = 60;//浮动广告层固定于浏览器的y方向位置
var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*0.90;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posLeft = x");//移动广告层
setTimeout("MoveLayer('AdLayer');", 10);//设置20毫秒后再调用函数MoveLayer()
}


// Useage: HCmarquee(滚动对象id, 可见范围宽度, 可见范围高度, 内容行数，滚动速度, 停留时间); 方向有up
// 内容行数要填写正确,当达到行数时,会重置数值,使之不会错位
function HCmarquee(id,mw,mh,mr,ms,pause){
	
	var obj=document.getElementById(id);
	obj.ss=false; //stop tag
	obj.mr=mr; //marquee rows
	obj.mw=mw; //marquee width
	obj.mh=mh; //marquee height
	obj.ms=ms; //marquee speed
	obj.pause=pause; //pause time
	obj.pt=0; //pre top
	obj.st=0; //stop time


	with(obj){
		style.width=mw+"px";
		style.height=mh+"px";
		noWrap=false;
		onmouseover=stopm;
		onmouseout=startm;
		scrollTop=0+"px";
		scrollLeft=0+"px";
	}
	
	if(obj.mr!=0){
		obj.tt=mh*mr;
		obj.ct=mh; //current top
		obj.innerHTML+=obj.innerHTML;
		setInterval(scrollUp,obj.ms);
	}

	function scrollUp(){

		if(obj.ss==true) return;
		obj.ct+=1;
		if(obj.ct==obj.mh+1){
			obj.st+=1; obj.ct-=1;
			if(obj.st==obj.pause){obj.ct=0; obj.st=0;}
		}else {
			obj.pt=(++obj.scrollTop);
			if(obj.pt==obj.tt){
				obj.scrollTop=0;
				}
		}
	}

	function stopm(){obj.ss=true;}
	function startm(){obj.ss=false;}
}
function makevisible(cur,which)
{
cur.filters.alpha.opacity=which
}

function doPrint() { 
bdhtml=window.document.body.innerHTML; 
sprnstr="<!--startprint-->"; 
eprnstr="<!--endprint-->"; 
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
window.document.body.innerHTML=prnhtml; 

window.print(); 
}

function SW(tips,flag){
var my_tips=document.all.mytips;
if(flag){
     my_tips.innerHTML=tips; 
     my_tips.style.left=event.clientX+document.body.scrollLeft+7;
     my_tips.style.top=event.clientY+document.body.scrollTop+20;
     my_tips.style.display="";
   }
else 
{
   my_tips.style.display="none";
   }
}
 
