function ShowWindow(thisa,table,closeurl,wx,hx,id){
	var w=wx+83;
	var hdiv = document.getElementById("popup");
	hdiv.style.width=w+"px";
	vvvv=document.getElementById("popupContent");
	vvvv.style.height=18+"px";
	vvvv.style.width=wx+"px";
	vvvv.innerHTML='<img id="preloader" src="graphics/preloader.gif" alt="Loading Image"  />&nbsp;Loading...';
	var darkdiv = document.getElementById("darkover");
	
	var navdiv = document.getElementById("navigator");
	navdiv.style.display="block";
	hdiv.style.marginLeft=-w/2+'px';
	darkdiv.style.display='block';
	hdiv.style.display='block';
	closediv = document.getElementById("close");
	closediv.style.display='block';
	closelink=closediv.getElementsByTagName('a')[0];
	closelink.href=closeurl;
	
	newsContainer=document.getElementById("thumbContainer");
	newslinks=newsContainer.getElementsByTagName("a");
	
	for(index=0;index<newslinks.length;index++){
		if(newslinks[index]==thisa){
			currentArrayIndex=index;
		}
	}
	
	var navdiv = document.getElementById("navigator");
	var navigation = navdiv.getElementsByTagName('a');
	
	var currentarray=idarray[currentArrayIndex];
	for(var m=0;m<(currentarray.length-1); m++){
		if(currentarray[m][0]==id){
			currentIndex=m;
		}
	}
	prevIndex=currentIndex-1;
	nextIndex=currentIndex+1;
	if(currentIndex==1){
		prevIndex=currentIndex;
	}
	if(currentIndex==(currentarray.length-1)){
		nextIndex=currentIndex;
	}
	navigation[0].name=currentarray[Number(prevIndex)][0];
	navigation[0].className=table;
	navigation[0].index=prevIndex;
	navigation[0].id=currentarray[Number(prevIndex)][1]+'.jpg';
	navigation[0].rel=currentArrayIndex;
	
	navigation[1].name=currentarray[Number(nextIndex)][0];
	navigation[1].className=table;
	navigation[1].index=nextIndex;
	navigation[1].id=currentarray[Number(nextIndex)][1]+'.jpg';
	navigation[1].rel=currentArrayIndex;
	
	showUser(id, table);
	urllink=thisa.getElementsByTagName("img")[0].src;
	iniH=18;
	heightt=hx;
	imgObjects = new Image();
	imgObjects.src = urllink;
	
	animation(urllink);
	getCovers(id, table);
}
function getStatus(id){
	xmlHttpC=GetXmlHttpObject()
	if (xmlHttpC.readyState==4 || xmlHttpC.readyState=="complete"){getCovers(id)}
}
function animation(urllink){
	vvvv.innerHTML='';
	if((heightt-iniH)>30){
		difY=(heightt-iniH)/8;
		iniH+=difY;
		vvvv.style.height=iniH+"px";
		setTimeout(function(){animation(urllink)}, 50);
	}else{
		vvvv.style.height=heightt+"px";
		resultPic="<img src="+urllink+" />";
		vvvv.innerHTML=resultPic;
	}
}
function HideWindow(){
	var hdiv = document.getElementById("popup");
	var darkdiv = document.getElementById("darkover");
	var navdiv = document.getElementById("navigator");
	hdiv.style.display='none';
	darkdiv.style.display='none';
	closediv.style.display='none';
	navdiv.style.display='none';
	document.getElementById("info").style.display='none';
	document.getElementById("popupThumbs").innerHTML="";
}

function showUser(str, table){
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="inc/getinfo1.inc.php"
	url=url+"?q="+str
	url=url+"&table="+table
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function getCovers(covid, table){ 
	xmlHttpC=GetXmlHttpObject()
	if (xmlHttpC==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="inc/getcover1.inc.php"
	url=url+"?c="+covid
	url=url+"&table="+table
	url=url+"&sid="+Math.random()
	xmlHttpC.onreadystatechange=stateChangedCover 
	xmlHttpC.open("GET",url,true)
	xmlHttpC.send(null)
}
function Nextthumb(thumbsrc,newH,newW,table,id){
	vvvv=document.getElementById("popupContent");
	smallD=document.getElementById("smallthumbs");
	allimgs=smallD.getElementsByTagName("img");
	for(var imgs=0; imgs<allimgs.length; imgs++){
		allimgs[imgs].style.border="solid 3px #000000";
	}
	selimg=document.getElementById(id);
	selimg.style.border="solid 3px #37584F";
	var resultPic="<img src="+thumbsrc+" />";
	var hdiv = document.getElementById("popup");
	hdiv.style.width=newW+83+"px";
	hdiv.style.marginLeft=-(newW+83)/2+'px';
	vvvv.style.width=newW+"px";
	vvvv.style.height=newH+"px";
	vvvv.innerHTML=resultPic;
	showUser(id,table);
}
function stateChangedCover(){
	if (xmlHttpC.readyState==4 || xmlHttpC.readyState=="complete"){
		document.getElementById("popupThumbs").innerHTML=xmlHttpC.responseText;
		
	} 
}
function stateChanged(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("info").innerHTML=xmlHttp.responseText;
		document.getElementById("info").style.display='block';
	} 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}