/* * * * * * * * * * * * * * * * * * * * *
 * Custom Built Calendars
 * Javascript
 *
 * * * * * * * * * * * * * * * * * * * * */


/**
 * sfHover
 */
sfHover = function() {
	if( document.getElementById("nav") ) {
		var sfEls = document.getElementById("nav").getElementsByTagName("div");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



/**
 * Function to Launch the Wizard in a new popup window.
 *
 * Params:	{string} url		- the url to load in the newly opened window.
 *
 */
function launchWizard (url) {
	var win = null;
	var settings;
	var top,
		left,
		w = 1024, //set this higher to eliminate horizontal scrolling in IE6.
		h = 800;
	
	// Centre the window if we can,
	// otherwise open in the top left corner of screen.
	(screen.height) ? top = (screen.height - h)/2 : 0;
	(screen.width) ? left = (screen.width - w)/2 : 0;
	
	settings =	'height=' + h + ',' +
				'width=' + w + ',' +
				'top=' + top + ',' +
				'left=' + left +',' +
				'scrollbars=' + 'yes' + ',' +
				'location=' + 'no' + ',' +
				'resizable=' + 'yes' + ',';
	win = window.open(baseHref(url),'WIZARD',settings);
	if (win) win.focus();
}
