$(document).ready(function(){    
	$('#rotator').before('<div id="pager">').cycle({
		fx:     'fade',
		speed:  'slow',
		timeout: 10000,
		pager:  '#pager'
	});
	$("#main-nav ul li, #main-nav ul li div").hoverIntent(
        function(){ $("div", this).slideDown("fast"); $(this).addClass('hover'); },
        function(){ $("div", this).slideUp("fast"); $(this).removeClass('hover'); }
	);
    $('.ro').hover(
        function() { var newImage = $(this).attr('src').replace(/^(.*?)(\.(?:gif|jpg|png))$/, "$1_o$2");
           $(this).attr('src', newImage);},
        function() { var newImage = $(this).attr('src').replace('_o.', '.');
            $(this).attr('src', newImage);}
    );	
    $('input.text').clearonfocus();
});
function printRecipe() {
    var aRecipe = window.open('','','scrollbars=yes,width=740,height=600');
    aRecipe.document.open("text/html");
    aRecipe.document.write('<html><head><link rel="stylesheet" href="/baco/en/css/main.css" type="text/css" /></head><body style="padding-left:10px;padding-right:10px;background-image:none;background-color:#FFFFFF;">');
    aRecipe.document.write('<div id="print" style="text-align:left">');
    aRecipe.document.write(document.getElementById('recipe-detail').innerHTML);
    aRecipe.document.write('</div>');
    aRecipe.document.write('</body></html>');
    aRecipe.document.close();
    aRecipe.print();
    return false;
}
function testPrint() {
    var testPage = window.open('/baco/en/test_printer.html', 'print', 'width=500,height=200,menubar=no,scrollbars=no,toolbar=no,directories=no,status=no,screenX=150,screenY=150,menubar=no,location=no');
    testPage.print();
    return false;
}    
