// JavaScript Document
$(document).ready(function(){
	$.ajaxSetup ({   
	    cache: false  
	});
	
	
	$('.los').hover(function(){
		$(this).stop().css("z-index", "99");
		$(this).find('img').stop().animate({marginLeft: '-10px',marginRight: '-10px',marginTop: '-10px',marginBottom: '-10px',width: '111px',height: '144px'}, 550);
	},function(){
		$(this).stop().css("z-index", "0");
		$(this).find('img').stop().animate({marginRight: '0px',marginLeft: '0px',marginTop: '0px',marginBottom: '0px',width: '93px',height: '115px'}, 150);
	});

	
	
	$('.logo_glasscafe').hover(function(){
		$(this).stop().css("z-index", "99");
		$(this).find('img').stop().animate({marginLeft: '-10px',marginRight: '-10px',marginTop: '-10px',marginBottom: '-10px',width: '111px',height: '144px'}, 550);
	},function(){
		$(this).stop().css("z-index", "0");
		$(this).find('img').stop().animate({marginRight: '0px',marginLeft: '0px',marginTop: '0px',marginBottom: '0px',width: '93px',height: '115px'}, 150);
	});

	$('.logo_restaurang').hover(function(){
		$(this).stop().css("z-index", "99");
		$(this).find('img').stop().animate({marginLeft: '-11px',marginRight: '-10px',marginTop: '-10px',marginBottom: '-10px',width: '111px',height: '144px'}, 550);
	},function(){
		$(this).stop().css("z-index", "0");
		$(this).find('img').stop().animate({marginRight: '0px',marginLeft: '0px',marginTop: '0px',marginBottom: '0px',width: '93px',height: '115px'}, 150);
	});

	$('.logo_rum').hover(function(){
		$(this).stop().css("z-index", "99");
		$(this).find('img').stop().animate({marginLeft: '-10px',marginRight: '-10px',marginTop: '-10px',marginBottom: '-10px',width: '111px',height: '144px'}, 550);
	},function(){
		$(this).stop().css("z-index", "0");
		$(this).find('img').stop().animate({marginRight: '0px',marginLeft: '0px',marginTop: '0px',marginBottom: '0px',width: '93px',height: '115px'}, 150);
	});





	$('.galleryimagesload').live('click', function(){
//imagesContainerLarge												   	
		var pageArrayId = $(this).attr('src'); //.substr(10);
			$.ajax({
				type: "POST", //default is "GET" HTTP request method
				url: '../actions/action.public.get_gallery_bigger_image_load.php', //url(String)
				data: "img="+$(this).attr('src'), //data form of an url query string
				timeout: (60*1000), //timeout (in milliseconds) for the request
				//function to be called if the request fails.
				error: function(XMLHttpRequest, textStatus, errorThrown){
					alert(textStatus + '\n' + errorThrown);	
				},
					success: function(data, textStatus, XMLHttpRequest){
					$('#imagesContainerLarge').html(data);												   	
				}
			});
	});



	$('.galleryimages').live('click', function(){
		$('#gallerydiv').show();
		var pageArrayId = $(this).attr('src'); //.substr(10);
			$('#mcont').hide();
			$.ajax({
				type: "POST", //default is "GET" HTTP request method
				url: '../actions/action.public.get_gallery_bigger_image.php', //url(String)
				data: "img="+$(this).attr('src'), //data form of an url query string
				timeout: (60*1000), //timeout (in milliseconds) for the request
				//function to be called if the request fails.
				error: function(XMLHttpRequest, textStatus, errorThrown){
					alert(textStatus + '\n' + errorThrown);	
				},
					success: function(data, textStatus, XMLHttpRequest){
					$('#imgConta').html(data);
				}
			});
	});
	$('#backnav').live('click', function(){
			$.ajax({
				type: "POST", //default is "GET" HTTP request method
				url: '../actions/action.public.get_dynamic_gallery_bigger_image_back.php', //url(String)
				data: "img="+$(this).attr('name'), //data form of an url query string
				timeout: (60*1000), //timeout (in milliseconds) for the request
				error: function(XMLHttpRequest, textStatus, errorThrown){
					alert(textStatus);	
				},
					success: function(data, textStatus, XMLHttpRequest){
					$('#imgConta').html(data);
				}
			});
	});
	$('#forwardnav').live('click', function(){
			$.ajax({
				type: "POST", //default is "GET" HTTP request method
				url: '../actions/action.public.get_dynamic_gallery_bigger_image_forward.php', //url(String)
				data: "img="+$(this).attr('name'), //data form of an url query string
				timeout: (60*1000), //timeout (in milliseconds) for the request
				error: function(XMLHttpRequest, textStatus, errorThrown){
					alert(textStatus);	
				},
					success: function(data, textStatus, XMLHttpRequest){
					$('#imgConta').html(data);
				}
			});
	});
	$('#closeGalleryButton').live('click', function(){
		$('#gallerydiv').hide();
			$('#mcont').show();
	});
});
