
$(document).ready(function(){
	
	
	/* Font rewriting */
	Cufon.replace('#right_frame label', { fontFamily: 'Helvetica Neue LT Std' });
	Cufon.replace('.RHS_menu .title h2', { fontFamily: 'Sharpy',fontSize:"26px" });
	Cufon.replace('.RHS_menu .links a', { fontFamily: 'Sharpy',fontSize:"30px" });
	Cufon.replace('.subTheme .links a', { fontFamily: 'Sharpy',fontSize:"16px" });
	Cufon.replace('.RHS_menu td div', { fontFamily: 'Mayfield',fontSize:"22px" });
	Cufon.replace('#left_frame h1', { fontFamily: 'Sharpy',fontSize:"34px" });
	Cufon.replace('#left_frame .at_a_glance a', { fontFamily: 'Sharpy',fontSize:"20px" });
	Cufon.replace('#TRHSC .values_spotlight', { fontFamily: 'Sharpy',fontSize:"20px" });
	Cufon.replace('#bottom #BLHSC a.view_full_size', { fontFamily: 'Sharpy',fontSize:"20px" });
	Cufon.replace('#BRHSC h2', { fontFamily: 'Mayfield',fontSize:"18px" });
	//Cufon.replace('#globalPopup .menu h1', { fontFamily: 'Sharpy' });
	
	
	/* Preload images */
	preloadImages();
	$.preloadCssImages();
	
	/* Bind resize window event listenner */
	if (typeof window.addEventListener != 'undefined')
	{
		window.addEventListener("resize", fnResize, false);
	}
	else if (typeof document.addEventListener != 'undefined')
	{
		document.addEventListener("resize", fnResize, false);
	}
	else if (typeof window.attachEvent != 'undefined')
	{
		window.attachEvent("onresize", fnResize);
	}
	
	/* Init hover on Right hand side menu */
	$("#right_frame .RHS_menu tr.links").addClass("pointer");
	$("#right_frame .RHS_menu tr.links").hover(function(){
			$("td",this).addClass("hover");  
		},
		function(){
			$("td",this).removeClass("hover");  
		}
	);
	/* Init click on Right hand side menu */
	$("#right_frame .RHS_menu tr.links").click(function(){
		
		/* Exlude global popup */
		if (!$(this).hasClass("global_popup")){
			location.href = $("a",this).attr("href");			
		}
	});
	
	/* Disable right click */ /* todo: return false */
	$(document).bind("contextmenu",function(e){
		return true;
	});

	if (/WebKit/i.test(navigator.userAgent)) { 

		/* Init resizing */
		activePrint();
		fnResize();
		initLinks();
    
		$("html").animate( {'opacity':1}, 1000 ); 
	} else { 
		$(window).load(function(){
			/* Init resizing */
			activePrint();
			fnResize();
			initLinks();
			
			
			if (!jQuery.browser.msie) {
				$("html").animate( {'opacity':1}, 1000 ); 	
			} else {
				$("body").css( "visibility", "visible" ); 	
			}
			
			$("a#acknowledgement").click( function(){
				
				var newWin =  window.open('/acknowledgements.htm','newWindow', 'height=450,width=450,scrollbars=yes, status=no, resizable=yes, location=no, toolbar=no,directories=no, menubar=no,filemenu=0');						
				newWin.focus();
				return false;
												   
			});
			$("#access_key_info a").click( function(){
				
				var newWin =  window.open('/access_key_info.htm','newWindow', 'height=450,width=450,scrollbars=yes, status=no, resizable=yes, location=no, toolbar=no,directories=no, menubar=no,filemenu=0');					
				newWin.focus();	
				
				return false;
												   
			});
			
								
		});
	} 
	
	
 });
