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_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 MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  	}
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


function homePagePreloadImages() {
	if (document.images) {
		hmpgbtn_howiwork_over = newImage("images/hmpgbtn_howiwork-over.gif");
		hmpgbtn_howiwork_down = newImage("images/hmpgbtn_howiwork-down.gif");
		hmpgbtn_prices_over = newImage("images/hmpgbtn_prices-over.gif");
		hmpgbtn_prices_down = newImage("images/hmpgbtn_prices-down.gif");
		hmpgbtn_gallery_over = newImage("images/hmpgbtn_gallery-over.gif");
		hmpgbtn_gallery_down = newImage("images/hmpgbtn_gallery-down.gif");
		hmpgbtn_session_over = newImage("images/hmpgbtn_session-over.gif");
		hmpgbtn_session_down = newImage("images/hmpgbtn_session-down.gif");
		hmpgbtn_contact_over = newImage("images/hmpgbtn_contact-over.gif");
		hmpgbtn_contact_down = newImage("images/hmpgbtn_contact-down.gif");
		hmpgbtn_testimonials_over = newImage("images/hmpgbtn_testimonials-over.gif");
		hmpgbtn_testimonials_down = newImage("images/hmpgbtn_testimonials-down.gif");
		preloadFlag = true;
	}
}


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_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 loupe(photoNum) {
	var gwViewer = window.open('','','toolbar=no,scrollbars=no,resizable=no,width=520,height=550,innerWidth=520,innerHeight=550,left=480,top=5,screenX=480,screenY=5,status=no,resize=no,dependent=yes');
	gwViewer.focus();
	gwViewer.document.write('<html>');
	gwViewer.document.write('<head>');
	gwViewer.document.write('<title>GW Headshot Viewer: Photo #'+photoNum+'</title>');
	gwViewer.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	gwViewer.document.write('</head>');
	gwViewer.document.write('<body bgcolor="#330000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#7A6666">');
	gwViewer.document.write('<table border="0" width="502" height="530" vspace="0" hspace="0" cellspacing="0" cellpadding="0" align="LEFT">');
	gwViewer.document.write('<tr>');
	gwViewer.document.write('<td align="CENTER" valign="TOP"><img src="http://www.gwheadshots.com/headshots/photos/enlargements/'+photoNum+'.jpg" alt="Photo #'+photoNum+'" title="Photo #'+photoNum+'" vspace="0" hspace="0" border="0" width="502" height="502"></td>');
	gwViewer.document.write('</tr>');
	gwViewer.document.write('<tr>');
	gwViewer.document.write('<td align="CENTER" valign="TOP"><img src="http://www.gwheadshots.com/images/pixel.gif" width="1" height="10" vspace="0" hspace="0" border="0"></td>');
	gwViewer.document.write('</tr>');
	gwViewer.document.write('<tr>');
	gwViewer.document.write('<td align="CENTER" valign="TOP"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="javascript:self.close()" title="Close Headshot Viewer">close</a></font></td>');
	gwViewer.document.write('</tr>');
	gwViewer.document.write('</table>');
	gwViewer.document.write('</body>');
	gwViewer.document.write('</html>');	
}

function oldloupe(photoNum) {
	var gwViewer = window.open('','','toolbar=no,scrollbars=no,resizable=no,width=520,height=550,innerWidth=520,innerHeight=550,left=480,top=5,screenX=480,screenY=5,status=no,resize=no,dependent=yes');
	gwViewer.location.href = "headshots/"+photoNum+".htm";
	gwViewer.focus();
}

function gwMOver(photoNum) {
	var imgName = "hdsht"+photoNum;
	var myStat = window.status;
	MM_changeProp(imgName,'','vspace','0','IMG');
	MM_changeProp(imgName,'','hspace','0','IMG');
	MM_changeProp(imgName,'','border','2','IMG');
	myStat = "Click image—an enlargement will appear in the Headshot Viewer pop-up window";
	return true;
}

function gwMOut(photoNum) {
	var imgName = "hdsht"+photoNum;
	MM_changeProp(imgName,'','border','0','IMG');
	MM_changeProp(imgName,'','hspace','2','IMG');
	MM_changeProp(imgName,'','vspace','2','IMG');
	return true;
}