var it=0;
var starid='';
var pagelink='';
document.write ('<script language="javascript" src="http:\/\/www.whichpornstar.co.uk\/scripts\/ttstats.js"><\/script>');
document.close();

function topten()
{	
	document.getElementById('toptenbox').insertAdjacentHTML("beforeEnd",toptentext);	
}

function getSearch()
{
    if(document.location.search){
    tag=document.location.search.substring(2,3);
    if(tag==2){
    	document.getElementById('score').style.display='block';
		}
   if(tag==5){
    	document.getElementById('comment').value = "Thank you for your comment!";
		}	
	}
}

function getSearchHome()
{
    if(document.location.search){
    	tag=document.location.search.substring(2,3);
    	if(tag==1){
    		tag2=unescape(document.location.search.substring(9,document.location.search.length));
    		if(tag2.length > 2){
    			alert("Sorry, there was no result for \""+tag2+"\".\r\n\r\nTry again or click a link below...");
    			}
    			else{
    				alert("Sorry, there was no result for \""+tag2+"\".\r\n\r\nThe search term must 3 or more letters...");
    			}
		}
	}
}

function getSearchRef()
{
    if(document.location.search){
    	tag=document.location.search.substring(2,3);
    	if(tag==1){
    		tag2=unescape(document.location.search.substring(9,document.location.search.length));
    		place=tag2.lastIndexOf("&");
    		if(place !=-1){
    			tag3=tag2.substring(0,place);
    		}
    		else{
    			tag3=tag2;
    		}
    		document.getElementById('return').innerHTML="<a href=\"pages/starsearch.php?star="+tag3+"\" onMouseOver=\"window.status='';return true;\"><img src=\"images/searchres.gif\" width=40 height=40 alt=\"Return to search for '"+tag3+"'\" border=0></a>";
		}
	}
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function SetCookie(name, value, starname){  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length-1;  
	var expires = (argc > 2) ? argv[2] : null;
	if(!getCookie(name)){
		document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString()));
		entryform('reroute.php',name);
		}
		else{
			alert("You have already voted for...\r\n\r\n"+starname+"\r\n\r\n...try again tomorrow");
			}
}

function entry(target){
	trans1.action=target;
	trans1.submit();
}

function entryform(target,name){
	trans.action=target;
	trans.star.value=name;
	if(name !=''){
		trans.submit();
	}
	else{
		alert('Please enter a search term of 3 or more letters');
	}
}

function changesearch(){
search4.innerHTML='<a href="javascript:;"><b>find</b></a>';
}

function showmainnav(){
	document.getElementById('return').style.display= 'block';
}

function shownav(mainpath,ind){
	if(ind<11)
	{
		if(ind<9)
		{
			left="0"+(ind-1);
			dleft=(ind-1);
			right="0"+(ind+1);
			dright=(ind+1)
		}
		else
		{
			left="0"+(ind-1);
			dleft=(ind-1);
			right=(ind+1);
			dright=(ind+1);
		}
	}
	else
	{
		left=(ind-1);
		dleft=(ind-1);
		right=(ind+1);
		dright=(ind+1);			
	}
	
	leftarg=mainpath+left+"_sml.jpg";
	rightarg=mainpath+right+"_sml.jpg";
	//alert(left+"  "+ind+"  "+right);
	
	if(ind>1){
		if(ind<max){
			document.getElementById('back').style.display='block';
			document.getElementById('next').style.display='block';
		}
		else{
			document.getElementById('back').style.display='block';
			document.getElementById('next').style.display='none';
		}
	}
	else{
		document.getElementById('back').style.display='none';
		document.getElementById('next').style.display='block';
	}
}

function showpic(imfile,place,copyarea,ind){
	document.getElementById(place).src='images/load.gif';
	mainpath=imfile.substring(0,imfile.length-7);
	imfile=mainpath+'L.jpg';
	mainpath=mainpath.substring(0,mainpath.length-3);
	shownav(mainpath,ind);
	document.getElementById(place).src=imfile;
	document.getElementById(copyarea).style.display='none';
	document.getElementById('piccy').style.display='block';
	document.getElementById(place).style.display='block';
}

function changepic(imfile,place,ind){
	document.getElementById(place).src='images/load.gif';
	mainpath=imfile.substring(0,imfile.length-7);
	imfile=mainpath+'L.jpg';
	mainpath=mainpath.substring(0,mainpath.length-3);
	shownav(mainpath,ind);
	document.getElementById(place).src=imfile;
}

function showpice(imfile,place,copyarea,ind){
	document.getElementById(place).src='';
	mainpath=imfile.substring(0,imfile.length-7);
	imfile=mainpath+'L.jpg';
	mainpath=mainpath.substring(0,mainpath.length-3);
	shownav(mainpath,ind);
	document.getElementById(place).src=imfile;
	document.getElementById(copyarea).style.display='none';
	document.getElementById('piccy').style.display='block';
	document.getElementById(place).style.display='block';
}

function hidepic(one,two){
	document.getElementById(one).style.display='block';
	document.getElementById('back').style.display='none';
	document.getElementById('next').style.display='none';
	document.getElementById(two).style.display='none';
	document.getElementById('piccy').style.display='none';
	document.getElementById(two).src='';
}

function hidepice(one,two){
	document.getElementById(one).style.display='block';
	document.getElementById('back').style.display='none';
	document.getElementById('next').style.display='none';
	document.getElementById(two).style.display='none';
	document.getElementById('piccy').style.display='none';
	document.getElementById(two).src='';
}	

function hidestatus(){
window.status=''
return true
}
if (document.layers)
	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

