
$(document).ready(function(){
//$("#temp").fadeOut("1000")
	setTimeout("$('#temp').fadeOut('slow')",10000);

	$("#shoppingcart").click(function(){
		var pos = $("#content").offset(); 
		var width = $("#shoppingcart_popup").width();
		$("#shoppingcart_popup").css( { "left": (pos.left + width + 20) + "px"} );
		$("#shoppingcart_popup").toggle();
		
		return false;
	})
	
	$("#showcalender").click(function(){
		
		var pos = $("#searchcontainer").offset(); 
		var width = $("#searchcontainer").width();
		
		$("#calender").css( { "left": (pos.left + width-180) + "px"} );
		$("#calender").toggle('fast');
		
	})
	
	$("#keyword").click(function(){
		if (!$(this).attr('rel')) {
			$("#keyword").val('');
			$(this).attr({'rel':'1'});
		}
		
	})
	
	
	$(".photoplace").mouseenter(function(e){
	
		$(this).children(".photocount").fadeIn('fast');
	

	})
		
	$(".photoplace").mouseleave (function(e){
	
		$(this).children(".photocount").hide();
	})

	
 	$("#qty, #env").livequery('change',function () {
			var env_value = $("input:checkbox:checked").length;	
			$("#prijsinfo").html('&nbsp;<img src="'+site_url.replace('index.php','')+'/css/ajax-loader.gif">');
			$.post(site_url+"/winkelmandje/get_price/"+$("#fototype :selected").val(),{qty:$("#qty").val(), env:env_value}, function(data){
				$("#prijsinfo").html(data);
		
		});
	}) 
	
	$("#env").livequery('click',function () {
			var env_value = $("input:checkbox:checked").length;

		
			$("#prijsinfo").html('&nbsp;<img src="'+site_url.replace('index.php','')+'/css/ajax-loader.gif">');
			$.post(site_url+"/winkelmandje/get_price/"+$("#fototype :selected").val(),{qty:$("#qty").val(), env:env_value}, function(data){
				$("#prijsinfo").html(data);
		
		});
		
	}) 
	
	$("#fototype").livequery('change',function () {
		show_loader();
		$.post(site_url+"/winkelmandje/get_price/"+$("#fototype :selected").val(),{qty:'x'}, function(data){
			$("#prijsinfo").html(data);
			hide_loader();
		});
		
		$.post(site_url+"/winkelmandje/get_input/"+$("#fototype :selected").val(), function(data){
			show_loader();
			$("#qty_holder").html(data);
			hide_loader();
		});
	}); 
	
	function show_loader()
	{
		$("#setorder").hide();
		$("#loader").html('<img src="'+site_url.replace('index.php','')+'/css/ajax-loader.gif">');
		$("#loader").show();
	}	
	
	function hide_loader()
	{
		$("#setorder").show();
		$("#loader").hide();
	}

	
	$("option").easyTooltip();


	
	$("#cal_prev, #cal_next").livequery('click',function () {
		$(this).html('<img src="'+site_url.replace('index.php','')+'/css/cal_load.gif">');
		$.post(site_url+"/elements/calender/"+$(this).attr('rel').replace("#",""), function(data){
			$("#calender table").hide();
			$("#calender").html(data);
		
		})
	
	})
	
	$("#logo_container").click(function(){
		window.location = site_url;
	})

});

$(function() {
	$("#menu").lavaLamp({
		fx: "backout",
		speed: 700,
		click: function(event, menuItem) {
		   
		}
	});
	
});
