// Thumbnail Fader
jQuery.noConflict();
jQuery(document).ready(function($){

  setFade=function(){
       $(".container .designs").hover(function() { //On hover...
		
		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
		
		//Set a background image(thumbOver) on the &lt;a&gt; tag 
		$(this).find("a.folio_thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
		//Fade the image to 0 
		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade
		}); 
	} , function() { //on hover out...
		//Fade the image to 1 
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});

    };
    setFade();
	// Slide Show
    jQuery('#main_slider').after('<div id="slider_nav">').cycle({
        fx:         'fade',
        speed:      400,
        timeout:    7000,
        pager:      '#slider_nav'
    });
	
	// slider
	$("a.totop").anchorAnimate()

});
jQuery.fn.anchorAnimate = function(settings) {

    settings = jQuery.extend({
	speed : 300
    }, settings);   
    
    return this.each(function(){
        var caller = this
        jQuery(caller).click(function (event) { 
            event.preventDefault()
            var locationHref = window.location.href
            var elementClick = jQuery(caller).attr("href")
            
            var destination = jQuery(elementClick).offset().top;
            jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
                window.location.hash = elementClick
            });
            return false;
        })
    })
}
