
$(document).ready(function() {

    // CHECK FOR IE6. IF IE6, FIX MENUBAR
    if($.browser.version.substring(0,1) == '6' || $.browser.version.substring(0,1) == '7')
		fixMenu();
    // cracking  
   
    if($.browser.version.substring(0,1) !== '6')  {
        $('#lang_select_dropdown').sSelect({top: true})
    }
    
	//	simple location changes through site drop downs
	$('#news_archive_select_dropdown').change(function () {
			window.location = this.value
			 
		    return false;
            }
        );
	$('#news_cat_select_dropdown').change(function () {
			window.location = this.value
		    return false;
            }
        );
		
    $('#lang_select_dropdown').change(function () {
			
			window.location = this.value + '?referer=' + document.location.href;
		    return false;
            }
        );
			
	$('#change_client_drop_down').change(function () {
			window.location = this.value
		    return false;
            }
        );		
    
    // add listener to service previews
	$('.box').each(function()
	{
		$(this).click(function () 
		{
			var link = $(this).find('.link_arrow').attr("href");
			location.href = link;
		});
    });
			
});




// METHOD TO FIX DROP DOWN MENUS IN IE
function fixMenu(){
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*mbhvr/,nn='',c,cs='mbhvr',bv='menubar';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}
