﻿// JScript File

$(document).ready(function(){ 
						   
						   
	$('body').supersleight();


		//////////////////////////////////////////////////
		//  handle topmenu
		//////////////////////////////////////////////////
		timer_submenu = 0;
		$('.topmenu').mouseover(function(e){	
				e.preventDefault();
				clearTimeout( timer_submenu);
				$('.submenu').hide();
				var submenu =$(this).attr('submenu');
			if(submenu != ''){
				
				var container_pos = $('#right_content_container').offset(); 
				var container_left = container_pos.left;
				
				var submenu_pos = $(this).offset();  
				var submenu_left = submenu_pos.left;
				var submenu_top = 106;
				var target_left = submenu_left-container_left;
				var target_top = submenu_top;
	
				

	
			
				$('#'+submenu).css( { "left": (target_left) + "px" } );
				$('#'+submenu).css( { "top": (target_top) + "px" } );
				$('#'+submenu).fadeIn('normal');
			}
				
		});	
		$('.submenu').mouseout(function(e){	
				e.preventDefault();
				var thisid = this.id;
				clearTimeout( timer_submenu);
				timer_submenu = setTimeout(function() { 
                                   $('#'+thisid).fadeOut('normal');
                                  }, 1500);

				
		});	
		//////////////////////////////////////////////////
		//  handle left menu search
		//////////////////////////////////////////////////
		$('#leftmenu10').click(function(e){	
	   			e.preventDefault();
				var leftmenu_search_pos = $(this).offset();  
				//var leftmenu_search_width = $(this).width();
				var leftmenu_search_left = leftmenu_search_pos.left;
				var leftmenu_search_top = 465;
				var target_left = leftmenu_search_left;
				var target_top = leftmenu_search_top;
	
			
				$('#search_panel').css( { "left": (target_left) + "px" } );
				$('#search_panel').css( { "top": (target_top) + "px" } );
				
				
				$('#search_panel').fadeIn('normal');
		});
		
		
		
		$('#btn_search_close').click(function(e){	
	   			e.preventDefault();
				$('#search_panel').fadeOut('normal');
		});
		
		//////////////////////////////////////////////////
		
		
	
		
}); 

$(function(){
	if ($.browser.msie && $.browser.version == '6.0'){
		$('#nav a').hover(
			function(){
				if ($(this).parent().hasClass('act')){
					return;
				}
				var bpx = $(this).css('background-position-x');
				$(this).css('background-position-x', '-180px').data('bpx', bpx);
			},
			function(){
				if ($(this).parent().hasClass('act')){
					return;
				}
				var bpx = $(this).data('bpx');
				$(this).css('background-position-x', bpx);
			}
		);
	}
});



