﻿var total,url,linkurl,pictitle,tempnum;
	function Lightbox(title,current,total,picurl){
	document.getElementById("light").style.display="block"
	document.getElementById("picshow").style.display="block"
	url=picurl+"_"+current
	linkurl=picurl
	pictitle=title
	document.getElementById("picurl").innerHTML="<img src='pic/"+url+".jpg'>"
	document.getElementById("info").innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='0' class=pictxt><tr><td id=pictitle colspan='2' height=20 align=left style='font-size:12px;'></td></tr><tr> <td id=pictotal align=left></td><td align='right'><a href='javascript:void(0)' onclick='callclose()'><img src='pic-img/closelabel.gif' width='49' height='15' border='0' /></a></td></tr></table>"
	document.getElementById("pictitle").innerHTML=title
	if(current==1 && total>1){
	total="image "+current+" of "+total+"&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current+1)+","+total+")' >Next</a>"
	}else if(total>1 && current==total){
	total="image "+current+" of "+total+"&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current-1)+","+total+")' >Prev</a>"
	}else if(total>1 && current!=1 && current!=total){
	total="image "+current+" of "+total+"&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current-1)+","+total+")' >Prev</a>&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current+1)+","+total+")' >Next</a>"
	}
	document.getElementById("pictotal").innerHTML=total;
	}
	function callclose(){
	document.getElementById("light").style.display="none"
	document.getElementById("picshow").style.display="none"
	}
	function lightboxn(current,total){
	url=linkurl+"_"+current
	document.getElementById("picurl").innerHTML="<img src='pic/"+url+".jpg'>"
	document.getElementById("info").innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='0' class=pictxt><tr><td id=pictitle colspan='2' height=20 align=left style='font-size:12px;'></td></tr><tr> <td id=pictotal align=left></td><td align='right'><a href='javascript:void(0)' onclick='callclose()'><img src='pic-img/closelabel.gif' width='49' height='15' border='0' /></a></td></tr></table>"
	document.getElementById("pictitle").innerHTML=pictitle
	if(current==1 && total>1){
	total="image "+current+" of "+total+"&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current+1)+","+total+")' >Next</a>"
	}else if(total>1 && current==total){
	total="image "+current+" of "+total+"&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current-1)+","+total+")' >Prev</a>"
	}else if(total>1 && current!=1 && current!=total){
	total="image "+current+" of "+total+"&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current-1)+","+total+")' >Prev</a>&nbsp;&nbsp;<a href='javascript:void(0)' onclick='javascript:lightboxn("+(current+1)+","+total+")' >Next</a>"
	}
	document.getElementById("pictotal").innerHTML=total;
	}
	
	function callpage(page){
        mainframe.document.items.numshow.value=page
		mainframe.showlan();
		}