// JavaScript Document
var jsFileName = "float.js";
var rName = new RegExp(jsFileName+"(\\?(.*))?$")
var jss=document.getElementsByTagName('script');
var url='';
for (var i = 0;i < jss.length; i++){
  var j = jss[i];
  if (j.src&&j.src.match(rName)){
    var oo = j.src.match(rName)[2];
    if (oo&&(t = oo.match(/([^&=]+)=([^=&]+)/g))){
        for (var l = 0; l < t.length; l++){
            r = t[l];
            var tt = r.match(/([^&=]+)=([^=&]+)/);
            if (tt)
                //document.write('参数起：' + tt[1] + '，参数值玩：' + tt[2] + '<br />');
				url =  url + tt[1]+'='+tt[2]+ '&';	
				if(tt[1]=='k')
				{
					var k = tt[2];
					//alert(k);
				}
				if(tt[1]=='ft')
				{
					var ft = tt[2];
					//alert(ft);
				}
				if(tt[1]=='iw')
				{
					var iw = tt[2];
					//alert(iw);
				}
				if(tt[1]=='ih')
				{
					var ih = tt[2];
					//alert(ih);
				}
        }
		//alert(url);
    }
  }
}
var imgft = ft;
var imagepath="/17wpay/a"+ k + ".gif"//这里写图片的URL
var imagewidth=iw;
var imageheight=ih;
var imageclick="/17wpay/default.htm?" + url; //这里写点击到的广告地址

var img_float_pix	= 5;

var img_float_code	= '<a href="'+imageclick+'" target="_blank"><img src="'+imagepath+'" border="0"></a>';
function useIframe(divName){
	document.write('<iframe id="'+divName+'" scrolling="no" frameborder="0"></iframe>');
	var tmpObj = document.getElementById(divName);
	window.frames[divName].document.write('<html><body style="margin:0px">'+img_float_code+'</body></html>');
	tmpObj.style.width = imagewidth;
	tmpObj.style.height = imageheight;
	tmpObj.style.position="absolute";
	tmpObj.style.zIndex=10000;
}

if(imgft != 7){
	document.write('<DIV id=17wpay_img1 style="Z-INDEX: 10000; width:'+imagewidth+'px;height:'+imageheight+'px;POSITION: absolute; TOP: 43px; visibility: visible;">'+img_float_code+'</DIV>')
	var zz_float_obj = document.getElementById('17wpay_img1');
	if(zz_float_obj == null){
		useIframe('17wpay_img1');
		zz_float_obj = document.getElementById('17wpay_img1');
	}
}


if(imgft == 2){
var xPos = 300;
var yPos = 200; 
var step = 1;
var delay = 30; 
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
zz_float_obj.style.top = yPos;
function changePos() 
{
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = zz_float_obj.offsetHeight;
Woffset = zz_float_obj.offsetWidth;
zz_float_obj.style.left = xPos + document.body.scrollLeft;
zz_float_obj.style.top = yPos + document.body.scrollTop;
if (yon) 
{yPos = yPos + step;}
else 
{yPos = yPos - step;}
if (yPos < 0) 
{yon = 1;yPos = 0;}
if (yPos >= (height - Hoffset)) 
{yon = 0;yPos = (height - Hoffset);}
if (xon) 
{xPos = xPos + step;}
else 
{xPos = xPos - step;}
if (xPos < 0) 
{xon = 1;xPos = 0;}
if (xPos >= (width - Woffset)) 
{xon = 0;xPos = (width - Woffset);   }
}

function start()
{
zz_float_obj.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume() 
{
if(pause) 
{
clearInterval(interval);
pause = false;}
else 
{
interval = setInterval('changePos()',delay);
pause = true; 
}
}
start();	
}
else if(imgft == 3||imgft == 4||imgft == 5||imgft == 6){
	function floatF(){
		var wh=document.documentElement.offsetHeight;
 		var wst=document.body.scrollTop;
		if(imgft == 5 || imgft == 6)
			zz_float_obj.style.right= img_float_pix;
		else {
			zz_float_obj.style.left= img_float_pix;
		}
		if(imgft == 3 || imgft == 5)
			zz_float_obj.style.pixelTop= wst+img_float_pix;
		else {
			zz_float_obj.style.pixelTop= wst+wh - imageheight;
		}
	}
	if(cu_st){clearInterval(cu_st);
	 var cu_st=window.setInterval("floatF()",100);
	}else var cu_st=window.setInterval("floatF()",100);
}
else if(imgft == 7){
	var speed=4;
	var hideafter=0
	var isie=0;
	if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
	isie=1;
	}
	else {
	isie=0;
	}
	if(isie){
	var preloadit=new Image()
	preloadit.src=imagepath
	}
	function pop() {
	if(isie) {
	x=x+dx;y=y+dy;	
	oPopup.show(x, y, imagewidth, imageheight);
	if(x+imagewidth*1+5>screen.width) dx=-dx;
	if(y+imageheight*1+5>screen.height) dy=-dy;
	if(x<0) dx=-dx;
	if(y<0) dy=-dy;
	startani=setTimeout("pop();",50);	
	//alert(dx);
	}
	}
	function dismisspopup(){
	clearTimeout(startani)
	oPopup.hide()
	}
	function dowhat(){
	if (imageclick=="dismiss")
	dismisspopup()
	else
	window.open(imageclick);
	}
	if(isie) {
	var x=0,y=0,dx=speed,dy=speed;
	var oPopup = window.createPopup();
	var oPopupBody = oPopup.document.body;
	oPopupBody.style.cursor="hand"
	oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">';
	oPopup.document.body.onmouseover=new Function("clearTimeout(startani)")
	oPopup.document.body.onmouseout=pop
	oPopup.document.body.onclick=dowhat
	pop();
	if (hideafter>0)
	setTimeout("dismisspopup()",hideafter*1000)
	}
}
else if(imgft == 8){
	document.write('<DIV id=17wpay_img2 style="Z-INDEX: 10000; width:'+imagewidth+'px;height:'+imageheight+'px;POSITION: absolute; TOP: 43px; visibility: visible;">'+img_float_code+'</DIV>')
	var zz_float_obj2 = document.getElementById('17wpay_img2');
	if(zz_float_obj2 == null){
		useIframe('17wpay_img2');
		zz_float_obj2 = document.getElementById('17wpay_img2');
	}
	
	function floatT(){
		var wh=document.documentElement.offsetHeight;
 		var wst=document.body.scrollTop;
		zz_float_obj2.style.right= img_float_pix;
		zz_float_obj.style.left= img_float_pix;
		zz_float_obj.style.pixelTop= wst+img_float_pix+120;
		zz_float_obj2.style.pixelTop= wst+img_float_pix+120;
	}
	if(cu_st){clearInterval(cu_st);
	 var cu_st=window.setInterval("floatT()",100);
	}else var cu_st=window.setInterval("floatT()",100);
}