<!--
var ien=new Array('ie0','ie1');
var win=new Array(ien.length);
var url='../surfurl%2Easp'; 
var isStartSurf = 0;
var surftime=20;
var st=surftime;
var location="";function killErrors() {return true;}window.onerror = killErrors;

function StartSurf(n)
{
	nInterval=setInterval("SurfGo("+n+")",st*1000);
	isStartSurf = 1;
	gocl(n);
}
function SurfGo(n){
	var msg='';
	for(var i = 0 ; i <= n ; i++){
		if(typeof(win[i])=='undefined'){}
		else{if(win[i].closed==true){
			msg=msg+'<font color=#FF0000>第'+(i+1)+'个冲浪窗口已关闭,金币奖励失败! '+GetDateTime()+'</font>'+'<br>';}
			else{
				tmp=GetResult(i,getPass(10));
				msg=msg+'<font color=#FF6600>第'+(i+1)+'个冲浪窗口,金币奖励'+tmp+' '+GetDateTime()+'</font>'+'<br>';
				}
			}
	}
	isStartSurf = 1;
	st=surftime;
	openad(n,url);
	document.getElementById('msg').innerHTML = '<p>======上次金币奖励详情如下======<br>'+msg+'</p>';
}
function SurfStop(){
	if(isStartSurf==0){alert('您还未开始冲浪!');}
	else{
		isStartSurf = 0;
		st = surftime;
		window.clearInterval(nInterval);
		document.getElementById('timer').innerHTML = '<br><font color=#FF6600>(请点击上方图标开始冲浪)</font>';
		document.getElementById('msg').innerHTML = '';
		CloseAll();
		}
}

  function gocl(n)
  {
  	if (isStartSurf == 0){return false;}
  	else{
		for(var i = 0 ; i <= n ; i++){
		if(!win[i]){document.getElementById('timer').innerHTML = '<br><font color=#FF0000>(第'+(i+1)+'个冲浪窗口被浏览器拦截,请确定允许弹窗后,再开始冲浪)<br><a target=_blank href=/surfhelp.asp>[点击查看解决方法]</a></font>';}
		if(typeof(win[i])=='undefined'){}
		else{if(win[i].closed==true){openad(n,url);}}
	}
  	 st = st -1 ;
	 if(st>0){
		 document.getElementById('timer').innerHTML ='<br>距奖励金币倒计时: <b><font color=#FF0000>'+st+'</font></b> 秒';
	 }
	 else{
		 st=0;
		 document.getElementById('timer').innerHTML ='<br>距奖励金币倒计时: <b><font color=#FF0000>'+st+'</font></b> 秒';
	 }
  	 setTimeout('gocl('+n+')', 1000);
  	}
  }
//////////////////////////////////////////////////////////
function changeienum(n){
	if(isStartSurf == 1){SurfStop();return false;}
	
	st=surftime;
	for(var i = 0 ; i <= n ; i++){
		iets(i,1);
	}
	for(var i = n+1 ; i < ien.length ; i++){
		iets(i,0);
	}
	openad(n,url);
	StartSurf(n);
}
//停止全部冲浪窗口
function CloseAll(){
	iets(0,0);
	iets(1,0);
	iets(2,0);
	iets(3,0);
}
//修改冲浪窗口状态
//0,1,2,3:窗口号,1:开始冲浪;0:停止冲浪
function iets(n,flag){
	if (flag == 1){
		document.getElementById(ien[n]).innerHTML = '<IMG src=image/selectieyes.gif border=0>冲浪中...<IMG src=image/surfStart.gif border=0 alt=点击停止冲浪>';
		}
	else{
		document.getElementById(ien[n]).innerHTML = '<IMG src=image/selectieno.gif border=0>关闭中<IMG src=image/surfReady_'+n+'.gif border=0 alt=点击打开冲浪窗口>';
		closead(n);
		}
}
//打开冲浪窗口
function openad(n,url){
	for(var i = 0 ; i <= n ; i++){
		win[i]=window.open(url+'?ien='+i+'&rnd='+getPass(10),'Viewad'+ien[i],'top=0,left=0,location=1,toolbar=0,directories=1,menubar=0,scrollbars=1,resizable=1,status=0');
	}
}
//关闭冲浪窗口
function closead(n){
//	if(typeof(win[n])=='undefined'){}else{win[n].close();}
}
//生成随机长度的字母
function getPass(len){
	var tmpCh = "";
	for(var i = 0; i < len; i++){
		tmpCh += String.fromCharCode(Math.floor( Math.random() * 26) + "a".charCodeAt(0));}
	return tmpCh;
}

//获取时期时间
function GetDateTime(){
	var today=new Date();
	var d, s="";
	var c = ":";
	date=today.getDate();
	month=today.getMonth();
	month=month+1;
	if(month<=9)
	month="0"+month;
	year=today.getYear();
	s=nowDate=year+'-'+month+'-'+date;
	s += " ";
	d = new Date();
	s += d.getHours() + c;
	s += d.getMinutes() + c;
	s += d.getSeconds();
	return s;
}
function GetResult(i,rnd)
{
    var oBao = new ActiveXObject("Microsoft.XMLHTTP");
    oBao.open("POST",'surfview%2Easp?ien='+escape(i)+'&rnd='+escape(rnd)+'&mm=1',false);
    oBao.send();
    return unescape(oBao.responseText)
}

//刷新网页后,确认关闭窗口
window.onbeforeunload= function ConfirmClose(){
	var pb_strConfirmCloseMessage; 
	var pb_blnCloseWindow = false; 
	pb_strConfirmCloseMessage ="点确定[停止冲浪],点取消返回[继续冲浪]"; 
	window.event.returnValue = pb_strConfirmCloseMessage; 
	pb_blnCloseWindow = true; 
}
-->