var address = window.location.host;
var address2 = window.location.href;
var recipeid;
var recipeAction;

//old style URLs (with all params)
if (address2.indexOf("recipeid=") >0 )
{ 

	var strQueryString= address2.substring(address2.indexOf("?") +1, address2.length);
	var arrQSPairs= strQueryString.split("&");
	var arrQueryString = Array();
	for (var nIndex=0; nIndex < arrQSPairs.length; nIndex++)
	{
		var arrThisPair= arrQSPairs[nIndex].split("=");
		arrQueryString[arrThisPair[0]] = arrThisPair[1];
	}	
	recipeid= arrQueryString["recipeid"];	
}


//mod re-write URLs using Apache and .html and recipe id coming before .html
var htmlLoc = address2.indexOf(".html");
var begUrl = address2.substring(0,htmlLoc);
if((recipeid == "" || recipeid == null) && htmlLoc > -1)
{
	recipeid = begUrl.substring((begUrl.lastIndexOf("-")+1),begUrl.length);
	
	var endUrl = address2.substring(address2.indexOf("action="),address2.length);
	
	if(address2.indexOf("action=") > -1)
	{
		recipeAction = endUrl.subString(0,endUrl.indexOf("&"));
	}
	else{
		recipeAction="recipe";
	}
	
	//recipeid = "&recipeid=" + recipeid;
	//alert(recipeAction);
}
else{
//mod re-write URLs using apache and links ending in recipe id
	if ((recipeid == null) || (recipeid == '')){
	var urlEnd;
	var pageUrl;
	urlEnd= address2.indexOf("?");
	if (urlEnd < 0) { urlEnd=address2.length; }
	pageUrl= address2.substring(1, urlEnd );
	var aSplitUrl = pageUrl.split("/");
	recipeid = aSplitUrl[aSplitUrl.length -1];
	}
}

if(recipeAction == null || recipeAction == "")
{
	recipeAction = "recipe";
}



