﻿//change new data for  domain
var tt
var ourrank
//var countAttr=8
var positionSearch=1

var FormLimit =80000 //102399 
var sxml=""


function getCheckedValue(radioObj) {
	var inp=document.getElementsByTagName("input")
	var x=0
	for (var i=0;i<inp.length;i++)
	{
	  if(inp[i].type=="radio" &&  inp[i].name=="findpos")
		{
			if (inp[i].checked==true) x=inp[i].value
		}
	}
	return x

}

function DelFromCart(atodel)
{
atodel.parentNode.parentNode.parentNode.removeChild(atodel.parentNode.parentNode)
var q=document.getElementById("cart_all")
var p=q.getElementsByTagName("tr");
//alert(p.length)
for (i=0;i<p.length;i++)
{
	if (i % 2 ==0)
	{
		p[i].setAttribute("class","bg_Row")
	}
		else
	{
		p[i].setAttribute("class","bg_White")
	}
}
var carthtml=document.getElementById("cart_all").innerHTML;
document.cookie = "traffster_cart=" + escape(carthtml);
}

function clearCart()
{
document.getElementById("cart_all").innerHTML ="";
document.cookie = "traffster_cart=" + "";
}

function addToCart(domainName)
{
var q=document.getElementById("cart_all")
var found = q.innerHTML.indexOf(domainName)
if (found == -1)
{
	var p=q.getElementsByTagName("tr");
	lastidnum=p.length+1;
	if (lastidnum % 2 ==0)
	{
		var newline="<tr class='bg_White'><td>" + domainName + "</td><td align='right'><a onclick=" + '"' + "DelFromCart(this)" + '"' + "><img src='imgs/delete.gif' border=0></a></td></tr>";
	}
	else
	{
		var newline="<tr class='bg_Row'><td>" + domainName + "</td><td align='right'><a onclick=" + '"' + "DelFromCart(this)" + '"' + "><img src='imgs/delete.gif' border=0></a></td></tr>";
	}
	document.getElementById("cart_all").innerHTML = document.getElementById("cart_all").innerHTML + newline;
	var carthtml=document.getElementById("cart_all").innerHTML;
	document.cookie = "traffster_cart=" + escape(carthtml);
}
	else
{
	alert("This domain is already in your cart.")
}
}
	
function UpdateData(names)
{
	document.getElementById("IFRM1").contentWindow.document.body.innerHTML=""
	var reg=new RegExp('<td.*?count="(.*?)"' ,'g')
	var d=document.getElementById("anyid").innerHTML
	var qq=d.match(reg)
	qq[0].match(reg);
	var count=RegExp.$1
	reg=null
	
	var str1=""
	var reg=new RegExp('<td.*?text="(.*?)"' ,'g')
	qq=d.match(reg)
	for (var i=0;i<count;i++)
	{
	  qq[i].match(reg);
	  str1=str1 + RegExp.$1 + "****"
	}
	
	if (str1.length>0) str1=str1.substring(0,str1.length-4)
	document.getElementById("IFRM1").src="getData.asp?Param=1&name=" + names + "&count=" + count + "&arrParam=" + str1
    tt=setInterval("GetValue('" + names + "')",7000)	
}


// get value for domain by attribyte
function GetValue(names)
{
   var q = document.getElementById("IFRM1").contentWindow.document.body.innerHTML
   if(q!="")
	{
		clearInterval(tt)
		var Arr=q.split(";;;")
		var reg=new RegExp('tag_' + names + '_(.*?)="(.*?)"',"g")
		qq=Arr[0].match(reg)
		qq[0].match(reg);
		var countAttr= RegExp.$2
		for (var i=0;i<countAttr;i++)
			{	
				qq=Arr[i+1].match(reg)
				qq[0].match(reg);
				var k1= RegExp.$1
				var k2=RegExp.$2
				document.getElementById("tag_" + names + "_" + parseInt(k1)).innerHTML=k2
			}
		reg=null	
	}	
}

//link pr's click
function findFilterPR(prid, click,field,dir,page,lastfield)//,minA,maxA,minPR,maxPR )
{
	switch (prid)
		{
			case 1:
				if(!field) field=2
				if(!dir)   dir='desc'
				break
			  
			case 2:
				if(!field) field=3
				if(!dir)   dir='asc'
				break			
			  
			case 3:
				if(!field) field=4
				if(!dir)   dir='desc'
				break			  
			  
			case 4:
				if(!field) field=5
				if(!dir)   dir='desc'
				break
			  
			case 8:
				if(!field) field=9
				if(!dir)   dir='desc'
				break

			case 10:
				if(!field) field=11
				if(!dir)   dir='desc'
				break				
				
			case 11:
				if(!field) field=14 //20
				if(!dir)   dir='desc'
				break								

			case 12:
				if(!field) field=14//21 
				if(!dir)   dir='desc'
				break												
		}

    if(!page) page=1
	if(!lastfield) lastfield=-1	

	var k1=""  //min length
	var k2=""  //max length
	var k3=""  //tld
	var k33="" //date
	var k5=""  //domain
	var k6=getCheckedValue("findpos")							//findpos
	var k7=""//document.getElementById("selshema").value  //shema
	var k333=""

	//date
	var el=document.getElementsByTagName("input")	
	for(var i=0 ;i<el.length;i++)
		{
			if(el[i].type=="checkbox" && el[i].checked)
				{
					var p=el[i].id
					if (p.indexOf("dl_")!=-1)
					  {
					    p=p.substring(3,p.length)
						k33=k33 + p + ","
					  }
				}
		}
	if(k33.toUpperCase().indexOf("ALL")!=-1) k33=""  // dates
	if (k33!="") k33=k33.substring(0,k33.length-1)
	
	zz="All_Dropped_Domains"

	var paging=0	
	var click=0
    var counts=document.getElementById("resperpage").options[document.getElementById("resperpage").selectedIndex].value
	var nonum=0
	var nosgn=0
	var minA=-1
	var maxA=-1	
	var minPR=-1 
	var maxPR=-1
	
	var prs="$-$;$-$;$-$;$-$;$-$;0-0"
	//location.replace("index.asp?count=" + counts + "&Page_Name=" + zz + "&page=" + page + "&tld=" + k3 + "&dropid=" + k33 + "&minlen=" + k1 + "&maxlen=" + k2 +  "&domain=" + k5 + "&pos=" + k6 + "&shema=" + k7 + "&field=" + field + "&dir=" + dir + "&lastfield=" + lastfield + "&prid=" + prid + "&paging=" + paging + "&click=" + click + "&nonum="+ nonum + "&nosgn=" + nosgn + "&minA=" + minA + "&maxA=" + maxA + "&minPR=" + minPR + "&maxPR=" + maxPR + "&sourceList=" + k333) 	
	
	//showloading()
	location.href="index.asp?Page_Name=All_Dropped_Domains&count=" + counts + "&page=" + page + "&tld=" + k3 + "&dropid=" + k33 + "&minlen=" + k1 + "&maxlen=" + k2 +  "&domain=" + k5 + "&pos=" + k6 + "&shema=" + k7 + "&field=" + field + "&dir=" + dir + "&lastfield=" + lastfield + "&prid=" + prid + "&paging=" + paging + "&click=" + click + "&nonum="+ nonum + "&nosgn=" + nosgn + "&minA=" + minA + "&maxA=" + maxA + "&minPR=" + minPR + "&maxPR=" + maxPR + "&sourceList=" + k333 + "&prs="	+ prs

	
//  goFind(field,dir,page,lastfield ,prid ,0,1)// ,minA,maxA,minPR,maxPR)

} 

//pages click
function findByPage(page,field,dir,click,prid,minA,maxA,minPR,maxPR)
{
	if(!field) field=2
	if(!dir)   dir='desc'

//	switch (prid)
//		{
//			case 8:
//				field=2
//				dir='asc'
//				break
//		}	
    if(!page) page=1
	if(!minA) minA=-1
	if(!maxA) maxA=-1
	if(!minPR) minPR=-1
	if(!maxPR) maxPR=-1	
    var t=getCurrentParametersLine()
	//showloading()
    location.href="index.asp?Page_Name=" + "All_Dropped_Domains" + "&count=" + t.count + "&page=" + page + "&tld=" + t.tld + "&dropid=" + t.dropid + "&minlen=" + t.minlen + "&maxlen=" +  t.maxlen + "&domain=" + t.domain + "&pos="+ t.pos + "&shema=" + t.shema + "&field=" + field + "&dir=" + dir + "&lastfield=" + t.lastfield + "&prid=" +  prid + "&paging=" +  t.paging + "&click=" + t.click + "&nonum=" + t.nonum + "&nosgn=" + t.nosgn + "&minA=" + t.minA + "&maxA=" + t.maxA + "&minPR="  + t.minPR + "&maxPR=" + t.maxPR + "&sourceList=" + t.sourceList + "&prs=" + t.prs + "&OURRANK=" + ourrank	
//	goFind(field,dir,page,field ,prid ,1,click,minA,maxA,minPR,maxPR)

} 


