/**
 * RecipeBox.js
 * - requires jQuery
 **/


/**
 * $(document).ready();	
 * - on DOM load, this function will remove the redirect portion of the HREF link, and will load the data in a mock-popup.
 * - only happends for js enabled users.
 **/
 $(document).ready(function(){
	RecipeBox_link();
 });
 
 /**
  *RecipeBox_link();	this function will remove the redirect portion of the HREF link, and will load the data in a mock-popup.
  **/
  function RecipeBox_link(){
	var link;
	$('.recipebox-link').each(function(){
		link = $(this).attr('href');
		link = link.split('&redirect')[0];
		$(this).attr('href',link+'&func=RecipeBox_addToBox');
		$(this).click(function(){
			$('#colorbox').ready(function(){
				$('#colorbox').addClass('small_colorbox');
				setTimeout("$('#modalClose').click();$('#colorbox').removeClass('small_colorbox');",5000);
				//setTimeout("$('#modalClose').click();",5000);
			});
		});
	});
	$('.recipebox-link').colorbox({iframe:true,fixedWidth:'500',fixedHeight:'200'});
  }