if (window.EventManager) {
	var event_manager = new EventManager;
}

var startedtyping_search = 0;
var reallyclear_search = 0;

// {{{ sifr_replacement()
function sifr_replacement() {

	if (typeof sIFR == "function") {

		/* To SKIP selective headers from being changed, their className must contain sIFR-skip */

        h1Props = function() {}
		h1Props.sSelector   = "h1";
		h1Props.sFlashSrc     = "/images/flash/frgoth2.swf";
		h1Props.sColor		= '#BB0000';
		h1Props.sBgColor      = "#FFFFFF";
		h1Props.nWidth        = 300;
		h1Props.nHeight       = 1000;
		h1Props.sWmode        = "transparent";

        h2Replace = function() {}
		h2Replace.sSelector     = "h2";
		h2Replace.sFlashSrc     = "/images/flash/frgoth2.swf";
		h2Replace.sColor		= '#BB0000';
		h2Replace.sBgColor      = "#FFFFFF";
		h2Replace.nWidth        = 300;
		h2Replace.nHeight       = 1000;
		h2Replace.sWmode        = "transparent";

        sIFR.replaceElement(named(h1Props));
		sIFR.replaceElement(named(h2Replace));
	
	}

}
// }}}
// {{{ popup_centered()
function popup_centered(url, height, width, scroll, resizable)
{
	var left	= (screen.width - width) / 2;
	var top		= (screen.height - height - 60) / 2;
	var config	=
		'width='+width+',height='+height+',statusbar=0,top='+top+',left='+left;

	if (scroll == true)
	{
		config += ',scrollbars=yes';
	}
	else
	{
		config += ',scrollbars=no';
	}

	if (resizable)
	{
		config += ',resizable=yes';
	}
	else
	{
		config += ',resizable=no';
	}
		
	return window.open(url, '', config);
}
// }}}
// {{{ email_tab_hover()
function email_tab_hover(over) {
	var tab = document.getElementById('main-nav-email-services');
	var menu = document.getElementById('email_menu');

	if (over) {	
		tab._on = true;
		menu.style.display = '';
	} else {
		tab._on = false;
		setTimeout(function() {
			if (!tab._on) {
				menu.style.display = 'none';
			}
		}, 100);
	}
}
function email_menu_hover() {
	var tab = document.getElementById('main-nav-email-services');
	tab._on = true;
}
// }}}
// {{{ customers_tab_hover()
function customers_tab_hover(over) {
	var tab = document.getElementById('main-nav-customers');
	var menu = document.getElementById('customers_menu');

	if (over) {	
		tab._on = true;
		menu.style.display = '';
	} else {
		tab._on = false;
		setTimeout(function() {
			if (!tab._on) {
				menu.style.display = 'none';
			}
		}, 100);
	}
}
function customers_menu_hover() {
	var tab = document.getElementById('main-nav-customers');
	tab._on = true;
}
// }}}
// {{{ why_tab_hover()
function why_tab_hover(over) {
	var tab = document.getElementById('main-nav-promise');
	var menu = document.getElementById('why_menu');

	if (over) {	
		tab._on = true;
		menu.style.display = '';
	} else {
		tab._on = false;
		setTimeout(function() {
			if (!tab._on) {
				menu.style.display = 'none';
			}
		}, 100);
	}
}
function why_menu_hover() {
	var tab = document.getElementById('main-nav-promise');
	tab._on = true;
}
// }}}
// {{{ clearBoxSearch()
    /**
     * * Clears a normal input field.
     * * 
     * * @param inputReference  $thisbox    Input box to clear, used onFocus
     * */
    function clearBoxSearch( thisbox ) {
        if( thisbox.value == thisbox.defaultValue && !startedtyping_search ) {
            thisbox.value = '';
            thisbox.style.color = '#000';
        }
        startedtyping_search = 1;
    }
//  }}} clearBox()
//{{{ checkDefaultSearch() 
    function checkDefaultSearch( thisbox ) {
        if( thisbox.value == thisbox.defaultValue && reallyclear_search == 1 ) {
            thisbox.value = '';
            thisbox.style.color = '#000';
        }
    }
//  }}}