//pages click
function checkenter(e,page,field,dir,pages,minA,maxA,minPR,maxPR ,prid)
{

	if(e.keyCode==13)  
		{
			document.getElementById("inpCheckEnter").value=page		
			document.getElementById("inpCheckEnter2").value=page		
			if(!field) field=2
			if(!dir)   dir='desc'
			//if(!page) page=1
			if(!prid) prid=-1
			if(!minA) minA=-1
			if(!maxA) maxA=-1
			if(!minPR) minPR=-1
			if(!maxPR) maxPR=-1			
			
			x=isNaN(parseInt(page))
			var regexp = /^(\d*)$/;
			var result = page.match(regexp);
			regexp = null;

			if (x==true || page=="" || result==null)
				{
					alert("The page does not exist" )
					document.getElementById("inpCheckEnter").value=""
					document.getElementById("inpCheckEnter2").value=""
				}
			else if (page>pages || page<1)
				{
					alert("Page " + page + " does not exist" )
					document.getElementById("inpCheckEnter").value=""
					document.getElementById("inpCheckEnter2").value=""
				}
			else if (x==false && page!="")
				{
//					goFind(field,dir,page,field ,prid ,1,0,minA,maxA,minPR,maxPR)
					//paging=1, click=0
					var t=getCurrentParametersLine()
					//showloading()
					location.href="index.asp?count=" + t.count + "&Page_Name=" + t.Page_Name + "&page=" + page + "&tld=" + t.tld + "&dropid=" + t.dropid + "&minlen=" + t.minlen + "&maxlen=" +  t.maxlen + "&domain=" + t.domain + "&pos="+ t.pos + "&shema=" + t.shema + "&field=" + t.field + "&dir=" + t.dir + "&lastfield=" + t.lastfield + "&prid=" +  t.prid + "&paging=1&click=0&nonum=" + t.nonum + "&nosgn=" + t.nosgn + "&minA=" + t.minA + "&maxA=" + t.maxA + "&minPR="  + t.minPR + "&maxPR=" + t.maxPR + "&sourceList=" + t.sourceList + "&prs=" + t.prs	+ "&OURRANK=" + ourrank	
				}	
		}	
} 
function gopage(pagebox,field,dir,pages,minA,maxA,minPR,maxPR ,prid)
{
			page = document.getElementById(pagebox).value
			document.getElementById("inpCheckEnter").value=page		
			document.getElementById("inpCheckEnter2").value=page		
			if(!field) field=2
			if(!dir)   dir='desc'
			//if(!page) page=1
			if(!prid) prid=-1
			if(!minA) minA=-1
			if(!maxA) maxA=-1
			if(!minPR) minPR=-1
			if(!maxPR) maxPR=-1			
			
			x=isNaN(parseInt(page))

			var regexp = /^(\d*)$/;
			var result = page.match(regexp);
			regexp = null;

			if (x==true || page=="" || result==null)
				{
					alert("Page does not exist" )
					document.getElementById("inpCheckEnter").value=""
					document.getElementById("inpCheckEnter2").value=""
				}
			else if (page>pages || page<1)
				{
					alert("Page " + page + " does not exist" )
					document.getElementById("inpCheckEnter").value=""
					document.getElementById("inpCheckEnter2").value=""
				}
			else if (x==false && page!="")
				{
//					goFind(field,dir,page,field ,prid ,1,0,minA,maxA,minPR,maxPR)
					//paging=1, click=0
					var t=getCurrentParametersLine()
					//showloading()
					location.href="index.asp?&count=" + t.count + "&Page_Name=" + t.Page_Name + "&page=" + page + "&tld=" + t.tld + "&dropid=" + t.dropid + "&minlen=" + t.minlen + "&maxlen=" +  t.maxlen + "&domain=" + t.domain + "&pos="+ t.pos + "&shema=" + t.shema + "&field=" + t.field + "&dir=" + t.dir + "&lastfield=" + t.lastfield + "&prid=" +  t.prid + "&paging=1&click=0&nonum=" + t.nonum + "&nosgn=" + t.nosgn + "&minA=" + t.minA + "&maxA=" + t.maxA + "&minPR="  + t.minPR + "&maxPR=" + t.maxPR + "&sourceList=" + t.sourceList + "&prs=" + t.prs	+ "&OURRANK=" + ourrank	
				}	
} 



//drop list domains
function sortDropList(field , lastfield ,dir,click,prid,minA,maxA,minPR,maxPR)
 {
 
	if(!prid) prid=-1
	if(!minA) minA=-1
	if(!maxA) maxA=-1
	if(!minPR) minPR=-1
	if(!maxPR) maxPR=-1

	var t=getCurrentParametersLine()    
	if (t.dir!="" && t.dir!="null") dir=t.dir

	if (field==lastfield && dir=="desc") 
	{
		dir="asc"
	}	
	else if (field==lastfield && dir=="asc") 
	{
		dir="desc"
	}	
	else
	{
		switch (field)
		{
			case 1:
				dir='asc'
				break
				
			case 2:
				dir='desc'
				break
			  
			case 3:
				dir='asc'
				break			
			  
			case 4:
				dir='desc'
				break			  
			  
			case 5:
				dir='desc'
				break
			  
			case 9:
				dir='desc'
				break

			case 11:
				dir='desc'
				break		

			case 12:
				dir='desc'
				break		
				
			case 13:
				dir='asc'
				break		
				
			case 14:
				dir='desc'
				break						
				
			case 20:
				dir='asc'
				break							

			case 21:
				field=14
				dir='asc'
				break	
				
			case 22:
				dir='desc'
				break	

			case 23:
				dir='desc'
				break					
		}
	}
	//if (t.field==20 || t.lastfield==20)  	 goFind(field,dir,1, lastfield,prid ,0,click,minA,maxA,minPR,maxPR,1)	
										 goFind(field,dir,1, lastfield,prid ,0,click,minA,maxA,minPR,maxPR)	

 }


 
//click from combo pages count
function findByCombo(comidOBJ,field,dir,page,lastfield ,prid ,paging,minA,maxA,minPR,maxPR )
{
    comid=comidOBJ.value
	//comid=document.getElementById("resperpage").options[document.getElementById("resperpage").selectedIndex].value

		if(!field) field=2
		if(!dir)   dir='desc'
		if(!page) page=1
		if(!lastfield) lastfield=-1
		if (!prid) prid=-1
		if(!paging) paging=0		
		if(!minA) minA=-1
		if(!maxA) maxA=-1
		if(!minPR) minPR=-1
		if(!maxPR) maxPR=-1
		document.getElementById("resperpage").value=comid

		
//		goFind(field,dir,page,lastfield ,prid ,paging,0,minA,maxA,minPR,maxPR)
		var t=getCurrentParametersLine()
		//showloading()
		location.href="index.asp?count=" + comid + "&Page_Name=" + t.Page_Name + "&page=" + page + "&tld=" + t.tld + "&dropid=" + t.dropid + "&minlen=" + t.minlen + "&maxlen=" +  t.maxlen + "&domain=" + t.domain + "&pos="+ t.pos + "&shema=" + t.shema + "&field=" + t.field + "&dir=" + t.dir + "&lastfield=" + t.lastfield + "&prid=" +  t.prid + "&paging=" + t.paging + "&click=0&nonum=" + t.nonum + "&nosgn=" + t.nosgn + "&minA=" + t.minA + "&maxA=" + t.maxA + "&minPR="  + t.minPR + "&maxPR=" + t.maxPR + "&sourceList=" + t.sourceList + "&prs=" + t.prs + "&OURRANK=" + ourrank	


}


//click from combo pages count
function gofindClick(click,field,dir,page,lastfield ,prid ,paging)
{

	//var t=getCurrentParametersLine()
	//if (t.field!="" && t.field!="null") field=t.field
	//if (t.dir!="" && t.dir!="null") dir=t.dir


	if(!field) field=2
	if(!dir)   dir='desc'
	if(!page) page=1
	if(!lastfield) lastfield=-1
	if (!prid) prid=-1
	if(!paging) paging=0		
	
	goFind(field,dir,page,lastfield ,prid ,paging ,click)

}

//click from combo pages count
function goFindClickEnter(e,click,field,dir,page,lastfield ,prid ,paging)
{
	if(e.keyCode==13)
		{
			if(!field) field=2
			if(!dir)   dir='desc'
			if(!page) page=1
			if(!lastfield) lastfield=-1
			if (!prid) prid=-1
			if(!paging) paging=0		
			goFind(field,dir,page,lastfield ,prid ,paging ,click)
		}
}


function getFiltersText()
{
	var prs=""
	var a11=document.getElementById("min_pr").value 
	var a12=document.getElementById("max_pr").value 
	var a21=document.getElementById("min_alexa").value 
	var a22=document.getElementById("max_alexa").value 
	var a31=document.getElementById("min_glinks").value 
	var a32=document.getElementById("max_glinks").value 
	var a41=document.getElementById("min_ylinks").value 
	var a42=document.getElementById("max_ylinks").value 
	var a51=document.getElementById("min_history").value 
	var a52=document.getElementById("max_history").value 
	if (a11=="-" || a11=="" || isNaN(parseInt(a11))) a11="$"
	if (a12=="-" || a12=="" || isNaN(parseInt(a12))) a12="$"
	if (a21=="-" || a21=="" || isNaN(parseInt(a21))) a21="$"
	if (a22=="-" || a22=="" || isNaN(parseInt(a22))) a22="$"
	if (a31=="-" || a31=="" || isNaN(parseInt(a31))) a31="$"
	if (a32=="-" || a32=="" || isNaN(parseInt(a32))) a32="$"
	if (a41=="-" || a41=="" || isNaN(parseInt(a41))) a41="$"
	if (a42=="-" || a42=="" || isNaN(parseInt(a42))) a42="$"
	if (a51=="-" || a51=="" || isNaN(parseInt(a51))) a51="$"
	if (a52=="-" || a52=="" || isNaN(parseInt(a52))) a52="$"

	prs=prs + a11 + "-" + a12 + ";"
	prs=prs + a21 + "-" + a22 + ";"
	prs=prs + a31 + "-" + a32 + ";"
	prs=prs + a41 + "-" + a42 + ";"
	prs=prs + a51 + "-" + a52 + ";"
	var tt=(document.getElementById("SDmoz").checked==true)? 1 :0
	prs=prs +  tt + "-" + tt
	return prs
}


//tab
function findByPageName(pageName,id)
{
	var k1=""  //min length
	var k2=""  //max length
	var k3=""  //tld
	var k33="" //date
	var k5=""  //domain
	var k6=getCheckedValue("findpos")							//findpos
	var k7=document.getElementById("selshema").value  //shema
	if (id==0) id=""
	var k333=id
	
	var field=2
	var dir='desc'
	
	zz=pageName
    var page=1
	var lastfield=-1
	var prid=-1
	var paging=0	
	var click=0
    var counts=document.getElementById("resperpage").options[document.getElementById("resperpage").selectedIndex].value
	var nonum=0
	var nosgn=0
	var minA=-1
	var maxA=-1	
	var minPR=-1 
	var maxPR=-1
	
     prs=getFiltersText()	

	location.href="index.asp?Page_Name=All_Dropped_Domains&count=" + counts + "&page=" + page + "&tld=" + k3 + "&dropid=" + k33 + "&minlen=" + k1 + "&maxlen=" + k2 +  "&domain=" + k5 + "&pos=" + k6 + "&shema=" + k7 + "&field=" + field + "&dir=" + dir + "&lastfield=" + lastfield + "&prid=" + prid + "&paging=" + paging + "&click=" + click + "&nonum="+ nonum + "&nosgn=" + nosgn + "&minA=" + minA + "&maxA=" + maxA + "&minPR=" + minPR + "&maxPR=" + maxPR + "&sourceList=" + k333 + "&prs="	+ prs
}


