////////////////////////weather menu//////////////////////
$(document).ready(function () {


//////////////////////weather menu//////////////////////
	$("ul.weathermenu_body li:even").addClass("alt");
    $('.weathermenu_head').click(function () {
    left=$(this).offset().left;
	$('ul.weathermenu_body').css('left',left+'px');
	$('ul.weathermenu_body').slideToggle('medium');
	return false;
    });
	$('ul.weathermenu_body li a').mouseover(function () {
	//$(this).animate({  paddingLeft: "10px" }, 50 );
    });
	$('ul.weathermenu_body li a').mouseout(function () {
	//$(this).animate({paddingLeft: "10px" }, 50 );
    });
	
	
});


function doweather(value){
 setCookie('dwl',value); 
 $('ul.weathermenu_body').slideToggle('medium');
 $('a#goweatherlink').html($('ul.weathermenu_body li#'+value+'_item a').html());
 //$('a#goweatherlink').attr("href", "/weather/"+value); 
}

function scrolltop(arg){
  scroll(0, 0)
}

function setCookie(c_name,value)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+5000000000000000);
document.cookie=c_name+ "=" +escape(value)+";expires="+exdate.toUTCString()+";path=/";

}



/**************************************************************/

$(document).ready(function () {
   
	 
	  var blockwidth=$('#crumbblock').width();
	  var crumbwidth=$('#breadcrumb').width();
	  if(crumbwidth<blockwidth){
	  
			p=0;
	   }else{
		   
		  
	   p=blockwidth-crumbwidth
	   }
	 
	;
	 $("#breadcrumb").css('margin-right',p+'px');
	 
$("#crumbblock").mousemove(function(e){
									
       
      var position =$("#crumbblock").offset();
	  var blockwidth=$('#crumbblock').width();
	  var crumbwidth=$('#breadcrumb').width();
      var p;
	  if(crumbwidth<blockwidth){
	  
			return;
	   }
	  if((e.clientX-position.left)>=blockwidth-100){
	    p=0;
	  }else{
	    if((e.clientX-position.left)<100){
		  p=blockwidth-crumbwidth;
		
		}else{
		  rs=blockwidth-e.clientX+position.left;
		  p=-parseInt((rs/blockwidth)*crumbwidth)+rs;

		 
		}
	  	
	  }
	  
	  $("#breadcrumb").css('margin-right',p+'px');
	   
    });
});

 

/**********************************88zoom gallery************************/

function imggal(img){
 $("a.MYCLASS").attr('href',img);
 $("a.MYCLASS img").attr('src',img);
}

/**********************************set time***********************/

function settime(){
 date=new Date(timestamp*1000);
 var h=date.getHours();
 var pm=pm_am(h);
 var h=checkHours(h);
 var m=checkTime(date.getMinutes());
 var s=date.getSeconds();
 $("div.time p").html(h+":"+m+" "+pm);
//$("div.time p").html(timestamp);
timestamp=timestamp+1;
 setTimeout('settime()',1000);
}

function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}

function checkHours(h){
  if(h<=12){
     return h;;
  }else{
	return h-12 ;
  }
  
}
function pm_am(h){
  if(h>=12){
    return "مساءً";
  }
  return "صباحاً";
}