function email( paramRecipeid ){
if ((paramRecipeid != null) && (paramRecipeid != '')) { recipeid=paramRecipeid; }	
if ( address == "www.simpleanddelicious.com"){
	window.location = "http://www.simpleanddelicious.com/find-recipes/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"

}
if ( address == "www.startmakingchoices.com"){

	window.location = "http://www.startmakingchoices.com/recipes/recipeEmail.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}
if ( address == "www.conagrafoods.com"){

	window.location = "http://www.conagrafoods.com/consumer/recipes/recipe.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}
if ( address == "www.hunts.com" || address == "dev.hunts.bridgeagency.com"){

	window.location = "http://www.hunts.com/recipe_email.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}

if ( address == "www.eggbeaters.com"){

	window.location = "http://www.eggbeaters.com/recipes/recipeEmail.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}
if ( address == "www.ro-tel.com"){

	window.location = "http://www.ro-tel.com/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}

if ( address == "www.lachoy.com"){

	window.location = "http://www.lachoy.com/recipeEmail.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}

if ( address == "www.reddiwip.com"){

	window.location = "http://www.reddiwip.com/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}

if ( address == "www.pam4you.com"){

	window.location = "http://www.pam4you.com/pages/recipes/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		 

}
if ( address == "www.fleischmanns.com"){

	window.location = "http://www.fleischmanns.com/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		

}
if ( address == "www.parkay.com"){

	window.location = "http://www.parkay.com/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		

}
if ( address == "www.bluebonnet.com"){

	window.location = "http://www.bluebonnet.com/recipes/email-to-friend.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=emailform"
		

}


}

function printfullPage( paramRecipeid ){
if ((paramRecipeid != null) && (paramRecipeid != '')) { recipeid=paramRecipeid; }
if ( address == "www.simpleanddelicious.com"){
	window.location = "http://www.simpleanddelicious.com/find-recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard&paperSize=8_11"

}
if ( address == "www.startmakingchoices.com"){

	window.location = "http://www.startmakingchoices.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.conagrafoods.com"){

	window.location = "http://www.conagrafoods.com/consumer/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
	

}

if ( address == "www.hunts.com" || address == "dev.hunts.bridgeagency.com"){

	window.location = "http://www.hunts.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}

if ( address == "www.eggbeaters.com"){

	window.location = "http://www.eggbeaters.com/recipes/recipe_print.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}

if ( address == "www.eggbeaters.com"){

	window.location = "http://www.eggbeaters.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		 

}
if ( address == "www.ro-tel.com"){

	window.location = "http://www.ro-tel.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}

if ( address == "www.lachoy.com"){

	window.location = "http://www.lachoy.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}

if ( address == "www.reddiwip.com"){

	window.location = "http://www.reddiwip.com/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}
if ( address == "www.pam4you.com"){

	window.location = "http://www.pam4you.com/pages/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}
if ( address == "www.fleischmanns.com"){

	window.location = "http://www.fleischmanns.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.parkay.com"){

	window.location = "http://www.parkay.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.bluebonnet.com"){

	window.location = "http://www.bluebonnet.com/recipes/recipePrint.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

}




function print3x5( paramRecipeid ){
if ((paramRecipeid != null) && (paramRecipeid != '')) { recipeid=paramRecipeid; }	
if ( address == "www.simpleanddelicious.com"){
	window.location = "http://www.simpleanddelicious.com/find-recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"

}
if ( address == "www.startmakingchoices.com"){

	window.location = "http://www.startmakingchoices.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}


if ( address == "www.conagrafoods.com"){

	window.location = "http://www.conagrafoods.com/consumer/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}
if ( address == "www.conagrafoods.com"){

	window.location = "http://www.hunts.com || dev.hunts.bridgeagency.com || hunts/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"

}
if ( address == "www.hunts.com" || address == "dev.hunts.bridgeagency.com"){

	window.location = "http://www.hunts.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		
}

if ( address == "www.eggbeaters.com"){

	window.location = "http://www.eggbeaters.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		 

}
if ( address == "www.ro-tel.com"){

	window.location = "http://www.ro-tel.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		
}

if ( address == "www.lachoy.com"){

	window.location = "http://www.lachoy.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		
}
if ( address == "www.reddiwip.com"){

	window.location = "http://www.reddiwip.com/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		
}
if ( address == "www.pam4you.com"){

	window.location = "http://www.pam4you.com/pages/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		
}
if ( address == "www.fleischmanns.com"){

	window.location = "http://www.fleischmanns.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.parkay.com"){

	window.location = "http://www.parkay.com/recipes/recipePrint3x5.jsp?action="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.bluebonnet.com"){

	window.location = "http://www.bluebonnet.com/recipes/recipePrint3x5.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}


}



function print4x6( paramRecipeid ){
if ((paramRecipeid != null) && (paramRecipeid != '')) { recipeid=paramRecipeid; }	
if ( address == "www.simpleanddelicious.com"){
	window.location = "http://www.simpleanddelicious.com/find-recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"

}
if ( address == "www.startmakingchoices.com"){

	window.location = "http://www.startmakingchoices.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"


}
if ( address == "www.conagrafoods.com"){

	window.location = "http://www.conagrafoods.com/consumer/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

if ( address == "www.hunts.com" || address == "dev.hunts.bridgeagency.com"){

	window.location = "http://www.hunts.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

if ( address == "www.ro-tel.com"){

	window.location = "http://www.ro-tel.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

if ( address == "www.eggbeaters.com"){

	window.location = "http://www.eggbeaters.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		 

}
if ( address == "www.ro-tel.com"){

	window.location = "http://www.ro-tel.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

if ( address == "www.lachoy.com"){

	window.location = "http://www.lachoy.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.pam4you.com"){

	window.location = "http://www.pam4you.com/pages/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}



if ( address == "www.reddiwip.com"){

	window.location = "http://www.reddiwip.com/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}
if ( address == "www.fleischmanns.com"){

	window.location = "http://www.fleischmanns.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

if ( address == "www.parkay.com"){

	window.location = "http://www.parkay.com/recipes/recipePrint4x6.jsp?action="+recipeAction+"&recipeid="+recipeid+"&view=RecipeCard"
		

}

}

