licount = 1;
time = 1500;

liamount = jQuery('#nav a').length;

function checked(){

	if(licount == 1){
	
		jQuery('.jcarousel-prev-horizontal').css('display','none');
	
	}else{
	
		jQuery('.jcarousel-prev-horizontal').css('display','block');
	
	}
	if(liamount == licount){
	
		jQuery('.jcarousel-next-horizontal').css('display','none');
	
	}else{
	
		jQuery('.jcarousel-next-horizontal').css('display','block');
	
	}

}

function mycarousel_itemVisibleOutCallback(){


jQuery('.text').css('overflow','auto');
};


function removescroll(){

jQuery('.text').css('overflow','hidden');

}
function closes(){

jQuery('#lbOverlay').hide();
jQuery('#video').hide();
jQuery('#valentines').hide();
}
function jumpbox(){
closes();
jQuery('#ui-datepicker-div').css('z-index','9000');
var left = (screen.width/2)-(400/2);
var top = (screen.height/2)-(700/2);
jQuery('#video').css('top',top);
jQuery('#video').css('left',left);
jQuery('#lbOverlay').show();
jQuery('#lbOverlay').css('width',jQuery('body').width());
jQuery('#lbOverlay').css('height',jQuery(document).height());
jQuery('#video').show();
jQuery('#contact_form').show();

}

function jumpbox2(){
closes();
	jQuery('#ui-datepicker-div').css('z-index','9000');
	var left = (screen.width/2)-(400/2);
	var top = (screen.height/2)-(700/2);
	jQuery('#valentines').css('top',top);
	jQuery('#valentines').css('left',left);
	jQuery('#lbOverlay').show();
	jQuery('#lbOverlay').css('width',jQuery('body').width());
	jQuery('#lbOverlay').css('height',jQuery(document).height());
	jQuery('#valentines').show();
	jQuery('#contact_form_val').show();

}

jQuery(document).ready(function() {

jQuery('ul#slideshow').innerfade({
					speed: 1500,
					timeout: 3500,
					type: 'sequence',
					containerheight: '233px'
			
				});

jQuery('#posted-date').datepicker({ dateFormat: 'dd/mm/yy',minDate: 0 , beforeShowDay: function(date) {
        return [(date.getDay() > 1), '']; } });

err = jQuery('#video .error_feedback').html();
successer = jQuery('#video #successf').html();
err2 = jQuery('#valentines .error_feedback').html();
successer2 = jQuery('#valentines #successf').html();

if(err2){

jumpbox2();

}
if(successer2){

jumpbox2();

}


if(err){

jumpbox();

}
if(successer){

jumpbox();

}
jQuery('.jumpbox').click(function(){

jumpbox();

});
jQuery('.val').click(function(){

jumpbox2();

});
liamount = jQuery('#mycarousel li').length;
checked();
    jQuery('#mycarousel').jcarousel({scroll:1,itemVisibleOutCallback: mycarousel_itemVisibleOutCallback});
	jQuery('#footer_nav a').hover(function(){
		jQuery('.megaimage').attr('style','display:none;');
		jQuery(this).find('.megaimage').show();
	
	},function(){

		
				jQuery('.megaimage').attr('style','display:none;');

	});

jQuery('.jcarousel-prev-horizontal').css('display','none');
jQuery('.jcarousel-prev').click(function(){
licount--;
removescroll();
checked();
});


jQuery('.jcarousel-next').click(function(){
licount++;
removescroll();
checked();
});


jQuery.each(jQuery.browser, function(i) {
	if(i=="msie"){
	
		jQuery('a.team').css('opacity','0.8'); 
		jQuery('a.food').css('opacity','0.8');
		jQuery('a.menu').css('opacity','0.8');
		jQuery('a.reserv').css('opacity','0.8');
	
	}
});



});
