// JavaScript Document
var isIE6 = false;
$(document).ready(function(){	
	if (jQuery.browser.msie && $.browser.version == "6.0"){
		isIE6 = true;
	}
	$(".menu_header a").each(function(){
		var sMenuID = $(this).attr("id");								  
		$(this).hover(					  
			function(){	
				if (isIE6){	
						var sIDSelected = "";
						$('.cl_img_menu_header_hover').each(function(){
							if (!$(this).hasClass("menu_news_selected")){
								$(this).hide();
							}
							else{
								sIDSelected = $(this).attr("id").replace("_hover","");
							}
						});
						$('.cl_img_menu_header').each(function(){
							if (sIDSelected != $(this).attr("id")){
								$(this).show();
							}
						});
						if (sIDSelected != 'img_' + sMenuID){											
							$('#img_' + sMenuID).hide();
							$('#img_' + sMenuID + '_hover').show();
						}
				}
				else{
					$(this).find("img").attr("src","images/news/menu_" + sMenuID + "_hover.png");	
				}
			},	
			function(){
				if (isIE6){		
					var sIDSelected = "";
					$('.cl_img_menu_header_hover').each(function(){
						if (!$(this).hasClass("menu_news_selected")){
							$(this).hide();
						}
						else{
							sIDSelected = $(this).attr("id").replace("_hover","");
						}
					});
					$('.cl_img_menu_header').each(function(){
						if (sIDSelected != $(this).attr("id")){
							$(this).show();
						}
					});
					if (sIDSelected != 'img_' + sMenuID){
						$('#img_' + sMenuID + '_hover').hide();
						$('#img_' + sMenuID).show();
					}
				}
				else{
					if (!$(this).find("img").hasClass("menu_news_selected"))
						$(this).find("img").attr("src","images/news/menu_" + sMenuID + ".png");
				}
			}
		);						  		
	});
	var bIsOver = false;
	$(".list_news_image a").each(function(){	
		var imgProduct = $(this).find("img");
		$(this).hover(
			function(){
				bIsOver = true;
				 imgProduct.animate({	
					opacity: 1			 
				  }, 400, function() {
					   
				  });
				
			},
			function(){
				bIsOver = false;
				imgProduct.animate({	
					opacity: 0			 
				}, 400, function() {
				
				});
			}
		);
	});
	var checkBannerTop = function(){
		if (bIsOver == false){
			$(".img_banner_top a").each(function(){	
				var imgProduct = $(this).find("img");								 
				imgProduct.css("opacity",0);
			});
		}
		setTimeout(checkBannerTop,2000);
	}
	setTimeout(checkBannerTop,2000);		
});
