/* Top Nav Drop down */
$(document).ready(function() {
    $("#nav>li").mouseover(function(){
        /* exclude the search bar from the hover effects */
        if ( $(this).attr('class') != "searchBar" ) {
            $(this).addClass("over").find(".navbarDropdownWrapper").show();
        }
    }).mouseout(function(){
        $(this).removeClass("over").find(".navbarDropdownWrapper").hide();
    });
});
/* End Top Nav Drop down */

/* International Links */
jQuery.fn.pseudoDropdown = function(){
	
	/* get the dropdown elements */
	var dropdownElements = $(this).find("ul");
	var selectedElement = $(this).find("#selectedCountry");

	/* hide dropdown elements initially */
	dropdownElements.hide();
	
	/* attach onClick event to selected Country */
	$(this).find("#selectedCountry").click(function(){
		dropdownElements.toggle();
		return false;
	});

	
	/* attach onClick to each of dropdownElements */
	dropdownElements.find("li").each(function() {
		$(this).bind("click",function(){
			/* Clicking any of the li should hide the drop down. */
			dropdownElements.hide();
		});
	});
}

/* End International Links */
function OpenBrWindow(theURL,isCenter) 
{
    var windowWidth;
    var windowHeight;  
    var centerWidth;
    var centerHeight;

    if (parseInt(navigator.appVersion)>3)
    {
        if (navigator.appName=="Netscape")
        {
            windowWidth = window.innerWidth-350;
            windowHeight = window.innerHeight-300;
        }
        if (navigator.appName.indexOf("Microsoft")!=-1)
        {
            windowWidth = document.body.offsetWidth-350;
            windowHeight = document.body.offsetHeight-300;
        }
    }
 
    if(window.screen)
    {
        if(isCenter)
        {
            if(isCenter=="true")
            {
                centerWidth = (window.screen.width - windowWidth) / 2;
                centerHeight = ((window.screen.height - windowHeight) / 2) + 300;
            }
            
            window.open(theURL,'InfoCenter',
            "width=" + windowWidth + "," 
            + "height=" + windowHeight + "," + "location=1,"
   		    + "menubar=1,"
    		+ "resizable=1,"
    		+ "scrollbars=1,"
    		+ "statusbar=0,"
    		+ "status=false,"
    		+ "titlebar=1,"
    		+ "toolbar=1,"
    		+ "hotkeys=0,"
    		+ "screenx=" + centerWidth + ","  
    		+ "screeny=" + centerHeight + ","  
    		+ "left=" + centerWidth + ","     
    		+ "top=" + centerHeight ); 
    	}
    }    
}

openPopupWindowHome = function (URL, p_width, p_height) 
{
	day = new Date();
	id = day.getTime();
	LeftPosition = (screen.width-p_width)/2; 
	TopPosition = (screen.height-(p_height+110))/2; 
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width="+p_width+",height="+p_height+",left="+LeftPosition+",top ="+TopPosition+"');");
}
