$(function(){
	//START JS
	
	//START SLIDER FOR FEATURED 
	$("#slider").easySlider({
		auto: true,
		continuous: false,
		prevId: 		'prevBtn',
		nextId: 		'nextBtn',
		speed:			1000,
		controlsShow: false	
	});
	//END SLIDER
	//START SELECT ALL/UNSELECT ALL CATEGORIES
	$(".checkAll").click(function(){
	    $("input[type=checkbox]").each(function()
	    {
	      this.checked = true;
	    });
	    $(".uncheckAll").show();
	    $(".checkAll").hide();
	    return false;
	  });
	  $(".uncheckAll").click(function(){
	    $("input[type=checkbox]").each(function()
	    {
	      this.checked = false;
	    });
	    $(".uncheckAll").hide();
	    $(".checkAll").show();
	    return false;
	  });
	  //END SELECT ALL/UNSELECT ALL CATEGORIES
	  
	  //START EFFECTS ON FLASH MESSAGES
	  $("#flash").delay(3000).slideUp('slow');
	  //END EFFECTS ON FLASH MESSAGES
	
	  //START ADMIN CATEGORY STUFF
	  $("#content #categories span img.addChild").click(function(){
	  		x = this.id;
	  		y = $('[name='+x+']').val();
	  		if(y != ''){
		  		window.location = 'http://nwmarketcoupons.com/admin/categories/add/'+x+'/'+y;
	  		}else{
	  			alert("Sorry, you must enter a category name");
	  		}
  	   });
	  //END ADMIN CATEGORY STUFF
	  
	  //START DATEPICKER
		$(".datepicker").datepicker({
			minDate: 'today',
			changeMonth: true,
			changeYear: true, 
			dateFormat: 'yy-mm-dd'
		});
  	  //END DATEPICKER	  
	  
	//STOP JS
});
