﻿//随滚动条滚动的广告代码(符合XHTML标准,可拖动可隐藏)：开始
//主调函数
//调用方式：gw_js_div_scroll1("gw_js_div_scroll1/","网站名称");
function gw_js_div_scroll1(selfdir,webname){ //参数：图片所在路径，网站名称
	var str="";
	str+="<div id='gw_div_scroll1' style='position:absolute; top:140px; right:2px; width:110px; z-index:100000;'>";
	str+="<div id='gw_div_scroll1_move' style='position:absolute; width:110px;'>";
	str+="<div onmousedown='javascript:gw_js_div_scroll1_mdown(gw_div_scroll1_move);'>";
	str+="<img src='" + selfdir + "top.gif' alt='' border='0' width='110' height='53' usemap='#gw_div_scroll1_img_top' />";
	str+="<map name='gw_div_scroll1_img_top' id='gw_div_scroll1_img_top'>";
	str+="<area shape='rect' coords='90,0,115,25' href='javascript:gw_js_div_scroll1_hide(\"gw_div_scroll1\");' />";
	str+="</map>";
	str+="</div>";
	str+="<div id='gw_div_scroll1_main'>";
	
	
	str+="<div style='padding:0px 0px 0px 25px; line-height:30px; background:url(" + selfdir + "bg1.gif);;font-size:12px;'>在线客服</div>";
	
	str+="<table border='0' cellspacing='0' cellpadding='0' style='width:100%; font-size:12px; line-height:30px; background:url(" + selfdir + "bg.gif);'>";
	str+="<tr>";
	
	str+="<td style='width:100%; padding:3px; text-align:center;'><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=424255357&site=qq&menu=yes'><img border='0' src='http://wpa.qq.com/pa?p=2:424255357:46' alt='点击这里给我发消息' title='点击这里给我发消息'></a></td>";
	str+="</tr>";
	
	str+="<tr>";
	str+="<td style='width:100%;  padding:3px; text-align:center;'><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=1410132872&site=qq&menu=yes'><img border='0' src='http://wpa.qq.com/pa?p=2:1410132872:46' alt='点击这里给我发消息' title='点击这里给我发消息'></a></td>";
	str+="</tr>";
	
	
	str+="<tr>";
	str+="<td style='text-align:center; padding:3px; '><a href='msnim:chat?contact=sh-gaobiao@hotmail.com' tareget='_blank'><img src='" + selfdir + "Mns.jpg' alt='' border='0' /></a>高标装饰</td>";
	str+="</tr>";
	
	str+="</table>";	
		
	
	
	
	str+="<div style='height:21px;'><img src='" + selfdir + "bottom.gif' alt='' border='0' /></div>";
	str+="</div>";
	str+="</div>";
	str+="</div>";
	window.document.writeln(str);
	
	window.setInterval("gw_js_div_scroll1_heartBeat()",1);
	
	window.document.getElementById("gw_div_scroll1_move").onmousemove=gw_js_div_scroll1_mmove;
	window.document.getElementById("gw_div_scroll1_move").onmouseup=gw_js_div_scroll1_mup;
}

var gw_js_div_scroll1_obj='';
var gw_js_div_scroll1_lastScrollY=0;
function gw_js_div_scroll1_heartBeat(){
	diffY=window.document.documentElement.scrollTop;
	percent=0.1*(diffY-gw_js_div_scroll1_lastScrollY);
	if(percent>0)percent=window.Math.ceil(percent);
	else percent=window.Math.floor(percent);
	window.document.getElementById("gw_div_scroll1").style.top=window.parseInt(window.document.getElementById("gw_div_scroll1").style.top)+percent+"px";
	gw_js_div_scroll1_lastScrollY=gw_js_div_scroll1_lastScrollY+percent;
}
function gw_js_div_scroll1_mdown(Object){
	gw_js_div_scroll1_obj=Object.id;
	window.document.getElementById(gw_js_div_scroll1_obj).setCapture();
	pX=window.event.x-window.document.getElementById(gw_js_div_scroll1_obj).style.pixelLeft;
	pY=window.event.y-window.document.getElementById(gw_js_div_scroll1_obj).style.pixelTop;
}
function gw_js_div_scroll1_mmove(){
	if(gw_js_div_scroll1_obj!=''){
		window.document.getElementById(gw_js_div_scroll1_obj).style.left=window.event.x-pX;
		window.document.getElementById(gw_js_div_scroll1_obj).style.top=window.event.y-pY;
	}
}
function gw_js_div_scroll1_mup(){
	if(gw_js_div_scroll1_obj!=''){
		window.document.getElementById(gw_js_div_scroll1_obj).releaseCapture();
		gw_js_div_scroll1_obj='';
	}
}
function gw_js_div_scroll1_hide(obj){
	obj=window.document.getElementById(obj);
	if(obj.style.display=="none"){obj.style.display="";}
	else{obj.style.display="none";}
}
//随滚动条滚动的广告代码(符合XHTML标准,可拖动可隐藏)：结束