//find client-domains by paramerers
function goFind(field,dir,page,lastfield ,prid ,paging, click,minA,maxA,minPR,maxPR ,parName)
{
	var k1=document.getElementById("minlength").value  //min length
	var k2=document.getElementById("maxlength").value  //max length
	var k3=""
	var k33=""
	var k333=""
	var el=document.getElementsByTagName("input")

	//source name
	for(var i=0 ;i<el.length;i++)
		{
			if(el[i].type=="checkbox" && el[i].checked)
				{
					var p=el[i].id
					if (p.indexOf("Source_")!=-1)
					  {
					    p=p.substring(7,p.length)
						k333=k333 + p + ";;"
					  }
				}
		}
	if(k333==";;") k333="" 
	if (k333!="") k333=k333.substring(0,k333.length-2)
	

	for(var i=0 ;i<el.length;i++)
		{
			if(el[i].type=="checkbox" && el[i].checked)
				{
					var p=el[i].id
					if (p.indexOf("ch_")!=-1)
					  {
					    p=p.substring(3,p.length)
						k3=k3 + p + ";;"
					  }
				}
		}
	
	if(k3.toUpperCase().indexOf("ALL")!=-1) k3="" //tlds
	if (k3!="") k3=k3.substring(0,k3.length-2)

	//date
	for(var i=0 ;i<el.length;i++)
		{
			if(el[i].type=="checkbox" && el[i].checked)
				{
					var p=el[i].id
					if (p.indexOf("dl_")!=-1)
					  {
					    p=p.substring(3,p.length)
						k33=k33 + p + ","
					  }
				}
		}
	if(k33.toUpperCase().indexOf("ALL")!=-1) k33=""  // dates
	if (k33!="") k33=k33.substring(0,k33.length-1)
	
	var k5=document.getElementById("domain").value  //domain
	if (k5.length<k1 && k5.length>0) k1=k5.length
	if (k5.length>k2) k2=k5.length
	var k6=getCheckedValue("findpos")							//findpos
	var k7=document.getElementById("selshema").value  //shema
	if (k7.length/3 > k2) k2 =k7.length/3
	if (k7.length>0 && k7.length/3 < k1) k1 =k7.length/3
		
		
	if(!field) field=2
	if(!dir)   dir='desc'
	
	zz="All_Dropped_Domains"
    if(!page) page=1
	if(!lastfield) lastfield=-1
	if (!prid) prid=-1
	if(!paging) paging=0	
	if(!click) click=0
	var counts=document.getElementById("resperpage").options[document.getElementById("resperpage").selectedIndex].value

	var nonum=(document.getElementById("excl_Numb").checked==true) ? 1:0
	var nosgn=(document.getElementById("excl_Hyph").checked==true) ? 1:0
	if(!minA) minA=-1
	if(!maxA) maxA=-1
	if(!minPR) minPR=-1
	if(!maxPR) maxPR=-1	

    prs=getFiltersText()
	var t=getCurrentParametersLine()
    if(parName==1 && (t.field==20 || t.lastfield==20) )	 zz="Expiring_Domains_With_Typos"

	location.href="index.asp?count=" + counts + "&Page_Name=" + zz + "&page=" + page + "&tld=" + k3 + "&dropid=" + k33 + "&minlen=" + k1 + "&maxlen=" + k2 +  "&domain=" + k5 + "&pos=" + k6 + "&shema=" + k7 + "&field=" + field + "&dir=" + dir + "&lastfield=" + lastfield + "&prid=" + prid + "&paging=" + paging + "&click=" + click + "&nonum="+ nonum + "&nosgn=" + nosgn + "&minA=" + minA + "&maxA=" + maxA + "&minPR=" + minPR + "&maxPR=" + maxPR + "&sourceList=" + k333 + "&prs="	+ prs
	
	
}

//list domains by  count of link counts
function findByPrsCount(typelink)
{
	var field=2
	var dir='desc'
	var page=1
	var lastfield=-1
	var prid=-1
	var paging=0		
	var minA=-1
	var maxA=-1
	var minPR=-1
	var maxPR=-1
	
	switch (typelink)
	{
	 case 1://pr
			document.getElementById("min_alexa").value=0
			document.getElementById("max_alexa").value=0
			document.getElementById("min_glinks").value=0
			document.getElementById("max_glinks").value=0
			document.getElementById("min_ylinks").value=0
			document.getElementById("max_ylinks").value=0
			document.getElementById("min_history").value=0
			document.getElementById("max_history").value=0	 
			break
	 case 2://alexa
			document.getElementById("min_pr").value=0
			document.getElementById("max_pr").value=0
			document.getElementById("min_glinks").value=0
			document.getElementById("max_glinks").value=0
			document.getElementById("min_ylinks").value=0
			document.getElementById("max_ylinks").value=0
			document.getElementById("min_history").value=0
			document.getElementById("max_history").value=0	 	 
			break
	 case 3://gbl
			document.getElementById("min_pr").value=0
			document.getElementById("max_pr").value=0
			document.getElementById("min_alexa").value=0
			document.getElementById("max_alexa").value=0
			document.getElementById("min_ylinks").value=0
			document.getElementById("max_ylinks").value=0
			document.getElementById("min_history").value=0
			document.getElementById("max_history").value=0	 	 
			break
	 case 4://ybl
			document.getElementById("min_pr").value=0
			document.getElementById("max_pr").value=0
			document.getElementById("min_alexa").value=0
			document.getElementById("max_alexa").value=0
			document.getElementById("min_glinks").value=0
			document.getElementById("max_glinks").value=0
			document.getElementById("min_history").value=0
			document.getElementById("max_history").value=0	 	 
			break
	 case 5://age history
			document.getElementById("min_pr").value=0
			document.getElementById("max_pr").value=0
			document.getElementById("min_alexa").value=0
			document.getElementById("max_alexa").value=0
			document.getElementById("min_glinks").value=0
			document.getElementById("max_glinks").value=0
			document.getElementById("min_ylinks").value=0
			document.getElementById("max_ylinks").value=0
			break
	}
	goFind(field,dir,page,lastfield ,prid ,paging,0,minA,maxA,minPR,maxPR)
}


// input number positive only without 0.0
function NumberOnly(e) 
{   
 //var k = (document.all)?event.keyCode : arguments.callee.caller.arguments[0].which;
 var k = (e.which) ? e.which : e.keyCode
  if ((k>=48 && k<=58) || ( k==8) || ( k==37) || ( k==39) ||  ( k==46)) return true
							 else return false
}

//position seach domain
function setValue(val)
 {
   positionSearch=val
   changeBackColorInput("selshema","textcolorGray","domain","textcolorWhite")
 }
 

//change find for domain or shema 
function changeBackColorInput(tag,color ,tag2,color2)
{
   document.getElementById(tag).value=""
   document.getElementById(tag).className=color
   document.getElementById(tag2).className=color2   
}
 
 
 
function do_nothing()
{
return true
}

//set value for shema 
function SetShema(par) 
{	var t=""
	var myField=document.getElementById("selshema")

	switch(parseInt(par))
    {
	  case 0:
		t=""
	    break	
	  case 1:
		t="[N]"
	    break
	  case 2:
  		t="[L]"
	    break
	  case 3:
		t="[*]"	  
	    break
	  case 4:
  		t="[C]"
	    break
	  case 5:
  		t="[V]"
	    break
	  case 6:
  		t="[-]"
	    break
	}
	
	if (t!="")
		{
			if (document.selection) {
		        myField.focus();

		        //in effect we are creating a text range with zero
		        //length at the cursor location and replacing it
		        //with myValue
		        sel = document.selection.createRange();
				t=t.replace("#####",sel.text) 
		        //sel.text =  t 
				myField.value += t ;

		    //Mozilla/Firefox/Netscape 7+ support
		    } else if (myField.selectionStart || myField.selectionStart == '0') {

		        myField.focus();
		        //Here we get the start and end points of the
		        //selection. Then we create substrings up to the
		        //start of the selection and from the end point
		        //of the selection to the end of the field value.
		        //Then we concatenate the first substring, myValue,
		        //and the second substring to get the new value.
		        var startPos = myField.selectionStart;
		        var endPos = myField.selectionEnd;
				var endLen = myField.selectionEnd-myField.selectionStart ;
				t=t.replace("#####",myField.value.substring(startPos, endPos)) 
		        myField.value = myField.value.substring(0, startPos) + t +  myField.value.substring(endPos, myField.value.length);
		        myField.setSelectionRange(endPos+t.length, endPos+t.length);
		    } else {
				t=t.replace("#####","") 
		        myField.value += t ;
		    }
		}
	else
		{
			document.getElementById("selshema").value=""
		}
	changeBackColorInput("domain","textcolorGray" ,"selshema","textcolorWhite")
}


// prices show for find
function setEnablePrice()
{
  if (document.getElementById("selsource").value==3 || document.getElementById("selsource").value==4)
	{
		document.getElementById("td1").style.visibility="visible"
	}
  else
	{
		document.getElementById("td1").style.visibility="hidden"
	}
}



 
//drop list domains
function SortDropListFtp()
 {
    var date1
    var a1=document.getElementById("Sel1").value
    var a2=parseInt(document.getElementById("Sel2").value) + parseInt(1)
    var a3=document.getElementById("Sel3").value
    var b2=new String(a2) 
    if (b2.length==1) b2='' + "0" + b2
    if (a3.length==1) a3='' + "0" + a3
    date1=a1 + "-" + b2 + "-" + a3;
	 
	location.replace("DropListFtp.asp?date=" + date1)	 
 } 
 
 //'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var  ArrMonthName=new Array("Jan" ,"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var winOpen=null;
var alert10="Date Error"

//day in month
function GetDaysInMonth(year ,month)
{
 var  ArrMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31)
 if ( (year % 4==0) && (( year % 100 !=0) || (year % 400==0) )==true) ArrMonth[1]=29;
 return  ArrMonth[month];
}


