$(function(){
	////voting
	
	
	
	
	
	
	$("input[name='voteregist']").click(function(){
					
			res = $('input[name=vote]:checked').val();
		   	voteid= $('input[name=voteid]').val()
		   if(!res) {
			alert("لطفا یکی از موارد را انتخاب نمایید ");
		   		return false;
		   }
			$.ajax({
			type: "POST",
			url: "public/template/ajaxvote.php",
			data: "id="+voteid+"&vote="+res,
			success: function(msg){
			
					
					$("#voteform").fadeOut();
					$("#voting").append(msg).fadeIn();
				    $(".chart").animate({width:'show'},3000);
;

			
			}
			});
		
	
		
	})
	
	
	/////
		$(".showtopnews").click(function(){
				
					$(".topnews").show();
					$(".anno").hide()
					$("#tabs li").removeClass("active")
					$(this).addClass("active")	
				    $(this).children("a").css({"color":"#fff"})
					$(".showanno").children("a").css({"color":"#000"})
					return false;
			})
			
			
			
  			$(".showanno").click(function(){
				
					$(".topnews").hide();
					
					$(".anno").show();
					$("#tabs li").removeClass("active")
					$(this).addClass("active")
					$(this).children("a").css({"color":"#fff"})
					$(".showtopnews").children("a").css({"color":"#000"})		
					return false;
				
			})	
	
	
	////////
      $('#slider').nivoSlider({
		  	effect:'fold',
			controlNav:false // 1,2,3... navigation
		  });	
	  
	  ///
	  
	$('#services').tinycarousel({ display: 1 ,interval: true,intervaltime: 9000 });
	  
	  //
	  
	  
	     var options = {
    newsList: "#news_tick",
    startDelay: 70,
    placeHolder1: "_"
   }
  $().newsTicker(options);
  
  
  ////
  
  
  	
  
  
  
  
  
  ////
  
  $("img[alt=menu_btn]").hover(function(){
		
		$("#menu_content").show();  
	  
	  },function(){
		  $("#menu_content").hide();  
		  
	})
	
	///
	
	
	  $("#menu_content").hover(function(){
		
			 
	  $("#menu_content").show() ;
	  },function(){
		  $("#menu_content").hide()
	})
  
   
})
