$(document).ready(function(){
	$("#Dots img").click(function(){
		if($(".Slide:nth-child("+$(this).attr("alt")+")").css("display") == "none"){
			$("#Dots img").attr("src","images/dot.png");
			$(this).attr("src","images/dot-active.png");
			$(".Slide").slideUp("slow");
			$(".Slide:nth-child("+$(this).attr("alt")+")").slideDown("slow");
		}
	});
	
	$(".OpacityHover").hover(
		function(){$(this).animate({opacity:0.5},"fast");},
		function(){$(this).animate({opacity:1},"fast");}
	);
	
	$('#ContactSubmit').hover(function() {$(this).css('cursor','pointer');}, function() {$(this).css('cursor','auto');});
	$("#ContactSubmit").click(function() {
		$("#ContactError").html("<img src=\"images/loading.gif\" alt=\"loading\" />");
		$("#ContactError").show();
		$.ajax({type: "POST",
				url: "ajax/contact.php",
				data: "Name="+$("#ContactName").attr("value")+"&Details="+$("#ContactingDetails").attr("value")+"&Phone="+$("#ContactPhone").attr("value")+"&Subject="+$("#ContactSubject").attr("value")+"&Message="+$("#ContactMessage").attr("value"),
				success: function(msg){
					if(msg == "ההודעה נשלחה בהצלחה!")
						$("#ContactForm").html("<span class=\"Success\">"+msg+"</span>");
					else
						$("#ContactError").html("<p>"+msg+"</p>");
				}
		});
      return false;
    });
});