// change dates year
function chYear(obj)
{
  var Oy=obj.id;
  var Om;
  if (Oy=="Sel1") Om="Sel2";
    else          Om="Sel5";

 if (document.getElementById(Oy).value!="" )
  {
    var ff= document.getElementById(Om);
    document.getElementById(Om).options.length = 0;
    
    for (var i=0;i<12 ;i++)
     {
      var Op=new Option (ArrMonthName[i] , i)
      ff.options.add(Op ,i)
     } 
     document.getElementById(Om).options[0].selected=true; 
     chMonth(document.getElementById(Om))
  } 
 else
  {
   document.getElementById(Om).options.length = 0;
   chMonth(document.getElementById(Om))
  } 
}


// change dates year
function chMonth(obj)
{
  var Om=obj.id;
  var Od;
  var Oy;
  if (Om=="Sel2")
  {
   Oy="Sel1"; 
   Od="Sel3";
  }
  else
   {       
    Oy="Sel4"   
    Od="Sel6";
   } 


if (document.getElementById(Om).value!="" )
 {
    document.getElementById(Od).options.length = 0;
    var ff= document.getElementById(Od);
    var pp= GetDaysInMonth(document.getElementById(Oy).value , document.getElementById(Om).value)
    for (var i=1;i<=pp ;i++)
     {
      var Op=new Option (i , i)
      ff.options.add(Op ,i)
     } 
     
     document.getElementById(Od).options[0].selected=true;     
    
 }
else
 {
   document.getElementById(Od).options.length = 0;
 }

    
}



