/*----- key press event handler, which handle enter event to perform action script ----- */
function keyPressHandler(e, elemID, action) {
    var keynum; //key ASCII value
    if (window.event) // IE
    {
        keynum = e.keyCode;
    }
    else if (e.which) // Netscape//Firefox/Opera
    {
        keynum = e.which;
    }
    if (keynum == 13) {
        //----- perform action script -----
        if (action == "click") {
            document.getElementById(elemID).click();
        }
        else {
            eval(action);
        }
        return false; //----- return false (to mark event as handled) -----
    }
    //----- pass on the event if not enter key -----
    return true;
}


/*----- help section ----- */
function helpPopup(url) {
    var wHandler = window.open(url, "_help", "top=50,left=50,width=400,height=300,location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1");
    return wHandler;
}
function popup(url) {
    var wHandler = window.open(url, "_pop", "top=50,left=50,width=600,height=450,location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1");
    return wHandler;
}

/*----- position div tag -----*/
function setCenter(tagName, w) {
    var wWidth = $(window).width();
    var left = (wWidth - w) / 2;

    $(tagName).css({ 'width': w, 'display': 'block', 'background': '#FFFFFF', 'border': '1px solid #AAAAAA', 'position': 'absolute', 'top': '10px', 'left': left, 'z-index': '100' });
    $("#bg").css({ 'display': 'block', 'height' : $(window).height() });
}
jQuery(document).ready(function()
{
	if (jQuery.browser.msie &&
		jQuery.browser.version <= 7)
	{
		var li = jQuery("#top-navigation > ul > li:eq(4) > ul");

		if (li.length > 0)
		{
			li.find(".left").css("width", "300px");
		}
	}
});

