/*******************************************************************************
	OBJECT: script-styles.js
	DESCRIPTION: script to delay load of Uniform UI elements until all contained
	content/elements have loaded; prevent patchwork page load.
	DEVELPER: Jeff Pass
	DATE: 03/2009
	ATTRIBUTES: 
	RETURN:	
********************************************************************************/

(function () {
	var head = document.getElementsByTagName("head")[0];
	if (head) {
		var scriptStyles = document.createElement("link");
		scriptStyles.rel = "stylesheet";
		scriptStyles.type = "text/css";
		scriptStyles.href = "/includes/css/script-styles.css";
		head.appendChild(scriptStyles);
	}
}());


/* common functions shared across app */

function popupOpen(url, wname, width, height) {
	w1=window.open (url, wname, findCenter(width, height) + ',,toolbar=0,menubar=0,scrollbars=1,resizable=1,location=0,directories=0,status=0,addressbar=0,navigation=0,personalbar=no');     
	w1.focus();	
}

function findCenter(width, height) 
{ 
   var str = "height=" + height + ",innerHeight=" + height; 
   str += ",width=" + width + ",innerWidth=" + width; 
   if (window.screen) { 				
		   var ah = screen.availHeight - 30; 
		   var aw = screen.availWidth - 10; 
		   var xc = (aw - width) / 2; 
		   var yc = (ah - height) / 2; 
		   str += ",left=" + xc + ",screenX=" + xc; 
		   str += ",top=" + yc + ",screenY=" + yc; 
   } 
   return str; 
}