//scripts for for displaying larger version of thumbs in pop-up windows


floater=null; //initialize floater window

//hides floater window and focuses main window
function hideFloater() {
	if(floater!=null&&!floater.closed){
		floater.blur();
		window.focus();
	}
}

//-- This function opens the new, empty window named floater.
function openPictureWindow(width, height, index) {
	   winStats='toolbar=no,location=no,directories=no,menubar=no,'
	   winStats+='scrollbars=no,width='+width+',height='+height
   
   if(index==0||index==1) x=screen.width/2;
   else x=0;

   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left='+x+',top=50'
    }else{
      winStats+=',screenX='+x+',screenY=50'
    }
   floater=window.open("","",winStats)  
}

//calls openPictureWindow and writes large version of thumb to window
function writePictureWindow(picture, width, height, index) {
   if(floater!=null && !floater.closed){ 
	floater.close();
   }
   openPictureWindow(width, height, index);
   floater.document.open()
   floater.document.writeln ("<HTML>")
   floater.document.writeln ("<HEAD>")
   floater.document.writeln ("<SCRIPT LANGUAGE='javascript'>function hideFloater() {window.blur();} </SCRIPT>")
   floater.document.writeln ("</HEAD>")
   floater.document.writeln ("<body LEFTMARGIN='0' TOPMARGIN='0' MARGINWIDTH='0' MARGINHEIGHT='0' >")
   floater.document.writeln ("<h1><center><a href='javascript:hideFloater();' onMouseOut='hideFloater();'><IMG SRC='" + picture + "' border=0></a></center></h1>")
   floater.document.writeln ("</body>")
   floater.document.writeln ("</HTML>")
   floater.document.close()
   floater.focus()
}


//onUnload="unloadfloater();"
function unloadfloater(){
	if(floater!=null) {
		floater.close();
	}
}


// "pops up" image
function showlarge_portfolio(index)
{
  img=pics_array[index].src;
//alert(img);
  writePictureWindow(img, widths[index], heights[index],index);
}