function putFocus(formInst, elementInst) { //
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
}

function fObj(n, d) { //
  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=fObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function fullA2(img, id) { //full size portfolio popup window
	popupWin = window.open('viewer.asp?x='+img+'&b=y&id='+id, 'viewer', 'maximize=0,toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width=60,height=90,screenX=80,screenY=40,left=80,top=40')
}


function getH(id) {
	var imgHeight = document.getElementById(id).height;	
	var imgWidth = document.getElementById(id).width;	
	if (imgWidth > imgHeight){
		return 'LAND';
	}
	else {
		return 'PORT';
	}
}
function resizeWindow() {
	if ((getH('photo') == 'PORT')) {
	  window.resizeTo(580,930);
	}
	else {
	  window.resizeTo(770,725);
	}
}	
function show(id) {
	document.getElementById(id).style.display = "block";
}
function hide(id) {
	document.getElementById(id).style.display = "none";
}