//get name of month
function  getMonthName(s)
{
 var Arr= new Array("Jan" ,"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
 var k , p=new String(s)
 if (p.substring(0,1)=="0") p=p.substring(1,p.length)
 k=parseInt(p)- 1
 return (Arr[k]);
}


//get day 
function getDay(s)
{
 if (s.substring(0,1)==0) s=parseInt(s.substring(1,s.length))
 return s;
}

function SetDates(str1)
	{
		var x1, x2,x11,x22 
		var Arr1= new Array()
		var Arr2=new Array()
		if (str1=="") str1="2008-01-01"
		
		if (str1!="")
			{
				Arr1=str1.split("-")   
				x1=getMonthName(Arr1[1])
				Arr1[2]=getDay(Arr1[2])
				x11=Arr1[1]
				if(x11.substring(0,1)=="0") x11=x11.substring(1,x11.length)
			} 

			
			document.getElementById("Sel1").value=Arr1[0];
			chYear(document.getElementById("Sel1"))
			document.getElementById("Sel2").text=x1;
			document.getElementById("Sel2").value=parseInt(x11)-1;
			chMonth( document.getElementById("Sel2"))
			document.getElementById("Sel3").value=Arr1[2];

	}	
	

//change picture active/not active
function ChangeImageActive(id) 
{
 var p= document.getElementById(id).src
   if(p.indexOf("ch0.gif")!=-1) document.getElementById(id).src="imgs/ch1.gif"
    				      else  document.getElementById(id).src="imgs/ch0.gif"
}						  


//event for change selected emails
function getEventTable(e)
	{
		var td=(e.target||window.event.srcElement);
		var tN=td.tagName.toUpperCase()

		switch(tN)
				 {
				  case "IMG" :
				    ChangeImageActive(td.id)
				    break; 
				 } 
	}

//send email 	
function SendEmail()
{
	var reg=new RegExp('<img src="imgs/ch1.gif".*?><img .*?><font .*?">(.*?)</font>','ig') ;
	var d=document.body.innerHTML
	var j=0
	var m= d.match(reg)
	var seenTowns = {};
	
	for (var i=0; i<m.length; i++) 
	{
	  m[i].match(reg);
      var k= RegExp.$1
	  if (!seenTowns[k]) 
		{
			j++
			seenTowns[k]=true;
			sxml=sxml + k + ";"
			if (j % 100==0) sxml=sxml +"\n"
		}	
	}  
	SplitXmlToNewFiledsForSubmit(sxml ,"XML")   
	document.FCAT.action="SendEmails.asp"
	document.FCAT.method="post"
	document.FCAT.submit()	
}


// if exist limit in xml split to new fields  for submit 
function SplitXmlToNewFiledsForSubmit(tXml ,elem)
{
	var TempVar = new String
	TempVar = tXml
	if (TempVar.length > FormLimit)	
		{
			document.getElementById(elem).value = TempVar.substr(0, FormLimit)
			TempVar = TempVar.substr(FormLimit)
			while (TempVar.length > 0)
				{
					var objH = document.createElement("INPUT")
					objH.name = elem
					objH.type =	 "hidden"
					objH.value = TempVar.substr(0, FormLimit)
					document.FCAT1.appendChild(objH)
					TempVar = TempVar.substr(FormLimit)
					objH=null
				}
		}		
	else
		{
			document.getElementById(elem).value  = tXml
		}		
} 

//to unicode	
 function ToUnicode(unicode)
	{

     var tstr = unicode
     var bstr = '';
      for(i=0; i < tstr.length; i++)
      {
       //if(tstr.charCodeAt(i)>127) 
       // {
         bstr += '&#' + tstr.charCodeAt(i) + ';';
       // } 
      //else 
      // {
      //  bstr += tstr.charAt(i);
      // }
      }
      return (bstr);
	  
    }	 

//update whois	
function UpdateWhois(Domain ,Sid)	
{

}


//'///////////////////////////////////DROP LIST////////////////////////////////////////////////
//change checked for selected days for drop list from ALL
function funChangeAllListDate()
{
  var s=(document.getElementById("dl_All").checked==true) ? 1: 0;
  var d=document.getElementsByTagName("input")
  for(var i=0; i<d.length;i++)
   {
     var p=d[i].id
     if (p.indexOf("dl_")!=-1 && s==1 && d[i].id!="dl_All")
	  {
	    d[i].checked=false;
	  }
   }
   
   //sum of pr's
   document.getElementById("Dnumpr").innerHTML="(" + document.getElementById("dl_All").getAttribute("P1") + ")"
   document.getElementById("Dnumalexa").innerHTML="(" + document.getElementById("dl_All").getAttribute("P2") + ")"
   document.getElementById("Dnumgl").innerHTML="(" + document.getElementById("dl_All").getAttribute("P3") + ")"
   document.getElementById("Dnumyl").innerHTML="(" + document.getElementById("dl_All").getAttribute("P4") + ")"
   document.getElementById("Dnumdmoz").innerHTML="(" + document.getElementById("dl_All").getAttribute("P8") + ")"
   document.getElementById("DnumAge").innerHTML="(" + document.getElementById("dl_All").getAttribute("P10") + ")"
   document.getElementById("DnumTypos").innerHTML="(" + document.getElementById("dl_All").getAttribute("P11") + ")"
   document.getElementById("DnumKeyWords").innerHTML="(" + document.getElementById("dl_All").getAttribute("P12") + ")" ////*

}

//change checked for selected days for drop list
function funChangeListDate(id)
{
  var s=(document.getElementById(id).checked==true) ? 1: 0;
  if (s==1)
	{
	  document.getElementById("dl_All").checked=false;
	}
  
  //sum of pr's
  var p1=0
  var p2=0
  var p3=0
  var p4=0
  var p8=0
  var p10=0
  var p11=0
  var p12=0
  var u=0
  var d=document.getElementsByTagName("input")
  for(var i=0; i<d.length;i++)
   {
     var p=d[i].id
     if (p.indexOf("dl_")!=-1 && document.getElementById(p).checked==true && d[i].id!="dl_All")
	  {
	    u=u+1
		p1=p1 + parseInt(document.getElementById(p).getAttribute("P1"))
		p2=p2 + parseInt(document.getElementById(p).getAttribute("P2"))
		p3=p3 + parseInt(document.getElementById(p).getAttribute("P3"))
		p4=p4 + parseInt(document.getElementById(p).getAttribute("P4"))
		p8=p8 + parseInt(document.getElementById(p).getAttribute("P8"))
		p10=p10 + parseInt(document.getElementById(p).getAttribute("P10"))
		p11=p11 + parseInt(document.getElementById(p).getAttribute("P11"))		
		p12=p12 + parseInt(document.getElementById(p).getAttribute("P12"))		////*
	  }
   }
	
   document.getElementById("Dnumpr").innerHTML="(" + p1 + ")"
   document.getElementById("Dnumalexa").innerHTML="(" + p2 + ")"
   document.getElementById("Dnumgl").innerHTML="(" + p3 + ")"
   document.getElementById("Dnumyl").innerHTML="(" + p4 + ")"
   document.getElementById("Dnumdmoz").innerHTML="(" + p8 + ")"
   document.getElementById("DnumAge").innerHTML="(" + p10 + ")"
   document.getElementById("DnumTypos").innerHTML="(" + p11 + ")"
   document.getElementById("DnumKeyWords").innerHTML="(" + p12 + ")" ////*
   
  
   if (u==0)  //select ALL
   {
   
	document.getElementById("dl_All").checked=true
	document.getElementById("Dnumpr").innerHTML="(" + document.getElementById("dl_All").getAttribute("P1") + ")"
	document.getElementById("Dnumalexa").innerHTML="(" + document.getElementById("dl_All").getAttribute("P2") + ")"
	document.getElementById("Dnumgl").innerHTML="(" + document.getElementById("dl_All").getAttribute("P3") + ")"
	document.getElementById("Dnumyl").innerHTML="(" + document.getElementById("dl_All").getAttribute("P4") + ")"
	document.getElementById("Dnumdmoz").innerHTML="(" + document.getElementById("dl_All").getAttribute("P8") + ")"
	document.getElementById("DnumAge").innerHTML="(" + document.getElementById("dl_All").getAttribute("P10") + ")"
	document.getElementById("DnumTypos").innerHTML="(" + document.getElementById("dl_All").getAttribute("P11") + ")"
	document.getElementById("DnumKeyWords").innerHTML="(" + document.getElementById("dl_All").getAttribute("P12") + ")"////*
   }
	
}

//all sorce name change
function funChangeAllListSource()
{
  var s=(document.getElementById("Source_").checked==true) ? 1: 0;
  var d=document.getElementsByTagName("input")
  for(var i=0; i<d.length;i++)
   {
     var p=d[i].id
     if (p.indexOf("Source_")!=-1 && s==1 && d[i].id!="Source_")
	  {
	    d[i].checked=false;
	  }
   } 
}

// sorce name change
function funChangeListSource(id)
{
  var s=(document.getElementById(id).checked==true) ? 1: 0;
  if (s==1)
	{
	  document.getElementById("Source_").checked=false;
	}
}

//change checked for selected TLDs  from ALL
function funChangeAllTLD()
{
  var s=(document.getElementById("ch_ALL").checked==true) ? 1: 0;
  var d=document.getElementsByTagName("input")
  for(var i=0; i<d.length;i++)
   {
     var p=d[i].id
     if (p.indexOf("ch_")!=-1 && s==1 && d[i].id!="ch_ALL")
	  {
	    d[i].checked=false;
	  }
   } 
}


//change checked for selected TLDs 
function funChangeTLD(id)
{
  var s=(document.getElementById(id).checked==true) ? 1: 0;
  if (s==1)
	{
	  document.getElementById("ch_ALL").checked=false;
	}
}





//filter clear

function filter_clear()
{

document.getElementById('max_pr').value="-"
document.getElementById('min_pr').value="-"
document.getElementById('max_alexa').value="-"
document.getElementById('min_alexa').value="-"
document.getElementById('max_glinks').value="-"
document.getElementById('min_glinks').value="-"
document.getElementById('max_ylinks').value="-"
document.getElementById('min_ylinks').value="-"
document.getElementById('max_history').value="-"
document.getElementById('min_history').value="-"
document.getElementById('SDmoz').checked=false
}

function filter_gotfocus(box)
{
	if (box.value=="-")
	{
		box.value=""
	}
}

function filter_lostfocus(box)
{

var regexp = /^(\d*)$/;
x= box.value;
var result = x.match(regexp);
regexp = null;
	if (box.value=="" || isNaN(parseInt(box.value)) || result==null)
	{
		if (isNaN(parseInt(box.value)))
		{
			box.value="-"
		}
			else
		{
			box.value=Math.abs(parseInt(box.value))
		}
	}
}


function All_clear()
{
	
	SetShema(0)
	document.getElementById('ch_ALL').checked=true
	funChangeAllTLD()
	document.getElementById('minlength').value="0"
	document.getElementById('maxlength').value="63"
	document.getElementById('excl_Hyph').checked=false
	document.getElementById('excl_Numb').checked=false
	filter_clear()
	document.getElementById('Source_').checked=true
	funChangeAllListSource()
	document.getElementById('dl_All').checked=true
	funChangeAllListDate()
	document.getElementById('domain').value=""
	document.getElementById('domain').focus()

	}





function filter_arrow(aPrId,aMinMax,aDir)
{

switch (aPrId)
{
	case 'min_pr' :
		minval=0;
		maxval=10;
		step=1	
	break

	case 'max_pr' :
		minval=0;
		maxval=10;
		step=1	
	break

	case 'min_alexa':
		minval=0;
		maxval=40000000;
		step=2	
	break

	case 'max_alexa':
		minval=0;
		maxval=40000000;
		step=2	
	break
	case 'min_glinks':
		minval=0;
		maxval=40000000;
		step=2	
	break
	case 'max_glinks':
		minval=0;
		maxval=40000000;
		step=2	

	break
	case 'min_ylinks':
		minval=0;
		maxval=40000000;
		step=2	

	break
	case 'max_ylinks':
		minval=0;
		maxval=40000000;
		step=2	

	break

	case 'min_history':
		minval=0;
		maxval=15;
		step=1	
	break

	case 'max_history':
		minval=0;
		maxval=15;
		step=1	
	break
}
done=0

if (document.getElementById(aPrId).value=="-" || document.getElementById(aPrId).value=="")
{
	if  (aDir==1)
	{
		document.getElementById(aPrId).value=minval;
	}
		else
	{
		document.getElementById(aPrId).value=maxval;
	}
	done=1;
}

if (done!=1)
{
	if (isNaN(parseInt(document.getElementById(aPrId).value)))
	{
		document.getElementById(aPrId).value="-";
		done=1
	}
}
if (done!=1)
{
	var curval =parseInt(document.getElementById(aPrId).value);
	if ((curval==minval && aDir==2) || (curval==maxval && aDir==1))
	{
		document.getElementById(aPrId).value="-";
		done=1;
	}
}

if (done!=1)
{
	if (step==2)
	{
		curvalstring=document.getElementById(aPrId).value
		step = Math.pow(10,curvalstring.length-1)
	}
	if (step<1)
	{
		step=1
	}
	if (aDir==1)
		{
			document.getElementById(aPrId).value=curval+step
		}
			else
		{
			document.getElementById(aPrId).value=curval-step
		}
		
	if (parseInt(document.getElementById(aPrId).value) < minval)
		{
			document.getElementById(aPrId).value=minval
		}
	if (parseInt(document.getElementById(aPrId).value) > maxval)
		{
			document.getElementById(aPrId).value=maxval
		}
}


}
// end filter errow


//'/////////////////////////////////////////////////////////////////////////////////////start cookie///////////////////////////////////////////////////////////////////////////////////////////////////////


//Функция установки значения cookie
// name - имя cookie
// value - значение cookie
// [expires] - дата окончания действия cookie (по умолчанию - до конца сессии)
// [path] - путь, для которого cookie действительно (по умолчанию - документ, в котором значение было установлено)
// [domain] - домен, для которого cookie действительно (по умолчанию - домен, в котором значение было установлено)
// [secure] - логическое значение, показывающее требуется ли защищенная передача значения cookie
function setCookie(name, value, expires, path, domain, secure) {
        var curCookie = name + "=" + escape(value) +
                ((expires) ? "; expires=" + expires.toGMTString() : "") +
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                ((secure) ? "; secure" : "")
//        if (!caution || (name + "=" + escape(value)).length <= 4000)
                document.cookie = curCookie
//        else
//                if (confirm("Cookie превышает 4KB и будет вырезан !"))
//                        document.cookie = curCookie
}

//Функция чтения значения cookie
// name - имя считываемого cookie
function getCookie(name) {
        var prefix = name + "="
        var cookieStartIndex = document.cookie.indexOf(prefix)
        if (cookieStartIndex == -1)
                return null
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
        if (cookieEndIndex == -1)
                cookieEndIndex = document.cookie.length
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}


//Функция удаления значения cookie
// name - имя cookie
// [path] - путь, для которого cookie действительно
// [domain] - домен, для которого cookie действительно
function deleteCookie(name, path, domain) {
        if (getCookie(name)) {
                document.cookie = name + "=" + 
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                "; expires=Thu, 01-Jan-70 00:00:01 GMT"
        }
}

function tldshow()
{
	document.getElementById('tlddiv1').className="tld_div_show"
	document.getElementById('tlddiv2').className="tld_div_show"
	document.getElementById('tldmore').innerHTML="<a href='javascript:tldhide()'><img src='imgs/btn_-.gif' border='0'></a>"
	document.getElementById('saveposframe').src=""
	document.getElementById('saveposframe').src="savepos.asp?opentld=show"
}

function tldhide()
{
	document.getElementById('tlddiv1').className="tld_div_hide"
	document.getElementById('tlddiv2').className="tld_div_hide"
	document.getElementById('tldmore').innerHTML="<a href='javascript:tldshow()'><img src='imgs/btn_+.gif' border='0'></a>"
	document.getElementById('saveposframe').src=""
	document.getElementById('saveposframe').src="savepos.asp?opentld=hide"
}


function advshow()
{	
	document.getElementById('tlddiv1').className="tld_div_show"
	document.getElementById('tlddiv2').className="tld_div_show"
	document.getElementById('tldmore').innerHTML="<a href='javascript:tldhide()'><img src='imgs/btn_-.gif' border='0'></a>"

	document.getElementById('SH_1').className="tld_div_show"
	document.getElementById('SH_2').className="tld_div_show"
	document.getElementById('SH_3').className="tld_div_show"
	document.getElementById('advsearch').innerHTML="<a href='javascript:advhide()'><span class='hideadv'>Hide Advanced Search</span></a>"
	document.getElementById('advsearch2').innerHTML=""
	document.getElementById('saveposframe').src=""
	document.getElementById('saveposframe').src="savepos.asp?openadv=show"
}

function advhide()
{
	document.getElementById('tlddiv1').className="tld_div_hide"
	document.getElementById('tlddiv2').className="tld_div_hide"
	document.getElementById('tldmore').innerHTML="<a href='javascript:tldshow()'><img src='imgs/btn_+.gif' border='0'></a>"

	document.getElementById('tlddiv1').className="tld_div_hide"
	document.getElementById('tlddiv2').className="tld_div_hide"
	document.getElementById('SH_1').className="tld_div_hide"
	document.getElementById('SH_2').className="tld_div_hide"
	document.getElementById('SH_3').className="tld_div_hide"
	document.getElementById('advsearch').innerHTML="<a href='javascript:advshow()'><span class='showadv1'>Open Advanced Search</span></a>"
	document.getElementById('advsearch2').innerHTML="<span class='showadv2'>(Very recommended)</span>"
	document.getElementById('saveposframe').src=""
	document.getElementById('saveposframe').src="savepos.asp?openadv=hide"
}

function verifytellafriend(){

	        if (isEmpty(document.signdetails.fname1.value)) {
	                warnInvalid(document.signdetails.fname1,'Please Fill in your First name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.lname1.value)) {
	                warnInvalid(document.signdetails.lname1,'Please Fill in your Last name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.fname2.value)) {
	                warnInvalid(document.signdetails.fname2,'Please Fill in your Friends First name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.lname2.value)) {
	                warnInvalid(document.signdetails.lname2,'Please Fill in your Friends Last name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.email1.value)) {
	                warnInvalid(document.signdetails.email1,'Please fill in your Email!',true);
	                return false;
	        }
	        if (hassymbol(document.signdetails.email1.value,'@')) {
	                warnInvalid(document.signdetails.email1,'Email does not have @!',true);
	                return false;
	        }
	        if (hassymbol(document.signdetails.email1.value,'.')) {
	                warnInvalid(document.signdetails.email1,'Email does not have a dot!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.email2.value)) {
	                warnInvalid(document.signdetails.email2,'Please fill in your Email!',true);
	                return false;
	        }
	        if (hassymbol(document.signdetails.email2.value,'@')) {
	                warnInvalid(document.signdetails.email2,'Email does not have @!',true);
	                return false;
	        }
	        if (hassymbol(document.signdetails.email2.value,'.')) {
	                warnInvalid(document.signdetails.email2,'Email does not have a dot!',true);
	                return false;
	        }
	}
	function isnum(s)
	{       //alert(s)
		return (isNaN(parseInt(s))==true);
	}


	function warnInvalid (theField, s, EmptyOK)
	{   theField.focus()
	                if (EmptyOK) {
	                        alert(s)
	                } else {
	                        alert(s)
	                }
	    return false
	}

	function isEmpty(s)
	{       //alert(s)
		return ((s == null) || (s.length == 0) || (s == 0) || (s=="0"));
	}


	function hassymbol(s,symb)
	{       //alert(s)
		return (s.indexOf(symb)==-1) ;
	}

	function islong(s,lmin,lmax)
	{       
		return ((s.length < lmin) || (s.length > lmax));
	}


function verifycontactus()
	{
		if (isEmpty(document.signdetails.fname.value)) {
				warnInvalid(document.signdetails.fname,'Please Fill in your First name!',true);
				return false;
		}
		if (isEmpty(document.signdetails.lname.value)) {
				warnInvalid(document.signdetails.lname,'Please Fill in your Last name!',true);
				return false;
		}
		if (islong(document.signdetails.fname.value,1,50)) {
				warnInvalid(document.signdetails.fname,'First name cant be longer then 15 chars',true);
				return false;
		}
		if (islong(document.signdetails.lname.value,1,50)) {
				warnInvalid(document.signdetails.lname,'Last name cant be longer then 15 chars',true);
				return false;
		}
		if (isEmpty(document.signdetails.email.value)) {
				warnInvalid(document.signdetails.email,'Please fill in your Email!',true);
				return false;
		}
		if (hassymbol(document.signdetails.email.value,'@')) {
				warnInvalid(document.signdetails.email,'Email does not have @!',true);
				return false;
		}
		if (hassymbol(document.signdetails.email.value,'.')) {
				warnInvalid(document.signdetails.email,'Email does not have a dot!',true);
				return false;
		}
		if (isEmpty(document.signdetails.comment.value)) {
				warnInvalid(document.signdetails.comment,'Please Fill in a Comment!',true);
				return false;
		}
	}





//statistics pages only
function loadLinkData()
{

var prs=getParameter(location.href,"prs")
 if (prs=="null" || prs=="")
 {
	 document.getElementById("min_pr").value="-"
	 document.getElementById("max_pr").value="-"
	 document.getElementById("min_alexa").value="-"
	 document.getElementById("max_alexa").value="-"
	 document.getElementById("min_glinks").value="-"
	 document.getElementById("max_glinks").value="-"
	 document.getElementById("min_ylinks").value="-"
	 document.getElementById("max_ylinks").value="-"
	 document.getElementById("min_history").value="-"
	 document.getElementById("max_history").value="-"
	 document.getElementById("SDmoz").checked=false
 
 }
 else
 {
	 var b=prs.split(';');
	 
	 k=b[0].split("-")
	 document.getElementById("min_pr").value=(k[0]=="$") ? "-" : k[0]
	 document.getElementById("max_pr").value=(k[1]=="$") ? "-" : k[1]
	 
	 k=b[1].split("-")
	 document.getElementById("min_alexa").value=(k[0]=="$") ? "-" : k[0]
	 document.getElementById("max_alexa").value=(k[1]=="$") ? "-" : k[1]

	 k=b[2].split("-")
	 document.getElementById("min_glinks").value=(k[0]=="$") ? "-" : k[0]
	 document.getElementById("max_glinks").value=(k[1]=="$") ? "-" : k[1]

	 k=b[3].split("-")
	 document.getElementById("min_ylinks").value=(k[0]=="$") ? "-" : k[0]
	 document.getElementById("max_ylinks").value=(k[1]=="$") ? "-" : k[1]

	 
	 k=b[4].split("-")
	 document.getElementById("min_history").value=(k[0]=="$") ? "-" : k[0]
	 document.getElementById("max_history").value=(k[1]=="$") ? "-" : k[1]

	 k=b[5].split("-")
	 if (k[0]=="$" || k[0]==0) k[0]=false
	               else        k[0]=true
	 document.getElementById("SDmoz").checked=k[0]
 }
 
 
 
 
 var source=getParameter(location.href,"sourceList")
 if (source=="null" || source=="") 
  {
    document.getElementById("Source_").checked=true
    funChangeAllListSource()
  }
 else
  {
    var c=source.split(';;');
	for (var i = 0; i < c.length; i++) 
	{
	  document.getElementById("Source_" + c[i]).checked=true
	  funChangeListSource("Source_" + c[i])
	}	
  }	
 
 
 
 
 
  var dropid=getParameter(location.href,"dropid")
  if (dropid=="null" || dropid=="") 
  {
    document.getElementById("dl_All").checked=true
    funChangeAllListDate()
  }
  else
  {
	var a = dropid.split(',');
	for (var i = 0; i < a.length; i++) 
	{
	  document.getElementById("dl_" + a[i]).checked=true
	  funChangeListDate("dl_" + a[i])
	}
  }
}


//get paramet from command line
function getParameter ( queryString, parameterName ) 
{
	// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";
	if ( queryString.length > 0 ) 
		{
			// Find the beginning of the string
			begin = queryString.indexOf ( parameterName );
			// If the parameter name is not found, skip it, otherwise return the value
			if ( begin != -1 ) 
			{
				// Add the length (integer) to the beginning
				begin += parameterName.length;
				// Multiple parameters are separated by the "&" sign
				end = queryString.indexOf ( "&" , begin );
				if ( end == -1 )
				{
					end = queryString.length
				}
				// Return the string
				return unescape ( queryString.substring ( begin, end ) );
			}
			// Return "null" if no parameter has been found
			return "null";
		}
} 


function getCurrentParametersLine()
{
 var count1=getParameter(location.href,"count")
 if (count1=="null" || count1=="") 
 {
	count1=document.getElementById("resperpage").options[document.getElementById("resperpage").selectedIndex].value
		if (count1=="null" || count1=="") count1=1
 }
  
 var Page_Name1=getParameter(location.href,"Page_Name")
 if (Page_Name1=="null" || Page_Name1=="") Page_Name1="All_Dropped_Domains"
 
 var page1=getParameter(location.href,"page")
 if (page1=="null" || page1=="") page1=1
 
 var tld1=getParameter(location.href,"tld")
 if (tld1=="null" || tld1=="") tld1=""
  
 var dropid1=getParameter(location.href,"dropid")
 if (dropid1=="null" || dropid1=="") dropid1=""
 
 var minlen1=getParameter(location.href,"minlen")
 if (minlen1=="null" || minlen1=="") minlen1=1
 
 var maxlen1=getParameter(location.href,"maxlen")
 if (maxlen1=="null" || maxlen1=="") maxlen1=63
 
 var domain1=getParameter(location.href,"domain")
 if (domain1=="null" || domain1=="") domain1=""
 
 var pos1=getParameter(location.href,"pos")
 if (pos1=="null" || pos1=="") pos1=2
 
 var shema1=getParameter(location.href,"shema")
 if (shema1=="null" || shema1=="") shema1=""
 
 var field1=getParameter(location.href,"field")
 if (field1=="null" || field1=="") field1=2
 
 var dir1=getParameter(location.href,"dir")
 if (dir1=="null" || dir1=="") dir1="desc"
 
 var lastfield1=getParameter(location.href,"lastfield")
 if (lastfield1=="null" || lastfield1=="") lastfield1=-1
 
 var prid1=getParameter(location.href,"prid")
 if (prid1=="null" || prid1=="") prid1=-1
 
 var paging1=getParameter(location.href,"paging")
 if (paging1=="null" || paging1=="") paging1=0
 
 var click1=getParameter(location.href,"click")
 if (click1=="null" || click1=="") click1=0
 
 var nonum1=getParameter(location.href,"nonum")
 if (nonum1=="null" || nonum1=="") nonum1=0
 
 var nosgn1=getParameter(location.href,"nosgn")
 if (nosgn1=="null" || nosgn1=="") nosgn1=0
 
 var minA1=getParameter(location.href,"minA")
 if (minA1=="null" || minA1=="") minA1=-1
 
 var maxA1=getParameter(location.href,"maxA")
 if (maxA1=="null" || maxA1=="") maxA1=-1
 
 var minPR1=getParameter(location.href,"minPR")
 if (minPR1=="null" || minPR1=="") minPR1=-1
 
 var maxPR1=getParameter(location.href,"maxPR")
 if (maxPR1=="null" || maxPR1=="") maxPR1=-1
 
 var sourceList1=getParameter(location.href,"sourceList")
 if (sourceList1=="null" || sourceList1=="") sourceList1=""
 
 var prs1=getParameter(location.href,"prs")
 if (prs1=="null" || prs1=="") prs1="$-$;$-$;$-$;$-$;$-$;0-0"

 if (ourrank!="1")
 {
ourrank=getParameter(location.href,"OURRANK")
 if (ourrank=="null" || ourrank=="") ourrank="0"
 }
 
 return {
		count:count1 , Page_Name:Page_Name1 , page:page1 , tld:tld1     , dropid:dropid1       , minlen:minlen1 , 
		maxlen:maxlen1 ,	domain:domain1 , pos:pos1 ,     shema:shema1   ,     field:field1   , dir:dir1 ,
		lastfield:lastfield1 , 	prid:prid1 , paging:paging1 ,    click:click1 , 	nonum:nonum1  , nosgn:nosgn1 , 
		minA:minA1   , 	maxA:maxA1   , minPR:minPR1 ,  maxPR:maxPR1 ,   sourceList:sourceList1 , prs:prs1 
		}
}	//'/////////////////////////////////////////////////////////////////////////////////////end cookie///////////////////////////////////////////////////////////////////////////////////////////////////////




function settime()
{
	mydate= new Date()
	document.getElementById('timer').innerHTML = "<span class='SSS_top_cats'>" + mydate.getDate() + "/" + (mydate.getMonth() +1) + "/" + mydate.getFullYear() + " " + addzer(mydate.getHours()) + ":" + addzer(mydate.getMinutes()) + ":" + addzer(mydate.getSeconds()) + " Local Time</span>"
	setTimeout("settime()",1000)
}

function addzer(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}

function showloading()
{

	var t=document.body.clientWidth  
	if(t=="undefined") t= document.body.innerWidth 
	document.getElementById("loadtable").width=t
	document.getElementById("loaddiv").className="tld_div_show"
	document.getElementById("loadtable2").width=t
	document.getElementById("load_mfl2").width=parseInt((t-300)/2)
	document.getElementById("load_mfr2").width=parseInt((t-300)/2)
	document.getElementById("loaddiv2").className="tld_div_show"

}


function pla_close()
{
	document.getElementById("pla_hide").className="plashka_table_hid"
	document.getElementById("pla_open_span").innerHTML="<a href='javascript:pla_open()'>Open</a>"
	document.getElementById('saveposframe').src="savepos.asp?pla=hide"

	
}

function pla_open()
{
	document.getElementById("pla_hide").className="plashka_table"
	document.getElementById("pla_open_span").innerHTML="<a href='javascript:pla_close()'>Close</a>"
	document.getElementById('saveposframe').src="savepos.asp?pla=show"
}



function copyDomainNames()
{
	var trs = document.getElementById("results_table").getElementsByTagName("tr")
		for (var i=1;i<trs.length;i++)
		{
			trs[i].innerHTML=trs[i].innerHTML.replace(/D=XdX/g,"D=" + trs[i].getAttribute("DN"))
		}
}

function fl(thelink)
{
	if (thelink.getAttribute("T")==20)
	{
	thelink.href="Http://www.userstatistics.com/?Page_Name=WebStats_Statistics_Check_Domain_Traffic_Rank_Visits_Per_Day_Month&domain=" + thelink.parentNode.parentNode.getAttribute("DN")
	}
		else
	{
	thelink.href="check.asp?T=T" + thelink.getAttribute("T") + "&D=" + thelink.parentNode.parentNode.getAttribute("DN")
	}
}




function pla_sel_day(idlist,listbaseid)
{
	document.getElementById("pla_row_d0").className="bg_Row1"
	document.getElementById("pla_row_d1").className="bg_Row1"
	document.getElementById("pla_row_d2").className="bg_Row1"
	document.getElementById("pla_row_d3").className="bg_Row1"
	document.getElementById("pla_row_d4").className="bg_Row1"
	document.getElementById("pla_row_sd0").className="bg_TopRowLine"
	document.getElementById("pla_row_sd1").className="bg_TopRowLine"
	document.getElementById("pla_row_sd2").className="bg_TopRowLine"
	document.getElementById("pla_row_sd3").className="bg_TopRowLine"
	document.getElementById("pla_row_sd4").className="bg_TopRowLine"
	document.getElementById("pla_row_rd0").className="bg_Row1"
	document.getElementById("pla_row_rd1").className="bg_Row1"
	document.getElementById("pla_row_rd2").className="bg_Row1"
	document.getElementById("pla_row_rd3").className="bg_Row1"
	document.getElementById("pla_row_rd4").className="bg_Row1"
	document.getElementById("pla_row_" + idlist).className="plashka_sel"
	document.getElementById("pla_row_s" + idlist).className="plashka_sel"
	document.getElementById("pla_row_r" + idlist).className="plashka_ssel"

	document.getElementById("sel_date").innerHTML=listbaseid
	document.getElementById("pla_tra").innerHTML=document.getElementById("pla_tra").getAttribute(idlist)
	document.getElementById("pla_pr").innerHTML=document.getElementById("pla_pr").getAttribute(idlist)
	document.getElementById("pla_ale").innerHTML=document.getElementById("pla_ale").getAttribute(idlist)
	document.getElementById("pla_gbl").innerHTML=document.getElementById("pla_gbl").getAttribute(idlist)
	document.getElementById("pla_ybl").innerHTML=document.getElementById("pla_ybl").getAttribute(idlist)
	document.getElementById("pla_age").innerHTML=document.getElementById("pla_age").getAttribute(idlist)
	document.getElementById("pla_dmz").innerHTML=document.getElementById("pla_dmz").getAttribute(idlist)
	
	document.getElementById("pla_s0").innerHTML=document.getElementById("pla_s0").getAttribute(idlist)
	document.getElementById("pla_sn").innerHTML=document.getElementById("pla_sn").getAttribute(idlist)
	document.getElementById("pla_nj").innerHTML=document.getElementById("pla_nj").getAttribute(idlist)
	document.getElementById("pla_gd").innerHTML=document.getElementById("pla_gd").getAttribute(idlist)
	document.getElementById("pla_an").innerHTML=document.getElementById("pla_an").getAttribute(idlist)
	document.getElementById("pla_kw").innerHTML=document.getElementById("pla_kw").getAttribute(idlist)////*
	
	document.getElementById("pla_com").innerHTML=document.getElementById("pla_com").getAttribute(idlist)
	document.getElementById("pla_net").innerHTML=document.getElementById("pla_net").getAttribute(idlist)
	document.getElementById("pla_org").innerHTML=document.getElementById("pla_org").getAttribute(idlist)
	document.getElementById("pla_info").innerHTML=document.getElementById("pla_info").getAttribute(idlist)
	document.getElementById("pla_biz").innerHTML=document.getElementById("pla_biz").getAttribute(idlist)
	document.getElementById("pla_other").innerHTML=document.getElementById("pla_other").getAttribute(idlist)

	 
	if (listbaseid!="") //dynamic selected day
	{
		document.getElementById("pla_ns_1").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=1&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_2").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=3&dir=asc&lastfield=-1&prid=2&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_3").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=4&dir=desc&lastfield=-1&prid=3&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_4").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=5&dir=desc&lastfield=-1&prid=4&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_5").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=11&dir=desc&lastfield=-1&prid=10&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_6").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=9&dir=desc&lastfield=-1&prid=8&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_7").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=0&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_8").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=3&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_9").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=2&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_10").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=5&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_11").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=14&dir=desc&lastfield=-1&prid=11&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_19").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=14&dir=desc&lastfield=-1&prid=12&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"////*
		
		document.getElementById("pla_ns_12").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=com&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_13").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=net&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_14").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=org&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_15").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=info&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_16").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=biz&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_17").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=us;;mobi;;eu;;de;;co.uk;;other&dropid=" + listbaseid + "&minlen=1&maxlen=63&domain=&pos=2&shema=&field=2&dir=desc&lastfield=-1&prid=-1&paging=0&click=1&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
		document.getElementById("pla_ns_18").href="index.asp?Page_Name=All_Dropped_Domains&page=1&tld=&dropid=" + listbaseid + "&minlen=&maxlen=&domain=&pos=2&shema=&field=14&dir=desc&lastfield=-1&prid=1&paging=0&click=0&nonum=0&nosgn=0&minA=-1&maxA=-1&minPR=-1&maxPR=-1&sourceList=&prs=$-$;$-$;$-$;$-$;$-$;0-0"
	}
	else  //static all total days
	{
		document.getElementById("pla_ns_1").href="index.asp?Page_Name=Expiring_Domains_With_Google_Page_Rank"
		document.getElementById("pla_ns_2").href="index.asp?Page_Name=Expiring_Domains_With_Alexa_Rank"
		document.getElementById("pla_ns_3").href="index.asp?Page_Name=Expiring_Domains_With_Google_Back_Links"
		document.getElementById("pla_ns_4").href="index.asp?Page_Name=Expiring_Domains_With_Yahoo_Back_Links"
		document.getElementById("pla_ns_5").href="index.asp?Page_Name=Expiring_Domains_With_Age_History"
		document.getElementById("pla_ns_6").href="index.asp?Page_Name=Expiring_Domains_With_Dmoz_Listing"
		document.getElementById("pla_ns_7").href="index.asp?Page_Name=Expiring_Domains_From_Unexclusive_Drop_List"
		document.getElementById("pla_ns_8").href="index.asp?Page_Name=Expiring_Domains_From_SnapNames"
		document.getElementById("pla_ns_9").href="index.asp?Page_Name=Expiring_Domains_From_NameJet"
		document.getElementById("pla_ns_10").href="index.asp?Page_Name=Expiring_Domains_From_GoDaddy"
		document.getElementById("pla_ns_11").href="index.asp?Page_Name=Expiring_Domains_With_Typos"
		document.getElementById("pla_ns_19").href="index.asp?Page_Name=Expiring_Domains_With_KeyWords"		////*
		document.getElementById("pla_ns_12").href="index.asp?Page_Name=Expiring_Domains_in_TLD_COM"
		document.getElementById("pla_ns_13").href="index.asp?Page_Name=Expiring_Domains_in_TLD_NET"
		document.getElementById("pla_ns_14").href="index.asp?Page_Name=Expiring_Domains_in_TLD_ORG"
		document.getElementById("pla_ns_15").href="index.asp?Page_Name=Expiring_Domains_in_TLD_INFO"
		document.getElementById("pla_ns_16").href="index.asp?Page_Name=Expiring_Domains_in_TLD_BIZ"
		document.getElementById("pla_ns_17").href="index.asp?Page_Name=Expiring_Domains_in_TLD_Other"
		document.getElementById("pla_ns_18").href="index.asp?Page_Name=Expiring_Domains_With_Traffic"		
	}	
	
}




