if (location.href.match("/sitecore/shell/") == null) {
    /**
    * @author Cedric Michaux (Lbi) :: cedric.michaux@lbigroup.be
    */

    //jQuery.noConflict();
    var idExpr = /([-a-z0-9_]+)_container/i;

    (function($) {

        $(function() {

			/* custom fonts pour la nav flash - lié à jquery customfont.js */
			//adjustmosaic();
            $(".topContent .mainMenu li:not(.sublevel) a span").customFont({
                'textAlgVert': 10
            });
            $(".topContent .mainMenu li.sublevel a span").customFont({
                'textAlgVert': 10,
                'styleContainer': {
                    "paddingRight": 38
                }
            });

			/* custom selectbox - lié à jquery.selectbox.js */
            $("select.custom, .custom select").selectbox();

	        
			/* définit si le carousel est vertical ou horizontal */
			
            $("div:not(.hide) > .jcarousel.horizontal").jcarousel({
                vertical: false,
                scroll: 1
            });

            $("div:not(.hide) > .jcarousel.vertical").jcarousel({
                vertical: true,
                scroll: 1
            });
			

			/* lie l'action du bouton advancedsearch à la fonction togglebox qui est dans function.js*/
            $(".trigger.toggleBox").each(function() {
                $(this).bind("click", toggleBox)
            })

			/* slider dans l'advanced search prix min - prix max*/
//            $(".slider.range").slider({
//                range: true,
//                min: 0,
//                max: 10000,
//                values: [2000, 5000],
//                slide: slideEvent
//            });
			
			/*  QUGY fonction pour resetter l'advancedsearch */
//			$(".eraseSearch").click(function() {
//            	$("#productBrowser .content .textbox input").val('');
//				$(".selectbox").each(function(){
//				  $(this).val($('option:first', $(this).parent().find('.styled')).text());
//				});
//				$('#productBrowser .content input:checkbox').removeAttr('checked');
//				$("#price_1_slider_bValue_display").html("0"); $("#price_1_slider_tValue_display").html("0");
//				$("#price_1_slider_bValue").val(0); $("#price_1_slider_tValue").val(0);
//				$(".slider.range").slider( "destroy" );
//				resetSlider();
//				/*$(".slider.range").slider('values', [2000, 5000]);
//				.slider( "option", "values", [2000, 5000] );*/
//        	});


			/* subnav des navigations */
            $(".trigger.overlay").overlay();

			/* pour productdetails -> carousel horizontal des produits lié à associatedProducts*/
			
            $(".trigger[rel=#associatedProducts]").bind("click", function() {
                setTimeout(function(){
					$("#associatedProducts > .jcarousel.horizontal").jcarousel({
	                    vertical: false,
	                    scroll: 1
	                });
				}, 20);
				
            });

			/* pour carousel - zoomin en mode print ou zoom - changement de l'icône affiché sur la medium image*/
			/*
            if ($(".zoomin").length > 0)
                $(".zoomin").zoomin({
                    images: {
                        zoom: "/design/allia/images/zoomIn/zoomin_zoomIcon.gif",
                        print: "/design/allia/images/zoomIn/zoomin_printIcon.gif"
                    }
                });
			*/
        })


    })(jQuery);
	
    /**
    * @author Cedric Michaux (Lbi) :: cedric.michaux@lbigroup.be
    */
	
	/* contient des fonctions diverses */
	/*
	var baseHeight = 0;
    function adjustHeight() {
       
	   var $body = jQuery("body"),
	   $contentContainer = jQuery(".mainContainer"),
	   $headerContainer = jQuery(".topContent"),
	   $window = jQuery(window),
	   $overlay = jQuery(".overlayBg, .zoomin-overlayBg");
	   
	  	if($window.height() > jQuery('#container').height()){
			jQuery('#container').css({
				"height": $window.height()
			});
			$overlay.height($window.height())
		}


		if(!baseHeight)
	   		baseHeight = $body.height();

		if($body.height() > baseHeight){
			$contentContainer.css({
				"minHeight": baseHeight - $headerContainer.height()
			});
			$overlay.height(baseHeight)
		}
	   
	   	if ($body.height() < $window.height()){
			$contentContainer.css({
				"minHeight": $window.height() - $headerContainer.height()
			});
			$overlay.height($window.height())
		}
		else{
			$contentContainer.css({
				"minHeight": $body.height() - $headerContainer.height()
			});
			$overlay.height($body.height())
		}
	  
	   
    }*/

	/* QUGY 05/01/10*/
	function adjustmosaic() {
		var maxheight = 0;
        var Tabheight = new Array();
			if (document.getElementById("searchResult") && jQuery.browser.msie) {
				jQuery("#searchResult li").each (
					function (intIndex) {Tabheight[intIndex]=this.offsetHeight;}
				)
				for (var i in Tabheight) {
					if(Tabheight[i]>=maxheight) {maxheight=Tabheight[i]}
					jQuery("#searchResult li").height(maxheight);
					}
			}
    }

    function toggleBox(e) {
        
        if (jQuery.browser.msie && jQuery.browser.version <= 7) {
			jQuery(jQuery(this).attr("rel") + ":not(:visible)").slideDown();
			jQuery(jQuery(this).attr("rel") + ":visible").hide();
		}
		else {
			jQuery(jQuery(this).attr("rel") + ":visible").slideUp();
			jQuery(jQuery(this).attr("rel") + ":not(:visible)").slideDown();
		}
        jQuery(this).toggleClass("close");
        e.preventDefault();
    }

    function slideEvent(e, ui) {
        var id = (idExpr.exec(jQuery(this).parent().attr("id")))[1];
        jQuery("." + id + "_bValue_input").val(ui.values[0]);
        jQuery("#" + id + "_bValue_display").text(ui.values[0])
    
        jQuery("." + id + "_tValue_input").val(ui.values[1]);
        jQuery("#" + id + "_tValue_display").text(ui.values[1])
    }


}


