// Retrieve xml data
// Michael Nawrocki revised 2-10-2009

var xmlhttp;
var ia;
var im;

function display_nav_items(ii)
{

xmlhttp=null;
ia = null;
im = null;
ia = ii;

if (window.XMLHttpRequest)
  {  // code for IE7, Firefox, Mozilla, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {  // code for IE5, IE6
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }


if (xmlhttp!=null)
  {

  xmlhttp.onreadystatechange=load_labels;
  xmlhttp.open("GET","xml/menu.xml",true);
  xmlhttp.send(null);

  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }

}


function load_labels() //Load the Navigation labels and links
{

var tagname = "";
var navlabel = "";
var linkref = "";
var txt = "";

     if(xmlhttp.readyState!=4) return;
     if(xmlhttp.status!=200)
          {
          alert("Problem retrieving XML data");
          return;
          }
	
	var x=xmlhttp.responseXML.documentElement.getElementsByTagName("nav");
		for (i=0;i<x.length;i++)
			{
			tagname=(x[i].getElementsByTagName("tagname")[0].childNodes[0].nodeValue);
			navlabel=(x[i].getElementsByTagName("navlabel")[0].childNodes[0].nodeValue);
			linkref=(x[i].getElementsByTagName("linkref")[0].childNodes[0].nodeValue);

				if (navlabel != "null")
					{
						txt="<a href=" + linkref + ">" + navlabel + "</a>";
					}
				else
					{
						txt="";
					}

			document.getElementById(tagname).innerHTML=txt;

			}
	
// end of display_nav_items

  xmlhttp.abort();
  {

  xmlhttp.onreadystatechange=load_main;
  xmlhttp.open("GET","txt/mainpage.txt",false);
  xmlhttp.send(null);

  }

}
function load_main()
{
     if(xmlhttp.readyState!=4) return;
     if(xmlhttp.status!=200)
          {
          alert("Problem retrieving XML data");
          return;
          }

//	document.getElementById('menugrid').innerHTML="";
	document.getElementById('infoblock').innerHTML="";
	 	
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","txt/mainpage.txt",false);
xmlhttp.send(null);

	//	alert(xmlhttp.responseText)
	
		 document.getElementById('infoblock').innerHTML=xmlhttp.responseText;

  xmlhttp.abort();

}	

function reload_main()
{

	document.getElementById('menugrid').innerHTML="";
	document.getElementById('infoblock').innerHTML="";
	 	
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","txt/mainpage.txt",false);
xmlhttp.send(null);

	//	alert(xmlhttp.responseText)
	
		 document.getElementById('infoblock').innerHTML=xmlhttp.responseText;

  xmlhttp.abort();

}	

function load_menu()  // Load the menu file
{
	
	if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
xmlhttp.open("GET","xml/fmenu.xml",false);
xmlhttp.send(null);

	
var xtxt = "";
var ip;
txt = "";
var txt1 = "";
	
		txt = "<table border='0'><th></th><th></th><th></th>";

		var x = xmlhttp.responseXML.documentElement.getElementsByTagName("fitem");

		for (i=0; i<x.length; i++)
			{ 
			
			  txt1 = (x[i].getElementsByTagName("ftitle")[0].childNodes[0].nodeValue);
			
				xtxt = (x[i].getElementsByTagName("fprice")[0].childNodes[0].nodeValue);

				if (xtxt != "null")
					{
      			txt += "<tr><td colspan='2' class='menuline' >" + txt1 + "</td>";
			      //txt += "</td><td></td>";
					  txt += "<td class='menuprice'>" + xtxt + "</td>";
					  txt += "</tr>";
					}
				else
					{
      			txt += "<tr><td colspan='3' class='menuhead'>" + txt1 + "</td></tr>";
			      //txt += "</td><td></td>";
					  //txt += "<td class='menuprice'>" + xtxt + "</td>";
					  //txt += "</tr>";						
				  }
      }
		 txt += "</table>";
		 //alert(txt);
		 document.getElementById('infoblock').innerHTML="";
		 document.getElementById('menugrid').innerHTML=txt;

// end of load_menu

  xmlhttp.abort();

}

function load_special()  // Load the specials file
{
	
	if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
xmlhttp.open("GET","xml/smenu.xml",false);
xmlhttp.send(null);

	
var txt_price1 = "";
var ip;
txt = "";
var txt1 = "";
var txt_price2 = "";
	
		txt = "<table border='0'><th></th><th></th><th></th>";

		var x = xmlhttp.responseXML.documentElement.getElementsByTagName("fitem");

		for (i=0; i<x.length; i++)
			{ 
			
			  txt1 = (x[i].getElementsByTagName("ftitle")[0].childNodes[0].nodeValue);
			
				txt_price1 = (x[i].getElementsByTagName("fprice1")[0].childNodes[0].nodeValue);

				if (txt_price1 != "null")
					{
      			txt += "<tr><td class='menuline' >" + txt1 + "</td>";
					  txt += "<td class='menuprice'>" + txt_price1 + "</td>";

							txt_price2 = (x[i].getElementsByTagName("fprice2")[0].childNodes[0].nodeValue);
			
							if (txt_price2 != "null")
								{
					  			txt += "<td class='menuprice'>" + txt_price2 + "</td>";
								}
					  txt += "</tr>";
					}
				else
					{
      			txt += "<tr><td colspan='3' class='menuhead'>" + txt1 + "</td></tr>";
				  }
      }
		 txt += "</table>";
		 document.getElementById('infoblock').innerHTML="";
		 document.getElementById('menugrid').innerHTML=txt;

// end of load_menu

  xmlhttp.abort();

}

function load_about()
{

	document.getElementById('menugrid').innerHTML="";
	document.getElementById('infoblock').innerHTML="";
	 	
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","txt/about.txt",false);
xmlhttp.send(null);

	//	alert(xmlhttp.responseText)
	
		 document.getElementById('infoblock').innerHTML=xmlhttp.responseText;

  xmlhttp.abort();

}	

function load_prod()
{

	document.getElementById('menugrid').innerHTML="";
	document.getElementById('infoblock').innerHTML="";
	 	
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","txt/product.txt",false);
xmlhttp.send(null);

	//	alert(xmlhttp.responseText)
	
		 document.getElementById('infoblock').innerHTML=xmlhttp.responseText;

  xmlhttp.abort();

}	

