function login()
	{
		
		if(document.getElementById("username").value=="")
		{
			alert("Please fill in a User Name");
		}
		else if(document.getElementById("password").value=="")
		{
			alert("Please fill in a Password");
		}
		else
		{
			document.loginForm.submit();
		}	
	}
	
	function getProductContent(id,db)
	{
		$("#report").html("");
		
		 $("#contentDiv").html("Please wait loading Product Content...");
		 //alert(id+" DB: "+db)
		  bodyContent = $.ajax({
		  url: "ajax/getAjaxProductContent.php",
		  global: false,
		  type: "POST",
		  data: ({id: id, db:db, date : new Date().getTime()}),
		  dataType: "html",
		  success: function(html){
		  if(html!="")
		  {
				$("#contentDiv").html(html);

		  }
				
		  }
	   }
		).responseText;
	}
	
	function getProductList(ob,div)
	{
		//$("#report").html("");
		var cat = ob.value;
		//alert("Div: "+div+" Cat:"+cat);
		 $("#prod"+div).html("Please wait loading Product List...");
		 $("#pack"+div).html("<input style='width:50px' type='text' name='packSize"+div+"' id='packSize"+div+"'>");
		 //alert(id+" DB: "+db)
		  bodyContent = $.ajax({
		  url: "ajax/getAjaxProductList.php",
		  global: false,
		  type: "POST",
		  data: ({divID:div, cat: cat, date : new Date().getTime()}),
		  dataType: "html",
		  success: function(html){
		  if(html!="")
		  {
				$("#prod"+div).html(html);
		  }
				
		  }
	   }
		).responseText;
	}
	
	
	function getPackSizeList2(ob,divID,cat)
	{
		
		
		getPackSizeList(ob.value,divID,cat);
	}
	
	function getPackSizeList(ob,divID,cat)
	{
	
		//alert("PACK: "+ob+","+divID+","+cat+"+"+document.getElementById("packTD"+divID));
		//document.getElementById("packTD"+divID).innerHTML = "bunny";
		var prodID = ob;//ob.value;
		//alert("Div: "+div+" Cat:"+cat);
		 $("#packTD"+divID).html("Wait...");
		 //alert(id+" DB: "+db)
		  bodyContent = $.ajax({
		  url: "ajax/getAjaxPackSizeList.php",
		  global: false,
		  type: "POST",
		  data: ({divID:divID, cat:cat, prodID: prodID, date : new Date().getTime()}),
		  dataType: "html",
		  success: function(html){
		  if(html!="")
		  {
		  		//alert("packTD"+divID)
		  		document.getElementById("packTD"+divID).innerHTML = html;
				//$("#pack"+divID).html(html);
		  }
				
		  }
	   }
		).responseText;
	}
	
	var myid=1;
	function getMetaData()
	{
		 
		  bodyContent = $.ajax({
		  url: "ajax/getAjaxPageContent.php",
		  global: false,
		  type: "POST",
		  data: ({id: myid, action:"meta",date : new Date().getTime()}),
		  dataType: "html",
		  success: function(html){
		  if(html!="")
		  {
		  	
				$("#metadata").html(html);

		  }
				
		  }
	   }
		).responseText;
	}
	
	function getPageContent(id)
	{
		/*$("#report").html("");
		if(id!=1)
			$("#extraMenu").html("");
		
			
		
		myid=id;
		 $("#contentDiv").html("Please wait loading content...");
		  bodyContent = $.ajax({
		  url: "ajax/getAjaxPageContent.php",
		  global: false,
		  type: "POST",
		  data: ({id: id, date : new Date().getTime()}),
		  dataType: "html",
		  success: function(html){
		  if(html!="")
		  {
		  	
				$("#contentDiv").html(html);*/
				Shadowbox.setup();
				if(id==6 || id==4 || id==11 || id==13)
					getMenu(id);
				if(id==1)
					getMenu("home");
			

		 /* }
				
		  }
	   }
		).responseText;*/
	}
	
	var menuID=0;
	function menuSelect(id)
	{
		symbol = document.getElementById("symbol"+menuID);
		if(id!=menuID && $(symbol).html()=="[-]")
		{
			//CLOSE OLD
			product = document.getElementById("product"+menuID);

			if($(symbol).html()=="[-]")
				$(symbol).html("[+]");
			else
				$(symbol).html("[-]");
			$(product).toggle(500);
		}
		
		
		//OPEN NEW
		menuID=id;
		symbol = document.getElementById("symbol"+id);
		product = document.getElementById("product"+id);
		if($(symbol).html()=="[-]")
			$(symbol).html("[+]");
		else
			$(symbol).html("[-]");
		$(product).toggle(500);
		
	}
	
	

	
	function getMenu(id)
	{
		
		 $("#extraMenu").html("Please wait loading Menu...");
		  bodyContent = $.ajax({
		  url: "ajax/getAjaxMenu.php",
		  global: false,
		  type: "POST",
		  data: ({id: id, date : new Date().getTime()}),
		  dataType: "html",
		  success: function(html){
		  if(html!="")
		  {
		  	
				$("#extraMenu").html(html);
				
		  }
				
		  }
	   }
		).responseText;
	}
	
