// Hawthorne House General JS
// Author: Aarron Walter,  aarron@aarronwalter.com

// Detect Monitor Resolution and Open Popup Win To Scale In Center of Screen
function scaleWin(url,winName){
	
	if( screen.width > 800 ){ // > 800 x 600
		screenwidth = 900;
		screenheight = 600;
	}else{ // <= 800 x 600 
		screenwidth = (screen.width - 50);
		screenheight = (screen.height - 70);
	}	
		
	// Calculate Horizontal Postion of Window
	hPos = (screen.width/2) - (screenwidth/2);
	//alert(url+ winName+ "width=" + screenwidth + ", height=" + screenheight + ",scrollbars=yes,resizable=yes")
	theWin = window.open(url, 'detail', "width=" + screenwidth + ", height=" + screenheight + ",scrollbars=yes,resizable=yes");
	theWin.moveTo(hPos,0);
}

/* Search Stuff */
function focusSearch(field){
	if(document.getElementById(field).value == 'search inventory'){ document.getElementById(field).value = ''; }
}

function blurSearch(field){
	if(document.getElementById(field).value == ''){ document.getElementById(field).value = 'search inventory'; }
}