
function edit(url){
	window.open(url);
}


/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

/** REFRESH CODE **/

function searchtest(type){
		if(type == 'site'){
			document.search_input.Filter1Value.value = "";
			document.getElementById("site").className = "white";
			document.getElementById("recipes").className = "blue";
			document.getElementById("web").className = "blue";
		}else if(type == 'recipes'){
			document.search_input.Filter1Value.value = "RECIPES";
			document.getElementById("site").className = "blue";
			document.getElementById("recipes").className = "white";
			document.getElementById("web").className = "blue";
		}else if(type == 'web'){
			document.search_input.Filter1Value.value = "yahoo";
			document.getElementById("site").className = "blue";
			document.getElementById("web").className = "white";
			document.getElementById("site").className = "blue";
		}
	}
	
	function dayselect(day){
		document.getElementById("monnav").className = "off";
		document.getElementById("tuenav").className = "off";
		document.getElementById("wednav").className = "off";
		document.getElementById("thunav").className = "off";
		document.getElementById("frinav").className = "off";	
		document.getElementById(day+"nav").className = "on";
		
		document.getElementById("mon").className = "off";
		document.getElementById("tue").className = "off";
		document.getElementById("wed").className = "off";
		document.getElementById("thu").className = "off";
		document.getElementById("fri").className = "off";	
		document.getElementById(day).className = "on";
		
		document.getElementById("monfeat").className = "off";
		document.getElementById("tuefeat").className = "off";
		document.getElementById("wedfeat").className = "off";
		document.getElementById("thufeat").className = "off";
		document.getElementById("frifeat").className = "off";	
		document.getElementById(day+"feat").className = "on";	
	}
	
	function daypicker(){
		var d=new Date();
		var weekday=new Array(7);
		weekday[0]="fri";
		weekday[1]="mon";
		weekday[2]="tue";
		weekday[3]="wed";
		weekday[4]="thu";
		weekday[5]="fri";
		weekday[6]="fri";

		dayselect(weekday[d.getDay()]);
	}
	

	
	
	function ClearSearchField()
	{
	if (document.Search.Query.value == "Start your search here")
		document.Search.Query.value = "";
	}
	
	function RestoreSearchField()
	{
	if (document.Search.Query.value == "")
		document.Search.Query.value = "Start your search here";
	} 
	
	
	function startList() {
		if (document.all && document.getElementById) {
			navRoot = document.getElementById("navul");
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
	
	



var persistmenu="no" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="local" //enter "sitewide" for menu to persist across site, "local" for this page only


function SwitchMenu(obj){
	if (document.all && document.getElementById) {
		navRoot2 = document.getElementById("navul");
		for (i=0; i<navRoot2.childNodes.length; i++) {
			node2 = navRoot2.childNodes[i];
			if (node2.nodeName=="LI" && node2.idName==obj) {
					node2.className+=" over";
			}
		}
	}
}

function get_cookie(Name) { 
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) { 
			offset += search.length
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}

function onloadfunction(){
	if (persistmenu=="yes"){
		var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
		var cookievalue=get_cookie(cookiename)
		if (cookievalue!="") document.getElementById(cookievalue).style.display="block"
	}
	startList();
}

function savemenustate(){
	var inc=1, blockid=""
	while (document.getElementById("sub"+inc)){
		if (document.getElementById("sub"+inc).style.display=="block"){
			blockid="sub"+inc
			break
		}
		inc++
	}
	var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
	var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
	document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener) window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent) window.attachEvent("onload", onloadfunction)
else if (document.getElementById) window.onload=onloadfunction
if (persistmenu=="yes" && document.getElementById) window.onunload=savemenustate

/***********************************************
* Switch Menu script- END
/***********************************************/




/*** PRINT JS ***/
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function isMSExplorer()
{
	var browser = navigator.appName.toLowerCase();
	var MSIE = 0;
	MSIE = (browser.indexOf("netscape") == -1) ? 1:0;
	//document.writeln("Browser is: " + browser);
	//document.writeln("MSIE : " + MSIE); 
	return MSIE
}

function printDialog() {
  if (pr) // NS4, IE5
   //dancy parent.frames[2].print()
   print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  return false;
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

function popupWindow(thePage) {
	popUp = window.open(thePage, '_blank', 'statusbar=no,toolbar=yes,location=no,addressbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,width=600,height=600');
	popUp.focus();
}


