function openStep(image_loc,img)
{
  width = 640;
  height = 427;
  HTML = "<html><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image '></body></html>";
  popupImage = window.open('','_blank','toolbar=no,scrollbars=no,location=0,width='+width+',height='+height);
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  obj_img = document.getElementById(img);
  //obj_img.src= obj_img.src;
}

function showStep(step)
{ //Steps is a variable defined on the page 
  for (x=1;x <= steps; x++){
     if (x != step){
		hideStep(x);
	 } 
	}
  new Effect.Appear('step'+step); 
}

function hideStep(step)
{ 
	$('step'+step).fade();
}

function getSteps(){
	var i, count = document.getElementsByTagName("SPAN");
	var numSteps = 0;
	for(i = 0; i < count.length; i++){
	    if(count[i].id.match(/^step\d/)){
		   numSteps++;
		}
	}
	return numSteps;
}

function generateFooter(){
	var footer = "";
	var sPath = window.location.pathname;
	var page = sPath.substring(sPath.lastIndexOf('/') + 1);
	var noCopyright=new Array();
	noCopyright[0]="index.htm";
	noCopyright[1]="contact-us-page.htm";
	var copyright='<table width="100%"  border="0" align="left" cellpadding="1" cellspacing="1"><tr align="center"><td colspan="3" align="center" valign="bottom" class="style1">Our recipes are copyright protected. Reproduction of any content or images on this site without the written permission of Anson Mills is prohibited.</td></tr></table>';
	var no_copyright = '';
//	if (noCopyright.indexOf(page) == -1) { footer = copyright; } else { footer = no_copyright; }
if (page.indexOf("recipe") == -1){ footer=no_copyright; } else { footer=copyright; }
	document.write(footer);
}

function image_open(image_loc,img)
{
  HTML = "<html><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+8,document.load_image.height+95)'></body></html>";
  popupImage = window.open('','_blank','toolbar=no,scrollbars=no');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  obj_img = document.getElementById(img);
  //obj_img.src= obj_img.src;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function generateStep(step) {
var text = "";
var photofn = imagePath+'Photo'+step+'.jpg';
if (step == 1) { 
	text = "(View Photo. Click on photo to close)" 
	} else { 
		text = "(View photo)";
		}
var code = '<a href="javascript:showStep('+step+');">'+text+'</a><span id = "step'+step+'" style="position:absolute; z-index:2; display:none;" onClick="hideStep('+step+');"><img src="'+photofn+'"></span>';
	document.write(code);
}

function generateEuropeanButterPopUp(){
	var text = "Standard supermarket butter weighs in at about 80% butterfat. European-style butter, by containing less water, weighs in at around 85%. The increased fat and decreased moisture gives this butter more elasticity and makes it a pleasure to work with. See for yourself by spreading some cold on a cracker--it’s got grip, not slip; wear, not tear. For some recipes, high-fat, low moisture butter is also critical in terms of performance: when working with layers in pastry (like puff) or with shapes you don’t want to spread (like butter cookies), or shrink (like pie dough), or when you want a dough, any dough, to behave and cooperate. A number of European-style butters, many of them made domestically, are available in supermarkets like Whole Foods and other specialty markets. But we find unsalted Plugrá, in its regal gold wrapper, the most reliably fresh and tastiest European-style butter in wide distribution in the United States. Plugrá tastes sweet and fresh—never “off” and performs with real discipline.";
	
	var popUpText="<span class=\"tooltip\" id=\"tip2\">European-style butter</span><script type=\"text/javascript\" language=\"javascript\">new Tip('tip2', \"<span><center><img src='images/illustrations/Plugra.jpg'></center></span><br><div style='font-family: Georgia, Times New Roman, Times, serif; line-height: 150%; font-size: 12px; color : #000; margin-left: 5px; margin-right: 5px; margin-bottom: 5px'>"+text+"</div>\", { width: '400px', border: 3, radius: 3, closeButton: false});</script>";
	document.write(popUpText);
}

function generateFlourPopUp(){
	var text = "<b>Anson Mills Fine Cloth-Bolted Pastry Flour</b> is so fine, so rich in oils, and we pack it so compactly for shipping, that it arrives tamped down and compressed. This explains why a cup of flour scooped from a just-opened bag is heavier than one scooped from a bag that is half full. Such a discrepancy makes cup measurements really problematic for accurate recipe work: the only effective solution is to measure by weight. We recommend weighing ingredients on a digital scale for all of our recipes anyway: it’s cleaner, quicker, and more precise. But, in the case of our pastry flour, it’s also essential. If you simply cannot weigh the flour, to measure by volume, first calculate how many cups you need using this equivalent: 4.7 ounces of Anson Mills Fine Cloth-Bolted Pastry Flour equals 1 cup. Dump the entire bag—whether full or half empty—into a mixing bowl, whisk to lighten and aerate the flour, then use the dip-and-sweep method for measuring: dip a measuring cup into the flour, scoop up a mound, and sweep off the excess with a straight edge. And don’t forget—always store the flour well sealed in the refrigerator or freezer to keep it fresh.";
	
	var popUpText="<span class=\"tooltip\" id=\"tip1\">Anson Mills Fine Cloth-Bolted Pastry Flour</span><script type=\"text/javascript\" language=\"javascript\">new Tip('tip1', \"<span><center><img src='images/scale-small.jpg'></center></span><br><div style='font-family: Georgia, Times New Roman, Times, serif; line-height: 150%; font-size: 12px; color : #000; margin-left: 5px; margin-right: 5px; margin-bottom: 5px'>"+text+"</div>\", { width: '400px', border: 3, radius: 3, closeButton: false});</script>";
	document.write(popUpText);
}
