$(document).ready(function() {
	$("#admin_list tr:has(td)").hover(
		function(){ $(this).addClass("over") }, 
		function(){ $(this).removeClass("over")} 
	);		
	
	$("#sitemap_admin p").hover(
		function(){ $(this).addClass("over") }, 
		function(){ $(this).removeClass("over")} 
	);		
						   
	$('#localnav a.topic').click(function(){
		$(this).next('.sub').slideToggle('slow');
	});
	$("#localnav .sub a").prepend('<span style="font-weight:normal">&#8226; </span>');
	$("#localnav .sub .curr").prepend('<span style="font-weight:normal">&#8226; </span>');
	
	$("#sitemap .sub a").prepend('<span style="font-weight:normal">&#8226; </span>');
	$("#sitemap a").not(".topic").append(' <img src="/images/arrow_bl.gif" alt="" width="12" height="13" border="0">');
	$("#sitemap a.topic").append(' <img src="/images/arrow_bd.gif" alt="" width="12" height="13" border="0">');
	
	$('#localnav .curr').parents('.sub').show();
	$("h1:not(#article h1)").dropShadow({
		'left':2,
		'top':2,
		'blur' : 2,
		'opacity' : .2
	});
	$(".pas").dropShadow({
		'left':0,
		'top':5,
		'blur' : 3,
		'opacity' : .5
	});
	
	$("#go_search").hover(
		function(){ $(this).addClass("go_over")}, 
		function(){ $(this).removeClass("go_over")}
	);		
	$("#go_search").click(function(){ $("#search").submit(); });
	
	
	$(".input1").focus(function () {
		$(this).addClass("input_focus");
	});
	$(".input1").blur(function () {
		 $(this).removeClass("input_focus");
	});
	// if IE 6"
	if (typeof document.body.style.maxHeight == "undefined") {
		$(".button").hover(
			function(){ $(this).addClass("hover") }, 
			function(){ $(this).removeClass("hover")} 
			);
		$(".button").click(function () {
			$(this).removeClass("hover");
		});
	}		
	
	// טופס קשר ===============================
	var sending = 'Sending...'
	var resend = 'Send';
	var thakyou = '<p>Thank you for contacting PLR. Your details have been successfully sent.</p>';
	$("#contactform").submit(function(){
		var str = $(this).serialize();
		$.ajax({
			type: "POST",
			url: "/contact.common.php",
			data: str,
			beforeSend: function(){
 				$("#send").val(sending);
				$("#send").attr("disabled", true);
			},
			success: function(msg){
					result = msg;
					if(result == 'OK'){ 
						$("#contact").html(thakyou);
					}else{
						$("#error").html(result);
					}
			},
			complete: function(){
    			if(result != 'OK'){ 
					$("#send").val(resend);
					$("#send").attr("disabled", false);
				}
   			},
			error: function(xhr) {
        		alert('Error!  Status = ' + xhr.status);
    		}	
		});
		return false;
	});
	
	//=====================================

});// document ready

