var it=0;

var toptentext="@1.&nbsp;&nbsp;&nbsp;<a href='alt_Adrienne_Klass.htm'>Adrienne Klass</a><br>2.&nbsp;&nbsp;&nbsp;<a href='alt_Adele_Stephens.htm'>Adele Stephens</a><br>3.&nbsp;&nbsp;&nbsp;<a href='alt_Agnes.htm'>Agnes</a><br>4.&nbsp;&nbsp;&nbsp;<a href='alt_Alena.htm'>Alena</a><br>5.&nbsp;&nbsp;&nbsp;<a href='alt_Alissa.htm'>Alissa</a><br>6.&nbsp;&nbsp;&nbsp;<a href='alt_Allison.htm'>Allison</a><br>7.&nbsp;&nbsp;&nbsp;<a href='alt_Alma.htm'>Alma</a><br>8.&nbsp;&nbsp;&nbsp;<a href='alt_Amanda.htm'>Amanda</a><br>9.&nbsp;&nbsp;&nbsp;<a href='alt_Anastasia_Christ.htm'>Anastasia Christ</a><br>10.&nbsp;<a href='alt_Angie_Scott.htm'>Angie Scott</a><br>@";

function maketext(oBj1,oBj2,oBj3){
	document.getElementById(oBj2).innerText=document.getElementById(oBj1).value;
	document.getElementById(oBj1).style.display='none';
	document.getElementById(oBj3).style.display='none';
}

function maketitle(oBj1,oBj2,oBj3,oBj4){
	document.getElementById(oBj2).innerText=document.getElementById(oBj1).value;
	document.getElementById(oBj1).style.display='none';
	document.getElementById(oBj3).style.display='none';
	document.getElementById(oBj4).alt='Click for larger image of '+document.getElementById(oBj1).value;
}

function topten()
{	
	toptentext=toptentext.substring(1,toptentext.length-1);
	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';
		}
	}
}

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){  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;
	if(!getCookie(name)){
		document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString()));
		entryform('pages/reroute.php',name);
		}
		else{
			alert("You have already voted for...\r\n\r\n"+name+"\r\n\r\n...try again tomorrow");
			}
}

function entry(target){
	trans1.action=target;
	trans1.submit();
}

function entryform(name,target){
	trans.action=target;
	trans.folder.value=name;
	trans.submit();
}

function getimages(file,dest){
	trans.action=dest;
	trans.folder.value=file;
	trans.submit();
}

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 layest(urlparam)
{
	if(urlparam)
	{
		document.getElementById(urlparam).style.display='block';
		oldlay=urlparam;
	}
}	