jQuery(document).ready(function() {		
	if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7) {
		// IE 6 has problem with supersubs plugin so we don't use it here...
		$j('ul.topnav').superfish({  		// initialize superfish
				delay:       400,			// one second delay on mouseout 
				animation: {				// fade-in and slide-down animation 
					height:	'show'
				},
				speed:		275
			});
	} else {
		// all other browsers, include supersubs plugin.
		$j('ul.topnav').supersubs({ 
	            minWidth:    12,	// minimum width of sub-menus in em units 
	            maxWidth:    27,	// maximum width of sub-menus in em units 
	            extraWidth:  0		// extra width for slight rounding differences in fonts 
	        }).superfish({  		// initialize superfish
	            delay:       400,	// one second delay on mouseout 
	            animation: {		// fade-in and slide-down animation 
					height:	'show'
				},
	            speed:		275
	        });
	}	
	
		function natty_sliderInit() {
		
		if(jQuery().sudoSlider || jQuery().slides) {
			
			var thumbs = jQuery('#pagination-slider .pagination li');

			thumbs.find('a').click( function() {
				return false;
			});
						
			thumbs.find('a').hover(
        function() {
          jQuery(this).children().stop().show().animate({opacity:0.8},100);
        },
        function() {
          jQuery(this).children().stop().show().animate({opacity:1},100);
      });
			
			jQuery("#slider").slides({
				generatePagination: false,
				autoHeight: true,
				width: 940
			});			
		
		}	
		
	}	
	natty_sliderInit();
	
	// FancyBox init	
  $j("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});

	$j(".pic_bg").hover( function () {
		if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) <= 8) {
			$j(this).find('a').stop(false, true).toggleClass('imgHover');
		} else {
			$j(this).find('a').stop(false, true).toggleClass('imgHover', 200);
		}
	});		
	
	$j("label.overlabel").overlabel();
	
  //Scroll to top  
  $j('#toTop').click(function() { $j('html,body').animate({ scrollTop: 0 }, 'slow'); });
  
  if($j("#back-to-top").length) {
    var offset = $j("#back-to-top").offset();
    $j(function () {
    $j(window).scroll(function () {
        if ($j(this).scrollTop() > offset.top) {
          var cssObj = {
            'position' : 'fixed',
            'top' : '15px'
          }
          $j('#back-to-top').css(cssObj);
        } else {
          var cssObj = {
            'position' : 'relative',
            'top' : '0px'
          }
          $j('#back-to-top').css(cssObj);
        }
      });
    $j('#back-to-top').click(function() { $j('html,body').animate({ scrollTop: 0 }, 'slow'); return false; });
    });
  }
});


function cufonStart() {Cufon.replace('.fancy_title > div');}