function accountverify(){
	        if (isEmpty(document.signdetails.fname.value)) {
	                warnInvalid(document.signdetails.fname,'Please Fill in your First name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.lname.value)) {
	                warnInvalid(document.signdetails.lname,'Please Fill in your Last name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.user.value)) {
	                warnInvalid(document.signdetails.user,'Please Fill in a User name!',true);
	                return false;
	        }
	        if (isEmpty(document.signdetails.pass1.value)) {
	                warnInvalid(document.signdetails.pass1,'Please Fill a password!',true);
	                return false;
	        }
	        if (document.signdetails.pass1.value!=document.signdetails.pass2.value) {
				document.signdetails.pass1.value=""
				document.signdetails.pass2.value=""
	                warnInvalid(document.signdetails.pass1,'Passwords dont match, please try again.',true);
	                return false;
	        }

	        if (isEmpty(document.signdetails.email.value)) {
	                warnInvalid(document.signdetails.email,'Please fill in your Email!',true);
	                return false;
	        }
	        if (hassymbol(document.signdetails.email.value,'@')) {
	                warnInvalid(document.signdetails.email,'Email does not have @!',true);
	                return false;
	        }
	        if (hassymbol(document.signdetails.email.value,'.')) {
	                warnInvalid(document.signdetails.email,'Email does not have a dot!',true);
	                return false;
	        }

	        if (isEmpty(document.signdetails.url1.value)) {
	                warnInvalid(document.signdetails.url1,'Please fill in your Website URL!',true);
	                return false;
	        }

	        //if ((document.signdetails.agree.checked!=true)) {
	        //        warnInvalid(document.signdetails.agree,'You must agree to the terms of service to sign up!',true);
	        //        return false;
	        //}


var u=document.signdetails.user.value
document.getElementById("checkuserframe").src="getData.asp?Param=1&DATA1="+ u 

//q=""

//do 
//{
//	q = document.getElementById("checkuserframe").contentWindow.document.body.innerHTML
//}
//while (q=="")


//if (q.indexOf("CHECK=OK")==-1)
//   {
//	warnInvalid(document.signdetails.user,'User name already taken, try a different one.!',true);
//	return false
//   }
   return true
}



function loginverify(){

	        if (isEmpty(document.logindetails.user.value)) {
	                warnInvalid(document.logindetails.user,'Please Fill in your User name!',true);
	                return false;
	        }
	        if (isEmpty(document.logindetails.pass1.value)) {
	                warnInvalid(document.logindetails.pass1,'Please Fill in your password!',true);
	                return false;
	        }
}

function forgotverify(){

	        if (document.signdetails.user.value!=document.signdetails.pass2.value) {
	                warnInvalid(document.signdetails.user,'Passwords dont match, please try again.',true);
	                return false;
	        }

	        if (document.signdetails.pass1.value!=document.signdetails.pass2.value) {
	                warnInvalid(document.signdetails.pass1,'Please enter your password.',true);
	                return false;
	        }
}


  function goClientStatisticsByDate()
 {
  var date1,date2 ,url , catid , findopt
   
   if (document.getElementById("Sel1").value!="" && 
       document.getElementById("Sel2").value!="" && 
       document.getElementById("Sel3").value!="" && 
       document.getElementById("Sel4").value!="" && 
       document.getElementById("Sel5").value!="" && 
       document.getElementById("Sel6".value)!=""  )
       
       {
        var a1=document.getElementById("Sel1").value
        var a2=parseInt(document.getElementById("Sel2").value) + parseInt(1)
        var a3=document.getElementById("Sel3").value
        var a4=document.getElementById("Sel4").value
        var a5=parseInt(document.getElementById("Sel5").value) + parseInt(1)
        var a6=document.getElementById("Sel6").value
    
        var b2=new String(a2) 
        var b5=new String(a5) 
    
        if (b2.length==1) b2='' + "0" + b2
        if (a3.length==1) a3='' + "0" + a3
        if (b5.length==1) b5='' + "0" + b5
        if (a6.length==1) a6='' + "0" + a6
    

        date1=a1 + "-" + b2 + "-" + a3;
        date2=a4 + "-" + b5 + "-" + a6;

		var id=readCookie("uid")
		location.href="Index.asp?Page_Name=Client_Stats&CLIENTID="+ id + "&DATEFROM=" + date1 + "&DATETO=" + date2 
       }
   
  else
     {
      alert(alert10)
     }   
 }

 
function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split('&');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
} 



function SetDates(str1, str2)
	{
		var x1, x2,x11,x22 
		var Arr1= new Array()
		var Arr2=new Array()
		if (str1=="") str1="2007-01-01"
		if (str2=="") 
			{ 	
				var f=new Date()
				var t1=f.getFullYear()
				var t2=parseInt(f.getMonth()) +1 
				if (t2.length==1)  t2='0'+ t2
				var t3=f.getDate() 
				if (t3.length==1)  t3='0'+ t3
				str2=new String(t1 + '-' + t2 + '-' + t3)
			}	

		
		if (str1!="")
			{
				Arr1=str1.split("-")   
				x1=getMonthName(Arr1[1])
				Arr1[2]=getDay(Arr1[2])
				x11=Arr1[1]
				if(x11.substring(0,1)=="0") x11=x11.substring(1,x11.length)
			} 

			if (str2!="")
				{
					Arr2=str2.split("-")   
					x2=getMonthName(Arr2[1])
					Arr2[2]=getDay(Arr2[2]) 
					x22=Arr2[1]
					if(x22.substring(0,1)=="0") x22=x22.substring(1,x22.length)
				}
				
				
			document.getElementById("Sel1").value=Arr1[0];
			chYear(document.getElementById("Sel1"))
			document.getElementById("Sel2").text=x1;
			document.getElementById("Sel2").value=parseInt(x11)-1;
			chMonth( document.getElementById("Sel2"))
			document.getElementById("Sel3").value=Arr1[2];


			document.getElementById("Sel4").value=Arr2[0];   
			chYear(document.getElementById("Sel4"))
			document.getElementById("Sel5").text=x2;
			document.getElementById("Sel5").value=parseInt(x22)-1;
			chMonth( document.getElementById("Sel5"))
			document.getElementById("Sel6").value=Arr2[2];

	}	
	
	
	function UpdateClientData()
{
  
  if (document.getElementById("butSave").value=="Change Data") 
  	{
		document.getElementById("butSave").value="Save"
		document.getElementById("iNAME").disabled=false
		document.getElementById("iLASTNAME").disabled=false
		document.getElementById("iEMAIL").disabled=false
		document.getElementById("iPHONE").disabled=false
		document.getElementById("iPASSWORD").disabled=false
		document.getElementById("iCOMPANY").disabled=false
		document.getElementById("iSITE").disabled=false
	}
  
  else
	{
		var p1=convertToUnicode(document.getElementById("iNAME").value)
		var p2=convertToUnicode(document.getElementById("iLASTNAME").value)
		var p3=convertToUnicode(document.getElementById("iEMAIL").value)
		var p4=document.getElementById("iPHONE").value
		var p5=document.getElementById("iPASSWORD").value
		var p6=document.getElementById("iCOMPANY").value
		var p7=document.getElementById("iSITE").value
		var p0=readCookie("uid")
  
		var sxml='<ROOT><DATA ID="' + p0 + '" FIRSTNAME="' + p1 + '" LASTNAME="' + p2 + '"  EMAIL="' + p3 + '" PHONE="' + p4 + '" PASSWORD="' + p5 + '" COMPANY="' + p6 + '" SITE="' + p7 + '" /></ROOT>'
		document.FCAT.action="GetData.asp"
		document.FCAT.method="post"
		document.FCAT.target="ICAT"
		document.getElementById("Param").value=21 // update  client
		document.getElementById("XML").value=sxml 
		document.FCAT.submit()  
		
		document.getElementById("butSave").value="Change Data"
		document.getElementById("iNAME").disabled=true
		document.getElementById("iLASTNAME").disabled=true
		document.getElementById("iEMAIL").disabled=true
		document.getElementById("iPHONE").disabled=true
		document.getElementById("iPASSWORD").disabled=true
		document.getElementById("iCOMPANY").disabled=true
		document.getElementById("iSITE").disabled=true
	}	
  
}

  function convertToUnicode(unicode)
	{

     var tstr = unicode
     var bstr = '';
      for(i=0; i < tstr.length; i++)
      {
        bstr += '&#' + tstr.charCodeAt(i) + ';';
	  }	
      return (bstr);
    }

	
	
 //insert link from client
function AddNewLinkFromClient()
{
  
  var p1=convertToUnicode(document.getElementById("iURL").value)
  var p2=convertToUnicode(document.getElementById("iDESCRIPTION").value)
  var p3=convertToUnicode(document.getElementById("iCAPTION").value)
  var p4=document.getElementById("iCAT").options[document.getElementById("iCAT").selectedIndex].value
  var p0=readCookie("uid")
  var sxml='<ROOT><DATA  IDSUBCAT="' + p4 + '"  URL="' + p1 + '"  DESC="' + p2  + '" CAPTION="' + p3 + '"  IDCLIENT="' + p0 + '" /></ROOT>'

 // document.FCAT.action="GetData.asp"
 // document.FCAT.method="post"
 // document.FCAT.target="ICAT"
  document.getElementById("Param").value=20 //link from client
  document.FCAT.action="index.asp?Page_Name=Insert_Link"
  document.FCAT.method="post"
  document.getElementById("XML").value=sxml 
  document.FCAT.submit()  
    
}
 
 // change data or update link to client
  function EditLinkFromClient()
  {
	if (document.getElementById("butSave").value=="Change Data") 
  	{
	  	document.getElementById("butSave").value="Save"
		document.getElementById("iCAT").disabled=false
		document.getElementById("iURL").disabled=false
		document.getElementById("iCAPTION").disabled=false
		document.getElementById("iDESCRIPTION").disabled=false
	}
	
	else
	{
		var p1=document.getElementById("iCAT").value
		var p2=convertToUnicode(document.getElementById("iURL").value)
		var p3=convertToUnicode(document.getElementById("iCAPTION").value)
		var p4=convertToUnicode(document.getElementById("iDESCRIPTION").value)
		var p5=document.getElementById("iCAT").getAttribute("idlink")
		var sxml='<ROOT><DATA IDLINK="' + p5 + '" URL="' + p2 + '" CAPTION="' + p3 + '"  DESCRIPTION="' + p4 + '" SUBCAT="' + p1 + '"/></ROOT>'
		
		document.FCAT.action="index.asp?Page_Name=Insert_Link"
		document.FCAT.method="post"
		//document.FCAT.target="ICAT"
		document.getElementById("Param").value=33 // update link client
		document.getElementById("XML").value=sxml 
		document.FCAT.submit()  		
		
 	  	//document.getElementById("butSave").value="Change Data"
		//document.getElementById("iCAT").disabled=true
		//document.getElementById("iURL").disabled=true
		//document.getElementById("iCAPTION").disabled=true
		//document.getElementById("iDESCRIPTION").disabled=true
	}
  }
 
 
 