$(document).ready(function(){

	//$(".post a img").parent().attr("rel","gallery[Post]");

	//$('.post a img').filter(function() {
	//    return $(this).parent().attr("href") && $(this).parent().attr("href") !== location.hostname;
	//}).parent().attr("rel","gallery[Post]");
						   
	// Dropdown Script	   
	function mainmenu(){
	$(" #nav ul ").css({display: "none"}); // Opera Fix
	$(" #nav li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
			},function(){
			$(this).find('ul:first').css({visibility: "hidden"});
			});
	}
	
	 //$(document).ready(function(){					
		mainmenu();
	//});
 
	// Activate PrettyPhoto Lightbox handle
	//$("a[rel='gallery[Portfolio]']").prettyPhoto();
jQuery("a[rel^='gallery']").fancybox({
			'imageScale': true,
			'padding': 10,
			'zoomOpacity': true,
			'zoomSpeedIn': 500,
			'zoomSpeedOut': 500,
			'zoomSpeedChange': 300,
			'overlayShow': true,
			'overlayColor': "#666666",
			'overlayOpacity': 0.3,
			'enableEscapeButton': true,
			'showCloseButton': true,
			'hideOnOverlayClick': true,
			'hideOnContentClick': false,
			'frameWidth':  560,
			'frameHeight':  340,
			'centerOnScroll': true
		});
	
	// PNG Fix
	$(document).pngFix(); 	
	
	// Activate jCarousel
	function mycarousel_initCallback(carousel)
	{
    	// Disable autoscrolling if the user clicks the prev or next button.
    	carousel.buttonNext.bind('click', function() {
    	    carousel.startAuto(0);
    	});
		
    	carousel.buttonPrev.bind('click', function() {
    	    carousel.startAuto(0);
    	});
		
    	// Pause autoscrolling if the user moves with the cursor over the clip.
    	carousel.clip.hover(function() {
    	    carousel.stopAuto();
    	}, function() {
    	    carousel.startAuto();
    	});
	};


    	$('#mycarousel').jcarousel({
    	    auto: 6,
    	    wrap: 'last',
    	    animation: 'slow',
    	    initCallback: mycarousel_initCallback
    });

});
