/*
	main.js
	Pan Con Chocolate
	Developed by Ekaide Project Development
		www.ekaidepd.com
	Alvaro Naveda (alvaro.naveda@ekaidepd.com)
*/

function mycarousel_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

$(document).ready(function() {
	$("#qtranslate-chooser").animate({marginTop: '+=45px'},2000).css('display','block');
	$("#panconchocolate a").slideDown(1500).css('display','block');

	$("#menu2 > li").hoverIntent(
	function() {
		$(this).children("ul").children("li").css('display', 'block');
		$(this).children("ul").children("li").css('width', $(this).css('width'));
		$(this).children("ul").children("li:even").children("a").addClass('light');
		$(this).children("ul").children("li").children("a").css('border-left', 'none');
		$(this).children("ul").slideDown();
	},
	function() {
		$(this).children("ul").fadeOut();
	}
	);
	
	$("#grass").animate({marginTop: '-=78px'}, 2000, function() {
		$("#grass #flower").animate({top: '35px'}, 2000, function() {
			setInterval( function() {
							$("#grass #flower").animate({rotate: '+=10deg'}, 0);
						}, 100);
		});
		$("#grass #leaf").animate({top: '57px'}, 2000);
	});
	
	$('#hslider ul').jcarousel({
        auto: 5,
        wrap: 'last',
		visible: 1,
		scroll: 1,
		buttonNextHTML: null,
		buttonPrevHTML: null
    });
	
});

$(window).unload(function() {
	GUnload();
});
