

function popUp(URL)
{
	eval("window.open('" + URL + "','windowName', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=600,height=500');");
}

function sizedPopUp(URL, width, height)
{
eval("window.open('" + URL + "', 'window2', 'width=" + width + ", height=" + height + ", location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');");
}

//http://www.sitepoint.com/article/standards-compliant-world
function externalLinks() 
{
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;


function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature. Use the File menu on your browser to select Print.");
}



function jumpToPage()
{
	var theForm = document.forms['jumptoform'];
	var theValue = theForm.elements['jumpto'].value;
	if(theValue != '') window.location=theValue;
	return;
}

function printJumpToForm(relative)
{
	document.write('<form name="jumptoform" id="jumptoform" action="javascript:jumpToPage();">'
			+	'<select name="jumpto" onchange="javascript:jumptoform.submit();">'
			+		'<option selected="selected" value="">Quick links...</option>'
			+		'<option value="' + relative + '">food2u home page</option>'
			
			//+			'<option value="' + relative + 'homefood/">@home</option>'
			
			+		'<optgroup label="catering">'
			+			'<option value="' + relative + 'catering/menus/bbq/">bbqs</option>'
			+			'<option value="' + relative + 'catering/menus/canapes/">canapes</option>'
			+			'<option value="' + relative + 'catering/menus/tea/">morning &amp; afternoon tea</option>'
			+			'<option value="' + relative + 'catering/menus/desserts/">desserts</option>'
			+			'<option value="' + relative + 'catering/menus/dinner/">dinner</option>'
			+			'<option value="' + relative + 'catering/menus/lunch/">lunch</option>'
			+			'<option value="' + relative + 'catering/menus/platters/">platters</option>'
			+			'<option value="' + relative + 'catering/menus/breakfast/">breakfast</option>'
			+		'</optgroup>'
			+	'</select>'
			+'</form>');
}



/* http://www.pageresource.com/dhtml/ryan/part3-1.html */
function dynamicContent(layerID,txt)
{
	if(document.getElementById)
	{
		document.getElementById(layerID).innerHTML=txt;
	}
	else if(document.all)
	{
		document.all[layerID].innerHTML=txt;
	}
	else if(document.layers)
	{
		with(document.layers[layerID].document)
		{
			open();
			write(txt);
			close();
		}
	}
}
      
function setDescriptor(content)
{
	return dynamicContent('descriptor',content);
}

function resetDescriptor()
{
	return dynamicContent('descriptor','&nbsp;');
}