this.fadeLinksMenu = function() {	
	
	jQuery.noConflict();
	
	var selector = "#right > .moduletable > ul.menu > li > a"; //modify this line to set the selectors
	var speedOver = "normal"; // adjust the fading speed ("slow", "normal", "fast")
	var speedOut = "normal";
	var bgcolor = "transparent"; 	// unfortunately we have to set bg color because of that freakin' IE *!$%#!!?!?%$! 
							//please use the same background color in your links as it is in your document. 
							
	jQuery(selector).each(function(){
		jQuery(this).css("position","relative");
		var html = jQuery(this).html();
		jQuery(this).html("<span class=\"one\">"+ html +"</span>");
		jQuery(this).append("<span class=\"two\">"+ html +"</span>");
		if(jQuery.browser.msie){
			jQuery("span.one",$(this)).css("background",bgcolor);
			jQuery("span.two",$(this)).css("background",bgcolor);
			jQuery("span.one",$(this)).css("opacity",1);
		};
		jQuery("span.two",jQuery(this)).css("opacity",0);
		jQuery("span.two",jQuery(this)).css("position","absolute");
		jQuery("span.two",jQuery(this)).css("top","0px");
		jQuery("span.two",jQuery(this)).css("left","0px");
		jQuery(this).hover(
			function(){
				jQuery("span.one",this).fadeTo(speedOver, 0);
				jQuery("span.two",this).fadeTo(speedOver, 1);
			},
			function(){
				jQuery("span.one",this).fadeTo(speedOut, 1);
				jQuery("span.two",this).fadeTo(speedOut, 0);
			}			
		)
	});
};

jQuery.fadeLinksMainMenu = function() {	

	jQuery.noConflict();

	var selector = "#mainNav > #mainNavwidth > ul.menu > li > a";
	var speedOver = "normal";
	var speedOut = "normal";
	var bgcolor = "#36454C";
	
	jQuery(selector).each(function(){
		jQuery(this).css("position","relative");
		var html = jQuery(this).html();
		jQuery(this).html("<div class=\"norm\">"+ html +"</div>");
		jQuery(this).append("<div class=\"over\">"+ html +"</div>");

		if(jQuery.browser.msie){
			jQuery("div.norm",$(this)).css("background-color",bgcolor);
			jQuery("div.over",$(this)).css("background-color",bgcolor);
			jQuery("div.norm",$(this)).css("opacity",1);
		};

		jQuery("div.over",jQuery(this)).css("opacity",0);
		jQuery("div.over",jQuery(this)).css("position","absolute");
		jQuery("div.over",jQuery(this)).css("top","0px");
		jQuery("div.over",jQuery(this)).css("left","0px");
		jQuery(this).hover(
			function(){
				//jQuery("div.norm",this).fadeTo(speedOver, 0);
				jQuery("div.over",this).fadeTo(speedOver, 1);
			},
			function(){
				//jQuery("div.norm",this).fadeTo(speedOut, 1);
				jQuery("div.over",this).fadeTo(speedOut, 0);
			}			
		)
	});
};

jQuery.fadeLogin = function() {
	
	jQuery.noConflict();
	
	var selector = "#topNav > #topNavwidth > ul > li > a.openLoginPannel";
	var cible = "#topNav > #loginPanel";
	var speedOver = "fast";
	var speedOut = "fast";
							
		jQuery(selector).click(
			function(){
				jQuery(cible).css("display","block");
				jQuery(cible).fadeTo(speedOver, 1);
				jQuery(this).fadeTo(speedOver, 0);
			},
			function(){
				
			}
		)
		
		jQuery(cible).hover(
			function(){
				
			},
			function(){
				jQuery(this).fadeTo(speedOut, 0, function(){ jQuery(this).css("display","none"); });
				jQuery(selector).fadeTo(speedOver, 1);
			}
		)
};
jQuery.fadeCart = function() {
	
	jQuery.noConflict();
	var selector = "#topNav > #topNavwidth > ul > li > a.openCartPannel";
	var cible = "#topNav > #cartPanel";
	var speedOver = "fast";
	var speedOut = "fast";
							
		jQuery(selector).click(
			function(){
				jQuery(cible).css("display","block");
				jQuery(cible).fadeTo(speedOver, 1);
				jQuery(this).fadeTo(speedOver, 0);
			},
			function(){
				
			}
		)
		
		jQuery(cible).hover(
			function(){
				
			},
			function(){
				jQuery(this).fadeTo(speedOut, 0, function(){ jQuery(this).css("display","none"); });
				jQuery(selector).fadeTo(speedOver, 1);
			}
		)
};

jQuery.fadeInOutCart = function() {
	jQuery.noConflict();
	var selector = 'span.hikashop_product_stock > input.hikashop_cart_input_button';
	var cible = '#topNav > #cartPanel';
	var cible2 = 'span.hikashop_product_stock > #hikashop_product_addtocart_desc';
	jQuery(selector).click(function(){
		goToByScroll("bodyTemplate");
		jQuery(cible).css("display","block");
		jQuery(cible).fadeTo(800, 1, function(){ jQuery(cible).fadeTo("slow", 0, function(){ jQuery(cible).css("display","none"); }); });
		
    });
	
	jQuery(selector).hover(
			function(){
				//jQuery(cible2).css("display","block");
				jQuery(cible2).fadeTo("fast", 1);
			},
			function(){
				//jQuery(cible2).css("display","none");
				jQuery(cible2).fadeTo("fast", 0, function(){ jQuery(cible2).css("display","none"); });
			}
		)
}
jQuery.activeCart = function() {
	jQuery.noConflict();
	var selector = "#topNav > #topNavwidth > ul > li > a.openCartPannel > div";
	jQuery(selector).css("color","#069");
}
jQuery.desactiveCart = function() {
	jQuery.noConflict();
	var selector = "#topNav > #topNavwidth > ul > li > a.openCartPannel > div";
	jQuery(selector).css("color","");
}


function goToByScroll(id){
     jQuery('html,body').animate({scrollTop: jQuery("#"+id).offset().top},'fast');
}

function getheight(divId){
	this.divObj=document.getElementById(divId);
	this.contentheight=parseInt(this.divObj.style.height) || this.divObj.offsetHeight;
	return this.contentheight;
}
function setminheight(divId, divHeight){
	this.divObj=document.getElementById(divId);
	jQuery(this.divObj).css("min-height",divHeight);
}
function setheight(divId, divHeight){
	this.divObj=document.getElementById(divId);
	jQuery(this.divObj).css("height",divHeight);
}
function setPaddingTop(divId, divHeight){
	this.divObj=document.getElementById(divId);
	jQuery(this.divObj).css("padding-top",divHeight);
}
jQuery(document).ready(function(){
	jQuery.fadeLinksMainMenu();
	jQuery.fadeLogin();
	jQuery.fadeCart();
	jQuery.fadeInOutCart();
	var divheight = getheight('leftsidebar');
	setminheight('content_big', divheight);
	var divheightBread = getheight('breadcrumbsUnder');
	setheight('breadcrumbsBg', divheightBread + 9);
	setPaddingTop('content_small', divheightBread);
});
