

/* function writeBanner() is called by the masthead.inc file.
It writes the swf <object> so there's no "click to activate" message. */

function writeBanner() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="413" height="101" id="RecipeBannerFade" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="banner/RecipeBannerFade.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="banner/RecipeBannerFade.swf" quality="high" bgcolor="#000000" width="413" height="101" name="RecipeBannerFade" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function checkAllCheckboxesIn(containerID, checked) {
	inputsArray = document.getElementById(containerID).getElementsByTagName('input');
	for(i=0;i<inputsArray.length;i++) {
		inputsArray[i].checked=checked;
	}
}


// global vars
var popupWin;
var scrnwidth=screen.width;
var scrnheight=screen.height;

// "only 1 open at a time" popup function.
//-----------------------------------------------------------------------------
// The fifth argument, windowname, is optional.  If specified, it is passed as
// the second argument to window.open().  This is required in order to leave
// the popup opener page (without closing the popup), come back to it, and NOT
// have a duplicate popup window.
//-----------------------------------------------------------------------------
function openPop (url, width, height, addloptions, windowname) {
	if (windowname == null) {
		windowname = "";
	}
	var xspot = Math.round((scrnwidth/2)-(width/2));
	var yspot = Math.round((scrnheight/2)-(height/2)-30);
	features = "height="+height+",width="+width+",top="+yspot+",screenY="+yspot+",left="+xspot+",screenX="+xspot;
	if (addloptions && addloptions!="") { features += ","+addloptions; }
	if (!popupWin || popupWin.closed) {
		popupWin = window.open(url, windowname, features);
	}
	else {
		window.popupWin.close();
		popupWin = window.open(url, windowname, features);
	}
}



function openVideoGalleryPopup(url) { 
	openPop(url, 780, 620, 'scrollbars,resizable'); 
	} 

