$(function(){	
  $('.shadow, h1, h2').dropShadow({left:3,top:3,blur:1,opacity :.2})
  $('#global_nav_bg, #credit').dropShadow({left:0,top:0,blur:5,opacity :.4})
  $('#main_icons li a').dropShadow({left:0,top:0,blur:5,opacity :.4})
  
  $("#iconsnav a").css({'opacity': .75})
  				  .hover(
						function () {
							$(this).css({'opacity': 1});	
						},function(){
							$(this).css({'opacity': .70});
					});//hover

	$("#sa").click(function(){
		$("#cse-search-box").submit();
	});
	
	$('#sitemap_admin p').hover(
						function () {
						//	alert(1);
							$(this).addClass('sitemap_admin_over');
						},function(){
							$(this).removeClass('sitemap_admin_over');	
					});//hove
	
	$('#list_admin tr:not(:has(th))').hover(
		function(){ $(this).addClass('list_over')},
		function(){ $(this).removeClass('list_over')}
	);//hover
//------ תפריטים   -------------------
  $("#menu .menu:has(.curr)").css('z-index',1);
	
	$("#menu .menu:not(:has(.curr))").hover(
        function () {
			$(this).children("div").show();
			$(this).children("a:first").addClass("over")
        },function(){
			$(this).children("div").hide();
			$(this).children("a:first").removeClass("over")
	});//hover

// -------- local navigation ---------
	$('a.topic').append(' <img src="/images/arrow_red_down.gif" alt="" width="11" height="6" border="0" />')
	$('#localnav a.topic').click(function(){
			$(this).next('.sub').slideToggle('slow');
		});
	$('#localnav .curr').parents('.sub').show();
//---------------------------------------	

	$("a[rel='lightbox'], a[rel='press'],  a[rel='press2']  ").colorbox({opacity:.70, current: "תמונה {current} מתוך {total}"});
	$("a.iframe").colorbox({ width:"85%", height:"85%", iframe:true});
	$("#levganim_map").colorbox({initialWidth:10, initialHeight:10, opacity:.60, current: null});
	
	$('.button').hover(
        function () {
			$(this).css({color:'#FFFFFF', background:'#E5551D'});
        },function(){
			$(this).css({color:'#666666', background:'#CCCCCC'});
	});
	
	$('.input1').focus(function(){
		$(this).css({border: '1px solid #E5551D'});
	});
	
	$('.input1').blur(function(){
		$(this).css({border: '1px solid #D5D7D4'});
	});
	
	
	// טופס קשר ===============================
	var sending = 'שולח...'
	var resend = 'ש ל ח';
	var thakyou = '<p>תודה לך על פנייתך, פרטיך נקלטו ונשלחו בהצלחה.</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)
								   .show();
						//alert(result);
					}
			},
			complete: function(){
    			if(result != 'OK'){ 
					$("#Send").val(resend);
					$("#Send").attr('disabled', false);
				}
   			},
			error: function(xhr) {
        		alert('Error!  Status = ' + xhr.status);
    		}	
		});
		return false;
	});
	

});
