var submit_search = false;

function SetStatusBar( txt )
{
    self.status = txt
}
function navRoll(what){
	document.getElementById('NavL'+what).style.backgroundImage="url(images/nav/nav_left_over.gif)";
	document.getElementById('NavR'+what).style.backgroundImage="url(images/nav/nav_right_over.gif)";
	document.getElementById('NavM'+what).style.backgroundImage="url(images/nav/nav_item_bg_over.gif)";
}
function navRollOut(what){
	document.getElementById('NavL'+what).style.backgroundImage="url(images/nav/nav_left.gif)";
	document.getElementById('NavR'+what).style.backgroundImage="url(images/nav/nav_right.gif)";
	document.getElementById('NavM'+what).style.backgroundImage="url(images/nav/nav_item_bg.gif)";
}
function subNavRoll(what){
	document.getElementById('NavL'+what).style.backgroundImage="url(images/nav/sub_nav_left_over.gif)";
	document.getElementById('NavR'+what).style.backgroundImage="url(images/nav/sub_nav_right_over.gif)";
	document.getElementById('NavM'+what).style.backgroundImage="url(images/nav/sub_nav_item_bg_over.gif)";
}
function subNavRollOut(what){
	document.getElementById('NavL'+what).style.backgroundImage="url(images/nav/sub_nav_left.gif)";
	document.getElementById('NavR'+what).style.backgroundImage="url(images/nav/sub_nav_right.gif)";
	document.getElementById('NavM'+what).style.backgroundImage="url(images/nav/sub_nav_item_bg.gif)";
}

function SubmitSearch(){
	
	window.location = "/menupalace/search.aspx?st=" + escape( document.forms[0].elements["SearchTerm"].value );
}

function SubmitCategorySearch(){
	window.location = "/menupalace/categorysearch.aspx?cat1=" + escape( document.forms[0].elements["ctl00_mpheader_catsearch_catSearchDistricts"].value ) + "&cat2=" + escape( document.forms[0].elements["ctl00_mpheader_catsearch_catSearchCuisines"].value ) + "&cat3=" + escape( document.forms[0].elements["ctl00_mpheader_catsearch_catSearchEstablishmentTypes"].value );
}

function GetURL()
{
	var url = "" + window.location;
	
	var index = url.indexOf( "?" );
	
	if ( index != -1 )
		url = url.substring( 0, index );
		
	return url;
}

function SearchKeyPress()
{
	if ( event.keyCode == 13 )
		submit_search = true;
}

function FormSubmit()
{
	if ( submit_search == true )
	{
		SubmitSearch();
		return false;
	}
	else
		return true;
}

function putFlash( fName, Width, Height )
{
	 if( !fName || !Width || !Height )
	 {
		return;
	 }
	 
	 var Objstr = '';
	 Objstr += '\n<object style="display:block" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + Width + '" height="' + Height + '">';
	 Objstr += '\n<param name="movie" value="' + fName + '"/>';
	 Objstr += '\n<param name="quality" value="high"/>';
	 Objstr += '\n<param name="bgcolor" value="#000000">';
	 Objstr += '\n<param name="wmode" value="transparent">';
	 Objstr += '\n<embed src="' + fName + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
	 Objstr += ' type="application/x-shockwave-flash" wmode="transparent" width="' + Width + '" height="' + Height + '"';
	 Objstr += '></embed>';
	 Objstr += '\n</object>';
	 
	 document.write(Objstr);
}

function mpPopup(url, name, width, height){
	popwin = this.open(url, name, "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,noresize,topmargin=0,marginheight=0,marginwidth=0,leftmargin=0");
	popwin.focus()
}

function mpScrollableResizablePopup(url, name, width, height){
	popwin = this.open(url, name, "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,location=no,scrollbars=yes,resize=yes,topmargin=0,marginheight=0,marginwidth=0,leftmargin=0");
	popwin.focus()
}

function PreloadImages(){
	//MM_preloadImages('images/nav/gift_certificate_over.gif','images/nav/features_over.gif','images/nav/employment_over.gif','images/nav/internet_services_over.gif','images/nav/owners_over.gif','images/nav/contact_us_over.gif','images/buttons/promo_egift_over.gif','images/butttons/list_your_button_over.jpg');
	MM_preloadImages('images/buttons/promo_egift_over.gif','images/nav/nav_item_bg_over.gif','images/nav/nav_right_over.gif','images/nav/nav_left_over.gif','images/nav/sub_nav_left_over.gif','images/nav/sub_nav_right_over.gif','images/nav/sub_nav_item_bg_over.gif','images/buttons/promo_egift_over.gif','images/buttons/list_your_button_over.jpg');
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
 var obj = MM_findObj(objName); if (obj) obj.value = newText;}