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
	        });
	}	
	
	// 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);
		}
	});
	
	// Video for homepage	
	$j(".pic_bg, .note .viewer").hover(
		function() {
			$j(this).find('.hover-box').stop().show().animate({opacity:0.8},400);
		},
		function() {
			$j(this).find('.hover-box').stop().show().animate({opacity:0},400);
	});
	
	
	// Portfolio Prev/Next
	$j('#portfolio-nav .slide a').css({ display: 'block', opacity: 0 });
	$j("#portfolio-nav .slide a").hover(
		function() {
			$j(this).stop().show().animate({opacity:0.9},200);
		},
		function() {
			$j(this).stop().show().animate({opacity:0},200);
	});

	
	$j("label.overlabel").overlabel();
	
});


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