/*
     BRICOLUX S.A.
     Developed By NET AVANTAGE for BUCOWEB
     Date 15/04/2011
     Website http://www.netavantage.fr/

*/



//////////////////// 1. JQuery Scroll Top ///////////////////////

$(document).ready(function() {
    $('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });

});


//////////////////// 2. JQuery Preload Image ///////////////////////

(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

// Add path to the images that you want to Preload //

$(document).ready(function(){ 
jQuery.preLoadImages("../img/zoom.png");
});


//////////////////// 3. JQuery Slider ///////////////////////

 $(document).ready(function(){ 
    $('#sildercontent').suSlider(); 
 });


//////////////////// 4. JQuery Cycle Plugin ///////////////////////

$(function() {
    $('.featured_1').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev1',
        next:    '#next1'        
    });
    $('.featured_2').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev2',
        next:    '#next2'        
            });
    $('.featured_3').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev3',
        next:    '#next3'        
    });
    $('.featured_4').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev4',
        next:    '#next4'        
    });
    $('.featured_5').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev5',
        next:    '#next5'        
            });
    $('.featured_6').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev6',
        next:    '#next6'        
    }); 
    $('.full_img').cycle({
        fx:      'fade',
        timeout:  0,
        prev:    '#prev',
        next:    '#next'        
    });        
});


//////////////////// 5. JQuery Tab ///////////////////////

$(document).ready(function() { 
	$('.tabs a').click(function(){
		switch_tabs($(this));
	}); 
	switch_tabs($('.defaulttab')); 
    }); 
    function switch_tabs(obj) {
	$('.tab-content').hide();
	$('.tabs a').removeClass("selected");
	var id = obj.attr("rel"); 
	$('#'+id).fadeIn(500);
	obj.addClass("selected");
    }


//////////////////// 6. JQuery ThumbPort ///////////////////////

$(document).ready(function() {
        $('.thumbport').mouseenter(function(e) {
            $(this).children('a').children('img').animate({ height: '110', left: '0', top: '0', width: '190'}, 100);
            $(this).children('a').children('span').fadeIn(200);
        }).mouseleave(function(e) {
            $(this).children('a').children('img').animate({ height: '110', left: '0', top: '0', width: '190'}, 100);
            $(this).children('a').children('span').fadeOut(200);
        });
        $('.two_c_img').mouseenter(function(e) {
            $(this).children('a').children('img').animate({ height: '190', left: '0', top: '0', width: '355'}, 100);
            $(this).children('a').children('span').fadeIn(200);
        }).mouseleave(function(e) {
            $(this).children('a').children('img').animate({ height: '190', left: '0', top: '0', width: '355'}, 100);
            $(this).children('a').children('span').fadeOut(200);
        });
        $('.three_c_img').mouseenter(function(e) {
            $(this).children('a').children('img').animate({ height: '125', left: '0', top: '0', width: '210'}, 100);
            $(this).children('a').children('span').fadeIn(200);
        }).mouseleave(function(e) {
            $(this).children('a').children('img').animate({ height: '125', left: '0', top: '0', width: '210'}, 100);
            $(this).children('a').children('span').fadeOut(200);
        });
        $('.shoot').mouseenter(function(e) {
            $(this).children('a').children('img').animate({ height: '480', left: '0', top: '0', width: '320'}, 100);
            $(this).children('a').children('span').fadeIn(200);
        }).mouseleave(function(e) {
            $(this).children('a').children('img').animate({ height: '480', left: '0', top: '0', width: '320'}, 100);
            $(this).children('a').children('span').fadeOut(200);
        });
    });






//////////////////// 7. JQuery Equal Heights ///////////////////////

function equalHeight(group) {
    tallest = 0;
    group.each(function() {
    thisHeight = $(this).height();
    if(thisHeight > tallest) {
         tallest = thisHeight;
    }
    });
    group.height(tallest);
    }
    $(document).ready(function() {
    equalHeight($(".eh"));
});

//////////////////// 8 .CUFON  /////////////////////// 

$(document).ready(function(){
		Cufon.replace("h1", {hover: true});
                Cufon.replace("h2", {hover: true});
                Cufon.replace("h3", {hover: true});
                Cufon.replace("h4", {hover: true});
				Cufon.replace(".parent", {hover: true});
				Cufon.replace("#slnav", {hover: true});
});



