{ 
    var frm;
    ns = (document.layers)? true:false;
    ie4 = (document.all)? true:false;
    ie5 = false;
    if (ie4) ie5 = (navigator.userAgent.indexOf('MSIE 5')>0); 
	mac = ( navigator.platform.substring(0,3).toUpperCase() == "MAC" && (ie4 || ie5) );
}

	function popfotl(sPath,sName){
 	    var pl=(screen.width)/2-320;
	    var pt=(screen.height)/2-240;
     	    txt = "<table class='Options' border='0' cellspacing='0' cellpadding='2'>"
	    txt+= "<tr><td class='WTitle'>&nbsp;Foto</td><td class='WTitle' align='right'><a href='JavaScript:hideit()'>x</a></tr>"
  	    txt+= "<tr><td colspan='2' class='txt' bgcolor='#FFFFFF' align='center' valign='middle'>"
	    txt+= "<a href=\"JavaScript:zoomfoto('"+sPath+"','"+sName+"')\"><img src='images/"+sPath+sName+".jpg' border='0' width='320' height='240'></a></td></tr></table>"
       	    write_txt(txt);
     	    display_it(pl,pt);
	}

	function popfotp(sPath,sName){
	    var pt=(screen.height)/2-320;
	    var pl=(screen.width)/2-240;
	    txt = "<table class='Options' border='0' cellspacing='0' cellpadding='2'>"
	    txt+= "<tr><td class='WTitle'>&nbsp;Foto</td><td class='WTitle' align='right'><a href='JavaScript:hideit()'>x</a></tr>"
	    txt+= "<tr><td colspan='2' class='txt' bgcolor='#FFFFFF' align='center' valign='middle'>"
            txt+= "<a href=\"JavaScript:zoomport('"+sPath+"','"+sName+"')\"><img src='images/"+sPath+sName+".jpg' border='0' width='240' height='320'></a></td></tr></table>"
            write_txt(txt);
            display_it(pl,pt);
	}
	function zoomfoto(sPath,sName){
	  var pl=(screen.width);
	  var pt=(screen.height);
	  sName=sName.replace(/k/,'g');
	  
	  if (pl>=800 && pt>=600) 
	  	  {
	  	  pl=(pl-800)/2;
	  	  pt=(pt-600)/2;
		  frm=window.open('images/'+sPath+'n_zoom.htm',sName,'status=no,scrollbars=no,toolbar=no,height=600,width=800,left='+pl+',top='+pt);
		  }			  	
	  else	
		  frm=window.open('images/'+sPath+'n_zoom.htm',sName,'status=no,scrollbars=no,toolbar=no,height=pt,width=pl,left=0,top=0,scrollbars');
 	}
	function zoomport(sPath,sName){
	  var pl=(screen.width);
	  var pt=(screen.height);
	  sName=sName.replace(/k/,'g');
	  
	  if (pt>=800 && pl>=600) 
	  	  {
	  	  pt=(pt-800)/2;
	  	  pl=(pl-600)/2;
		  frm=window.open('images/'+sPath+'n_zoom.htm',sName,'status=no,scrollbars=no,toolbar=no,height=800,width=600,left='+pl+',top='+pt);
		  }			  	
	  else	
		  frm=window.open('images/'+sPath+'n_zoom.htm',sName,'status=no,scrollbars=no,toolbar=no,height=screen.height,width=screen.width,left=0,top=0,scrollbars');
 	}
	function popup(nItem,x,y) {
		if (mac) {return;}
		write_popup(text[nItem],title[nItem],x,y);
    }
    function write_popup(sText, sTitle, x,y) {
    	txt = "<table class='Options' border='0' cellspacing='0' cellpadding='2'>"
	    txt+= "<tr><td class='WTitle'>&nbsp;" + sTitle + "</td><td class='WTitle' align='right'><a href='JavaScript:hideit()'>x</a></tr>"
		txt+= "<tr><td colspan='2' class='txt' bgcolor='#FFFFFF' align='center' valign='middle'>" + sText +"</td></tr></table>"
       	write_txt(txt);
    	display_it(x,y);
    }
    function display_it(x,y) {
    	if ( (ns) || (ie4) ) {
   			moveTo(over,x,y);
   			show(over);
   			nShowit = 1;
    	}
    }
    function moveTo(obj,nx,ny) {
    	obj.left = nx
    	obj.top = ny
    }
    function write_txt(txt) {
    	if (ns) {
    		var lyrPop = document.popDiv.document
    		lyrPop.write(txt)
    		lyrPop.close()
    	} else {
    		if (ie4) document.all["popDiv"].innerHTML = txt
    	}
    }
    function show(obj) {
    	if (ns) obj.visibility = "show"
    	else if (ie4) obj.visibility = "visible"
   }
    function hide(obj) {
    	if (ns) obj.visibility = "hide"
    	else if (ie4) obj.visibility = "hidden"
    }
    function hideit() {
    	if (mac) {return;}
	if ( (ns) || (ie4) )  {
   		nShowit = 0;
    		hide(over);
    	}
    }    