// JavaScript Document
$(document).ready(function() {	
	/*					   
	$(".brandListBrandItem img").load(function ()
	{
		src=$(this).attr("src");
		alt=$(this).attr("alt");
		//alert(alt);
		$(this).attr("src", alt);
	});
	*/
	$(".brandListBrandItem img").click(
	function () {
		identif = $(this).attr("id");
		path = $(this).attr("class");
		path=path.replace("brandListBrandItem_","");
		changeBrandGuides(path, identif);
	});
	//alert(brandPicturesOff.image8);
	
	$(".brandListBrandItem img").hover(
	function ()
	{
		identif = $(this).attr("id");
		if (identif!=brandPicturesCurrent)
			$(this).attr("src", brandPictures[identif]);
	}, 
	function () {
		identif = $(this).attr("id");
		if (identif!=brandPicturesCurrent)	
			$(this).attr("src", brandPicturesOff[identif]);	
	});

});



function hoverBrand(imageId, src1, src2, changable)
{
	if(changable)
	{
		$("#"+imageId).attr("src", src2);
	}
}
function changeBrandGuides(param, picid)
{
	$(".brandListBrandItem img").each(function(){
       identif = $(this).attr("id");
		$(this).attr("src", brandPicturesOff[identif]);	
    });

	brandPicturesCurrent = picid;
	$("#"+picid).attr("src", brandPictures[picid]);	
	brandLeftMargin=param*125;
	//specialitiesLeftMargin=param*905*(-1);
	$("#brandGuidePointer").animate({ marginLeft:brandLeftMargin},200);
	$(".brandSpecialities").css("z-index","30");
	$(".brand_"+param+"_specialities").css("z-index","35");
	//$("#brandGuideSpecialities").animate({left:specialitiesLeftMargin},1000);
}