GPR = null;
INWORK1 = false;
vURLsh = false;
function GPRC()
{
	this.requestx = function()
	{
		if(this.e('iURLsh').value == '' || this.e('iURLsh').value == 'http://')
		{
			alert('Enter you URL please')
		}
		else if(!this.e('CAPCHA').value)
		{
			alert("Please enter in the Calculation Result in the box below");
		}
		else
		{
		if(!INWORK1)
		{
			LEVEL = 1;
			clearTimeout(TTC_TIMER);
			this.e('CONTRACTOR').innerHTML = '';
			this.e('SNAP').innerHTML = '';
			vURLsh = this.e('iURLsh').value
			INWORK1 = true;
			this.e('mload').innerHTML = '<img src="img/loading.gif" /><span style="font-size:8pt;font-weight:normal">checking...</span>';
			ajax(null);
		}
		}
	}
	
	this.e = function(item)
	{
		return document.getElementById(item);
	}
	
	this.CRTBE = function(item)
	{
		eval(item);
		if(additionalinfo[2]==1)
		{
			var listeddo = "Yes";
		}
		else
		{
			var listeddo = "No";
		}
		this.e('ANNEX').innerHTML = '<table width="100%" border="0" cellpadding="1" cellspacing="0">  <tr class="row1">    <td>PageRank</td><td align="right">'+additionalinfo[0]+'</td>  </tr>  <tr class="row2">   <td>Alexa Rank</td><td align="right">'+additionalinfo[1]+'</td>  </tr>  <tr class="row1">    <td>Listed in DMOZ</td><td align="right">'+listeddo+'</td>  </tr>  <tr class="row2">    <td>Backlinks from Google</td><td align="right">'+additionalinfo[3]+'</td>  </tr>  <tr class="row1">    <td>Backlinks from Yahoo</td><td align="right">'+additionalinfo[4]+'</td>  </tr>  <tr class="row2">    <td>Backlinks from MSN</td><td align="right">'+additionalinfo[5]+'</td>  </tr>  <tr class="row1">    <td>Results from AltaVista</td><td align="right">'+additionalinfo[6]+'</td>  </tr>  <tr class="row2">    <td>Results from All the Web</td><td align="right">'+additionalinfo[7]+'</td>  </tr></table>';
		var HHT = '';
		var lil = null;
		this.e('URLsh').innerHTML = vURLsh
		for(var i=0;i<ips.length;i++)
		{
			if(lil)
			{
				var bg = 'E2EAE2';lil = null;var co = '3F523F';
			}
			else
			{
				var bg = '8E9F8F';lil = 1;var co = 'FFFFFF';
			}
			HHT += '<tr><td class="RS1" style="background-color:#'+bg+';color:#'+co+';width:30px;padding:4px;" align="right">'+(i+1)+'</td><td class="RS2" style="background-color:#'+bg+';color:#'+co+';padding:4px;font-weight:bold" align="center">'+ips[i]+'</td><td class="RS3" style="background-color:#'+bg+';color:#'+co+';padding:4px;font-weight:bold" align="center"><div id="myGPR'+ips[i]+'"><img src="img/pr_ani.gif" ></div></td></tr>';
		}
		this.e('CONTRACTOR').innerHTML = '<table width="435" border="0" cellpadding="1" cellspacing="1"><tr><td height="5px;"></td></tr><tr><td class="RS1" style="background-color:#81B5A1;color:#FFFFFF;width:30px;padding:4px;" align="right">&nbsp;</td><td class="RS2" style="background-color:#81B5A1;color:#FFFFFF;padding:4px;font-weight:bold" align="center">Google data center</td><td class="RS3" style="background-color:#81B5A1;color:#FFFFFF;padding:4px;font-weight:bold" align="center">PageRank</td></tr>'+HHT+'</table>';
		TTC_TIMER = setTimeout(TTC, 1000);
		TTC_COUNT = 0;
		TTC_MAX = ips.length;
		
		this.e('SNAP').innerHTML = '<div style="margin-top:15px;margin-left:5px;float:left"><img src="img/gpr_17.gif"></div><div style="margin-top:15px;float:left;background-image:url(\'img/gpr_18.gif\');height:163px;"><div style="padding:10px;"><img src="http://open.thumbshots.org/image.pxf?url='+vURLsh+'&size=1" border="0"></div></div><div style="margin-top:15px;float:left"><img src="img/gpr_20.gif"></div>';
	}
}
TTC_TIMER = null;
TTC_COUNT = 0;
TTC_MAX = 0;
function TTC()
{	
	if(TTC_COUNT > (TTC_MAX-1))
	{
		clearTimeout(TTC_TIMER);
	}
	else
	{
		ajax(ips[TTC_COUNT]);
	}
	TTC_COUNT++;
}

function intialize()
{
	GPR = new GPRC();
}

window.onload = intialize;