function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

	browser = navigator.appName;
	browserNum = parseInt(navigator.appVersion);
	if ((browser == "Netscape") && (browserNum < 5)){
		// Netscape 4.x
		layerRef = "document.layers['";
		endLayerRef = "']";
		styleRef = "";
	}

	else if ((browser == "Netscape") && (browserNum >= 5)){
		// Netscape 6
		layerRef = "document.getElementById('";
		styleRef = ".style";
		endLayerRef = "')";
	}

	else{
		// Internet Explorer
		layerRef = "document.all['";
		endLayerRef = "']";
		styleRef = ".style";
	}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function openImgWin(image,ext,width,height) {
var width,height
var image,ext
var cond1,cond2
if (width==0) cond1=" "
	else cond1="width="+(width+20)+"";
if (height==0) cond2=" "
	else {cond2="height="+(height+80)+"";
	}
var s1 ="<html><head><title>Stoneham Studios</title><style> *html{margin:0;}</style></head>"
var s15="<body style='background-color:#000;'>"
var s16="<p style='font:bold .8em Verdana, Arial, Helvetica, sans-serif;color:#fff;padding-left:.3em;'>"+ext+"</p>"
var s2 ="<center><img src='"+image+"' border=0>"
var s3 ="<br /><input style='margin-top:1em;' name='button' type='button' onclick='javascript:self.close();' value='Close Window' />"
var s4 ="</form></center></body></html>"

ImageWindow=window.open("", "newwin"+width,"toolbar=no,scrollbars="+scroll+",menubar=no,"+cond1+","+cond2);
ImageWindow.document.write(s1+s15+s16+s2+s3+s4)
ImageWindow.document.close()
}

function lgImg(pFileName,w,h) {
var pTitle="Stoneham Samples"
var winw = (w + 20);
var winh = (h + 20);
var winprops = 'height='+winh+',width='+winw+',screenX=10,screenY=10,left=10,top=10,scrollbars=yes,resizable'
var imgWin = window.open( "","imgWin",winprops);
// if window already open, close it for proper resizing
if (imgWin && !imgWin.closed){
   imgWin.close()
	}
// spawn the window with proper dimensions
var imgWin = window.open( "","imgWin",winprops);
  imgWin.document.write('<html><head><title>' + pTitle + '</title></head>');	
  imgWin.document.write('<BODY BGCOLOR=#000000 text=#cccccc style=\'margin:0\'>');
  imgWin.document.write('<center>');
  imgWin.document.write('<img src=\"'+ pFileName+'\">');   
   	
  //imgWin.document.write( '"' + pTitle + '"');
  imgWin.document.write('</body></html>');
  imgWin.document.close();	
//  bring the window to the front
imgWin.focus();
}

oldLayer="none";
//This function requires the MM_reloadPage functions above//
function showLayer(layerName){
	// show the layer 
	eval(layerRef + layerName + endLayerRef + styleRef + ".visibility = 'visible'");
	// hide other window
	if (oldLayer != "none"){
	eval(layerRef + oldLayer + endLayerRef + styleRef + ".visibility = 'hidden'");
	}	
	if (oldLayer == layerName){
	oldLayer = "none";
	}
	else{
	oldLayer = layerName;
	}			
}