/*	<script src="include/PopPic.js" type="text/javascript" language="javascript1.2"></script>*/


var winPhotoRef = null;

function PopPic(img){
	//if the poppic window is open, close it
	if (winPhotoRef != null) {
		winPhotoRef.close();
	}

	photo1= new Image();
	photo1.src=(img);
	Controller(img);
}

function Controller(img){
	//MAKE SURE WE HAVE A WIDTH AND HEIGHT BEFORE DISPLAYING IMAGE
	if((photo1.width!=0)&&(photo1.height!=0)){
		viewPhoto(img);
	/*} else{
		sJava="Controller('"+img+"')";
		interval=setTimeout(sJava,20);*/
	}
}

function viewPhoto(img){
	pwidth=photo1.width;
	pheight=photo1.height;
	windowprops="width="+pwidth+",height="+pheight;
	winPhotoRef=window.open("PopPhoto.asp?Photo="+img,"PopPhoto",windowprops);
}

