function generatePrintablePage(size_str)
{

 	
	//show chose recipe
	switch (size_str)
		{
			//Recipes By Shape has been chosen
				case "35":
			popUp("http://www.barillaus.com/pages/recipeprint.aspx?35",600,600,"yes","no","35");
			break;
		
			case "46":
			popUp("http://www.barillaus.com/pages/recipeprint.aspx?46",800,700,"yes","no","46");
			break;
			
			case "full":
			popUp("http://www.barillaus.com/pages/recipeprint.aspx?full","","","yes","yes","full");
			break;
			
			default:
			return;
			break;		

		}
	
	//reset selector		
//	document.printrecipeform.print.options.selectedIndex = 0;	
}

var printpage = null;

function popUp(strUrl,intWidth,intHeight,scroll,full,windowname) 
{
	
	var bs_re = /\\/g
	
	strUrl = strUrl.replace(bs_re,"/");
	
		
	if(!detect_obj.is_mac && printpage != null)
	{
		printpage.close();
	}	
		
	printpage = window.open(strUrl,windowname,"fullscreen=no,toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+full+",width="+intWidth+",height="+intHeight);
	printpage.focus();
}

function displayIngredients()
{
	if(document.getElementById("ingredientlist"))
	{
		if(RecipeSearch == "Ingrediant")
		{
			
			var ArrayFilter = Filter.split(" ");
			
			for(var j=0;j<ArrayFilter.length; j++)
			{
				ingredients_str = ingredients_str.replace(ArrayFilter[j],"<strong>"+ArrayFilter[j]+"</strong>");												
			}
		}
		
		var ingredients_arr = ingredients_str.substring(1).split("=");
		var quantities_arr = quantities_str.substring(1).split("=");
		var html_str="";
		
		for(var i=0;i< ingredients_arr.length;i++)
		{
			html_str +=	'<div class="item"><span class="quantity">'+quantities_arr[i]+'</span><span class="ingredient">'+ingredients_arr[i]+'</span><br clear="all" /></div>';
		}
									
		document.getElementById("ingredientlist").innerHTML = html_str;	
	
	}

}

		function sendRecipe()
		{
			location.href = "http://www.barillaus.com/Pages/sendrecipetofriend.aspx?recipename="+document.getElementById("recipetitlename").value;
		}
		
		function checkIframerecipe()
		{ 
		var url=location.href.split('?'); 
		if(url.length>1){ 
		//var url=location.href.split('/'); 
		var iFrame="http://apps.barillaus.com/sendrecipetofriend.aspx?" + url[url.length-1]; 
		//alert(iFrame);
		document.getElementById('ifr').setAttribute('src',iFrame) 
} 
} 

