$(document).ready(function(){
		// 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();
	});					   
						   
		$('.logo').pngFix( );
		
		$("hr").replaceWith("<div class='hr'><hr></div>");
		
	
	$("a[rel^='gallery']").prettyPhoto();

	
		// 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();
    	});
	};

    	jQuery('#mycarousel').jcarousel({
    	    auto: 6,
    	    wrap: 'last',
			scroll: 5,
    	    animation: 'slow',
    	    initCallback: mycarousel_initCallback
    });
	
        jQuery('#homecarousel').jcarousel({
    	    auto: 6,
    	    wrap: 'last',
			scroll: 1,
    	    animation: 400,
    	    initCallback: mycarousel_initCallback
    });
	
});

function showOverlay(fileSrc, idOverlay, idIframe, width, height){
	document.getElementById(idOverlay).style.display='block';
	//document.getElementById(idIframe).innerHTML='<iframe src="'+fileSrc+'" width="'+width+'" height="'+height+'" frameborder="0"></iframe>';
}
function closeOverlay(idOverlay, idIframe){
	//document.getElementById(idIframe).innerHTML='';
	document.getElementById(idOverlay).style.display='none';
}