/***
 * Javascript code to support http://www.henningsen.com
 * Last updated: 09 December, 2008
 * Coded by: Murdoch Marketing
 * Contact Info:
 *      E-mail tom@murdochmarketing.com
 *      Phone 616-392-4893
 ***/


var IE = /*@cc_on!@*/false;
var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var IE7 = false /*@cc_on || @_jscript_version >= 5.7 @*/;
window.onload = onLoad;


if(IE6)
    attachMenuEvents();
adjustHeights();


/*Start onLoad*/
function onLoad(){
	initPopup();
}
/*End onLoad*/


/*Start adjustHeights*/
function adjustHeights(){
	var leftContent = document.getElementById('left-content');
	var mainContent = document.getElementById('main-content');
	var rightContent = document.getElementById('right-content');
	var rightContentInner = document.getElementById('right-content-inner');
	
	if(mainContent == null || rightContent == null || rightContentInner == null)
		return;
    
	var maxHeight = Math.max(rightContentInner.offsetHeight, mainContent.offsetHeight);
	
	if(leftContent != null)
        maxHeight = Math.max(maxHeight, leftContent.offsetHeight);
	
	rightContent.style.height = (maxHeight) + 'px';
	
	setTimeout('adjustHeights()', 0);
}
/*End adjustHeights*/



/*Start attachMenuEvents*/
function attachMenuEvents(){
    var menu = document.getElementById('menu');
    var LIs = menu.getElementsByTagName('li');
    for(var i = 0; i < LIs.length; i++){
        LIs[i].onmouseover = function() {
                this.className = this.className.indexOf('hover') == -1 ? this.className + ' hover' : this.className;
            };
        LIs[i].onmouseout = function() {
                this.className = this.className.indexOf('hover') != -1 ? this.className.replace('hover', '') : this.className;
            };
    }
}
/*End attachMenuEvents*/



/*Start show*/
function show(elementId){
    var element = document.getElementById(elementId);
	element.style.display = 'block';
	element.style.visibility = 'visible';
}
/*End show*/



/*Start hide*/
function hide(elementId){
    var element = document.getElementById(elementId);
	element.style.display = 'none';
	element.style.visibility = 'hidden';
}
/*End hide*/



/*Start popup*/
function popup(mylink, windowname){
	if (! window.focus)
		return true;
	
	var href;
	
	if (typeof(mylink) == 'string')
		href=mylink;
	else
		href=mylink.href;

	window.open(href, windowname, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=1, height=1, top=0, left=0');
	
	return false;
}
/*End popup*/


/*Start initPopup*/
function initPopup(){
	var wrapper = document.getElementById('popup-wrapper');
	
	if(wrapper == null)
		return;
	
	var width = wrapper.offsetWidth + 100;
	var height = wrapper.offsetHeight + 100;
	
	resizeTo(width, height);
	
	//Center screen
	var left = Math.abs(screen.width - width) / 2;
	var top = Math.abs(screen.height - height) / 2;
	
	moveTo(left,0);
}
/*End initPopup*/


/*Start printPage*/
function printPage(){
    window.print();
    return false;
}
/*End printPage*/

