$(document).ready(function(){
	$(".inputFieldSearch").bind("click", function(){
		if(this.id == $(this).val()) $(this).val("");
	});
	
	$(".inputFieldSearch").bind("blur", function(){
		if($(this).val() == "") $(this).val(this.id);
	});	
	$("#sendToAFriend").bind("click", function(){
		if ($("#sendToAFriendFormContent").css("display") == "none"){
			$.ajax({
				type: "GET",
				url: "/sendToAFriend.php",
				success: function(data){
					$("#sendToAFriendFormContent").empty();
					$("#sendToAFriendFormContent").append(data);
				}
			});
			$("#sendToAFriendFormContent").slideDown("fast");
		}else{
			$("#sendToAFriendFormContent").slideUp("fast");
		}
	});	
	
	$("#showImages").bind("click", function(){
		$("#picturesRest").slideDown("slow");
		$(this).hide();
		$("#hideImages").show();
	});
	$("#hideImages").bind("click", function(){
		$("#picturesRest").slideUp(500);
		$(this).hide();
		$("#showImages").show(800);
	});
	
	$("#getSCities").bind("change", function(){
		var region_id = $(this).val();
		$.ajax({
			type: "POST",
			url: "/getCities.php",
			data: "region_id="+region_id,
			success: function(html){
				$("#citiesHolder").empty();
				$("#citiesHolder").append(html);
			}
		});
	});
	$("#getSCities1").bind("change", function(){
		var region_id = $(this).val();
		$.ajax({
			type: "POST",
			url: "/getCities1.php",
			data: "region_id="+region_id,
			success: function(html){
				$("#citiesHolder").empty();
				$("#citiesHolder").append(html);
			}
		});
	});
	
});

