﻿$(function(){   
	//CTAS HOVER BOTTOM OF THE PAGE	  
	alphaCtas();
	
	//mouseover recipes list items
	
	/*
	$("#recipes .description li").each(function(){
		$(this).bind("mouseover",function(){
			$(this).addClass("active");
			return false;
		});
		$(this).bind("mouseout",function(){
			$(this).removeClass("active");
			return false;
		});
	});
	*/
	
	//rate this widget
	$(".rate_widget ol li a").each(function(n){
		var m=(n+1);
		$(this).bind("mouseover",function(e,n){
			$($(this).parents("ol").get(0)).css({"background-position":"0 -"+m*15+"px"});
			return false;
		});
		$(this).bind("mouseout",function(e,n){
			$($(this).parents("ol").get(0)).css({"background-position":"0 0"});
			return false;
		});
	});
});

function alphaCtas(){
	$("#ctas").children().each(function(){
		
		$(this).bind("mouseover",function(){
			var myPath = $(this).find('img').attr('src');
			$(this).find('img').attr({ 
          		src: myPath.split('.')[0]+"_hover.jpg"
        	});
			$(this).find('a').addClass('hover');
			return false;
		});
		
		$(this).bind("mouseout",function(){
			var myPath = $(this).find('img').attr('src');
			$(this).find('img').attr({ 
          		src: myPath.split('_hover')[0]+".jpg"
        	});
			$(this).find('a').removeClass('hover');
			return false;
		});
	});
};

function gotoThisPage(myUrl){
	//console.log("gotoThisPage");
	window.location.href = myUrl;	
};