// JavaScript Document

function home_recipes(list){ $('#hrecipes').load('index.ajax.php?action='+list); $('#rtabs .active').removeClass('active'); $('#rtabs .left').removeClass('left'); $('#t'+list).addClass('active'); if(list=='favorites') { $('#tfavorites').removeClass('last'); } else { $('#tfavorites').addClass('last'); }
			
			if(list=='rated'){ $('#tnewest').addClass('left'); }
			if(list=='popular'){ $('#trated').addClass('left'); }
			if(list=='favorites'){ $('#tpopular').addClass('left'); }
		}

$(document).ready(function(){
			if ($('.drop')) {	   
				$('.drop').each(function(){
								var temp = '';
								var oj = this;
								$(oj).parent().mouseover(function(){ clearTimeout(temp); $(oj).css('display','block'); }).mouseout(function(){ 
																						clearTimeout(temp); temp = setTimeout(function(){ $(oj).css('display','none'); },100);
																						})
								});
			}
						   
						   
						   
						   
						   }); <!-- end doc ready -->

function recipe_box(o,u,a){ p = jQuery(o).parent(); jQuery(p).load('/recipe.favorite.php?recipe='+u+'&action='+a+'&ajax=1'); return false; }
function add_ingredient_line(){ $('#ingredient-body').append('<tr><td><input type="text" class="text amt" name="amt[]" value="" /></td><td><input type="text" name="ing[]" class="text ingredient-name" value="" /></td></tr><tr><td><input type="text" class="text amt" name="amt[]" value="" /></td><td><input type="text" name="ing[]" class="text ingredient-name" value="" /></td></tr>'); }
function popit(element,width,height){ var url = element.href; newwindow = window.open(url,'agenda','width='+width+',height='+height+',scrollbars=yes,resizable=yes'); if (window.focus){ newwindow.focus(); } return false; }


function logoutConfirm () {
	jConfirm('In order to log out of Half Hour Meals, you will be disconnected from your profile on Facebook.', 'Logout', function(r) {
		if ( r == true ) {
			FB.logout( function( response ) {
				window.location = "/logout";
			});
		}
	});
}


