function CreateXmlHttpObject() { //fuction to return the xml http object
		var xmlhttp=false;
		try{
			xmlhttp=new XMLHttpRequest();//creates a new ajax object
		}
		catch(e)	{
			try{
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");//this is for IE browser
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");//this is for IE browser
				}
				catch(e1){
					xmlhttp=false;//error creating object
				}
			}
		}

		return xmlhttp;
	}
//image verification
function reset_captcha() {
document.getElementsByName("captcha").value="";
with(document.getElementById('imgCaptcha')) {
	src = "";
	src = 'captcha.php?' + Math.random();
}
}

function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
    document.getElementById( id ).style.background="#33CC00";

}

function changeMenu(type){
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object
	document.getElementById('leftDisplay').innerHTML = "";
	//alert("Type is " + type);
	if (main)
     {
      main.onreadystatechange = function()
     {

	 		if(main.readyState == 0) { document.getElementById('menu').innerHTML = 'Busy...';

  }
			if(main.readyState == 1) { document.getElementById('menu').innerHTML = 'Busy...'; }
			if(main.readyState == 2) { document.getElementById('menu').innerHTML = 'Busy...'; }
		    if(main.readyState == 3) { document.getElementById('menu').innerHTML = 'Busy...'; }



      if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
         document.getElementById('menu').innerHTML=main.responseText;//put the results of the requests in or element
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }
		//alert("Type in change menu is " + type);
		var url = "change_menu.php";
		var params = "&type=" + type;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
	}
	}

function checkAll(field) {
	for (i = 0; i < field.length; i++)
	field[i].checked = true;
}

function onloadfunct(form) {
  var main = CreateXmlHttpObject(); // fuction to get xmlhttp object
  if (main)
     {
      main.onreadystatechange = function()
     {

	 		if(main.readyState == 0) { document.getElementById('mainDisplay').innerHTML = 'Busy...';

  }
			if(main.readyState == 1) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
			if(main.readyState == 2) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
		    if(main.readyState == 3) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }



      if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
         document.getElementById('mainDisplay').innerHTML=main.responseText;//put the results of the requests in or element
         displayInfo();
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }





	main.open("GET", form ,true);
    main.send(null);
     }
	 }

function displayPage(form) {
  var main = CreateXmlHttpObject(); // fuction to get xmlhttp object
  if (main)
     {
      main.onreadystatechange = function()
     {

	 		if(main.readyState == 0) { document.getElementById('mainDisplay').innerHTML = 'Busy...';

  }
			if(main.readyState == 1) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
			if(main.readyState == 2) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
		    if(main.readyState == 3) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }



      if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
         document.getElementById('mainDisplay').innerHTML=main.responseText;//put the results of the requests in or element
         displayInfo();
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }





	main.open("GET", form ,true);
    main.send(null);
     }
	 }

function displayInfo() { //dropdown for provinces
  var main = CreateXmlHttpObject(); // fuction to get xmlhttp object
  if (main)
     {
      main.onreadystatechange = function()
     {

             if(main.readyState == 0) { document.getElementById('province').innerHTML = 'Busy...';

  }
            if(main.readyState == 1) { document.getElementById('province').innerHTML = 'Busy...'; }
            if(main.readyState == 2) { document.getElementById('province').innerHTML = 'Busy...'; }
            if(main.readyState == 3) { document.getElementById('province').innerHTML = 'Busy...'; }



      if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status

         document.getElementById('province').innerHTML=main.responseText;//put the results of the requests in or element
         document.getElementById('town').innerHTML='<select id=\'townid\' class=\'input1\'><option value=\'all\'>All Towns</option></select>';
         document.getElementById('area').innerHTML='<select id=\"areaID\" class=\"input1\"><option value=\"all\">All Areas</option></select>';
         if (document.getElementById('category').innerHTML== '') {
         	getCats();
         }

         //getTown();







      }
      else
      {
         alert("There was a problem while using XMLHTTP");
      }
      }
      }

		var province = "yes";
		var url = "area_select.php";
		var params = "&province=" + province;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
     }
     }


	function getTown(){
	if (document.getElementById('provinceid').value == "all") {
		displayInfo();
	}
	var town = CreateXmlHttpObject(); // fuction to get xmlhttp object
	if (document.getElementById('leftDisplay')) {
		document.getElementById('leftDisplay').innerHTML = "";
	}
	if (document.getElementById('rightDisplay')) {
		document.getElementById('rightDisplay').innerHTML = "";
	}



	if (town)
     {
      town.onreadystatechange = function()
     {

	 		if(town.readyState == 0) { document.getElementById('town').innerHTML = 'Busy...';

  }
			if(town.readyState == 1) { document.getElementById('town').innerHTML = 'Busy...'; }
			if(town.readyState == 2) { document.getElementById('town').innerHTML = 'Busy...'; }
		    if(town.readyState == 3) { document.getElementById('town').innerHTML = 'Busy...'; }



      if (town.readyState == 4) { //data is retrieved from server
       if (town.status == 200) { // which reprents ok status
         document.getElementById('town').innerHTML=town.responseText;//put the results of the requests in or element
         //getArea();
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }
      	var provinceid = document.getElementById('provinceid').value;
		//alert("P is " + provinceid);
		var townpage = "yes";
		var url = "area_select.php";
		var params = "&townpage=" + townpage + "&provinceid=" + provinceid;
		town.open("POST", url, true);
		//Send the proper header information along with the request
		town.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		town.setRequestHeader("Content-length", params.length);
		town.setRequestHeader("Connection", "close");
    	town.send(params);//send the results
	}
	}

function getArea(){
	var town = CreateXmlHttpObject(); // fuction to get xmlhttp object
	if (town)
     {
      town.onreadystatechange = function()
     {

	 		if(town.readyState == 0) { document.getElementById('area').innerHTML = 'Busy...';

  }
			if(town.readyState == 1) { document.getElementById('area').innerHTML = 'Busy...'; }
			if(town.readyState == 2) { document.getElementById('area').innerHTML = 'Busy...'; }
		    if(town.readyState == 3) { document.getElementById('area').innerHTML = 'Busy...'; }



      if (town.readyState == 4) { //data is retrieved from server
       if (town.status == 200) { // which reprents ok status
         document.getElementById('area').innerHTML=town.responseText;//put the results of the requests in or element
         //getCats();
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }


		var town_id = document.getElementById('townid').value;
		//alert("town id is " + town_id);
		var areapage = "yes";
		var url = "area_select.php";
		var params = "&areapage=" + areapage + "&town_id=" + town_id;
		town.open("POST", url, true);
		//Send the proper header information along with the request
		town.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		town.setRequestHeader("Content-length", params.length);
		town.setRequestHeader("Connection", "close");
    	town.send(params);//send the results
	}
	}

function getCats() {
	//alert("By fokken cats");
	var cats = CreateXmlHttpObject(); // fuction to get xmlhttp object
	if (cats)
     {
      cats.onreadystatechange = function()
     {

	 		if(cats.readyState == 0) { document.getElementById('category').innerHTML = 'Busy...';

  }
			if(cats.readyState == 1) { document.getElementById('category').innerHTML = 'Busy...'; }
			if(cats.readyState == 2) { document.getElementById('category').innerHTML = 'Busy...'; }
		    if(cats.readyState == 3) { document.getElementById('category').innerHTML = 'Busy...'; }



      if (cats.readyState == 4) { //data is retrieved from server
       if (cats.status == 200) { // which reprents ok status
         document.getElementById('category').innerHTML=cats.responseText;//put the results of the requests in or element
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

		var catspost = "yes";
		var url = "area_select.php";
		var params = "&catspost=" + catspost;
		cats.open("POST", url, true);
		//Send the proper header information along with the request
		cats.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		cats.setRequestHeader("Content-length", params.length);
		cats.setRequestHeader("Connection", "close");
    	cats.send(params);//send the results
	}
	}

function displayLeft(){
	var bizzlist = CreateXmlHttpObject(); // fuction to get xmlhttp object
	document.getElementById('mainDisplay').innerHTML = "";
	document.getElementById('rightDisplay').innerHTML = "";
	if (bizzlist)
     {
      bizzlist.onreadystatechange = function()
     {

	 		if(bizzlist.readyState == 0) { document.getElementById('leftDisplay').innerHTML = 'Busy...';

  }
			if(bizzlist.readyState == 1) { document.getElementById('leftDisplay').innerHTML = 'Busy...'; }
			if(bizzlist.readyState == 2) { document.getElementById('leftDisplay').innerHTML = 'Busy...'; }
		    if(bizzlist.readyState == 3) { document.getElementById('leftDisplay').innerHTML = 'Busy...'; }



      if (bizzlist.readyState == 4) { //data is retrieved from server
       if (bizzlist.status == 200) { // which reprents ok status
         document.getElementById('leftDisplay').innerHTML=bizzlist.responseText;//put the results of the requests in or element
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }
      	var prov = document.getElementById('provinceid').value;
      	var town = document.getElementById('townid').value;
		var area = document.getElementById('areaID').value;
		var category = document.getElementById('catsid').value;
		var url = "bizz_list.php";
		var params = "&prov=" + prov + "&town=" + town + "&area=" + area + "&category=" +category;
		bizzlist.open("POST", url, true);
		//Send the proper header information along with the request
		bizzlist.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		bizzlist.setRequestHeader("Content-length", params.length);
		bizzlist.setRequestHeader("Connection", "close");
    	bizzlist.send(params);//send the results
	}
	}

	function bizzRight(rowid){
	var bizzRight = CreateXmlHttpObject(); // fuction to get xmlhttp object
	if (bizzRight)
     {
      bizzRight.onreadystatechange = function()
     {

	 		if(bizzRight.readyState == 0) { document.getElementById('rightDisplay').innerHTML = 'Busy...';

  }
			if(bizzRight.readyState == 1) { document.getElementById('rightDisplay').innerHTML = 'Busy...'; }
			if(bizzRight.readyState == 2) { document.getElementById('rightDisplay').innerHTML = 'Busy...'; }
		    if(bizzRight.readyState == 3) { document.getElementById('rightDisplay').innerHTML = 'Busy...'; }



      if (bizzRight.readyState == 4) { //data is retrieved from server
       if (bizzRight.status == 200) { // which reprents ok status

         document.getElementById('rightDisplay').innerHTML=bizzRight.responseText;//put the results of the requests in or element
         document.getElementById('rightdisplay').focus;
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }
		var url = "bizz_list_right.php";
		var params = "&rowid=" + rowid;
		bizzRight.open("POST", url, true);
		//Send the proper header information along with the request
		bizzRight.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		bizzRight.setRequestHeader("Content-length", params.length);
		bizzRight.setRequestHeader("Connection", "close");
    	bizzRight.send(params);//send the results
	}
	}

// login validation
function validate() {
if(document.getElementById('user').value =="") {alert("Please enter your user to continue...");document.getElementById('user').focus();return false;}
if(document.getElementById('pass').value =="") {alert("Please enter a password code.");document.getElementById('pass').focus();return false;}
if(document.getElementById('captcha').value =="") {alert("Please enter verification code.");document.getElementById('captcha').focus();return false;}
var main = CreateXmlHttpObject(); // fuction to get xmlhttp object
if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
       	if (main.responseText == "Not") {
			alert("The verify code is wrong, please try again");
         	reset_captcha();
         } else if (main.responseText == "db") {
         	alert("Could not process your login, please try again");
         } else if (main.responseText == "user") {
         	alert("User name is incorrect");
         } else if (main.responseText == "pass") {
         	alert("Password is not correct");
         } else {
			var user = document.getElementById('user').value;
			var pass = document.getElementById('pass').value;
			var type = "home"; //display home page and not events page
			displayMemberPage(type);

         }
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var user = document.getElementById('user').value;
      	var pass = document.getElementById('pass').value;
   		var captcha = document.getElementById('captcha').value;
		var url = "login_post.php";
		var params = "&user=" + user + "&pass=" + pass + "&captcha=" + captcha;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
}
// display memberpage
function displayMemberPage(type) {
var main = CreateXmlHttpObject(); // fuction to get xmlhttp object

if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
       	//document.getElementById('mainDisplay').innerHTML = fck.CreateHtml();
       	document.getElementById('mainDisplay').innerHTML=main.responseText; //display the member menu in mainDisplay div
       	document.getElementById('leftDisplay').innerHTML= "";

      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }
		var page = "yes";
		var url = "member_menu.php";
		var params = "&page=" + page + "&type=" + type;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
}
//insert or update fckeditor data
function updateData() {
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object

if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
        if (main.responseText == "y") {
       	alert("Home page updated"); //display result from fckeditor update
       	displayMemberPage('home');


       	} else {
       	alert("Home page could not be updated please try again.\n"); //display result from fckeditor update
       	displayMemberPage('home');


       	}
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var content = escape(FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML());
      	var update = "yes";
		var url = "member_menu.php";
		var params = "&update=" + update + "&content=" + content;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
}

function insertEvent() {
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object

if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
        if (main.responseText == "y") {
       	alert("Event added"); //display result from fckeditor update
       	displayMemberPage('event');


       	} else {
       	alert("Event could not be added please try again.\n"); //display result from fckeditor update
       	displayMemberPage('event');


       	}
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var content = escape(FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML());
		var date = document.getElementById('date').value;
		var date1 = document.getElementById('date2').value;
		var eventname = document.getElementById('eventname').value;
      	var insertevent = "yes";
		var url = "member_menu.php";
		var params = "&insertevent=" + insertevent + "&content=" + content + "&date=" + date + "&date1=" + date1 + "&event=" + eventname;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
}

function updateEvent() {
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object

if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
        if (main.responseText == "y") {
       	alert("Event updated"); //display result from fckeditor update
       	//displayMemberPage('event');


       	} else {
       	alert("Event could not be updated please try again.\n"); //display result from fckeditor update
       	//displayMemberPage('event');


       	}

      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var content1 = FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML();
      	var content = escape(FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML());
		var eventid = document.getElementById('current_events').value;
		var updateevent = "yes";
		var url = "member_menu.php";
		var params = "&updateevent=" + updateevent + "&eventid=" + eventid + "&content=" + content;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
}

function updatecatBizz() {
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object

if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status

        if (main.responseText == "y") {
       	alert("Category updated.\n"); //display result from fckeditor update
       	} else {
       	alert("Category could not be updated please try again.\n");
       	}
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var catupdate = document.getElementById('cat_name').value;
      	var url = "member_menu.php";
		var params = "&catupdate=" + catupdate;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
}

function showEvent() {
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object
	if (document.getElementById('current_events').value == "none") {
	alert("Please select an event");
		} else {
if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
       	document.getElementById('leftDisplay').innerHTML=main.responseText; //display result from fckeditor update

      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var displayevent = document.getElementById('current_events').value;
      	var url = "member_menu.php";
		var params = "&displayevent=" + displayevent;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}
    }//end if
}

function deleteEvent() {
	var main = CreateXmlHttpObject(); // fuction to get xmlhttp object

if (main) {
	main.onreadystatechange = function() {
if (main.readyState == 4) { //data is retrieved from server
       if (main.status == 200) { // which reprents ok status
       	document.getElementById('results').innerHTML=main.responseText; //display result from fckeditor update
       	document.getElementById('leftDisplay').innerHTML="";
       	alert("Event deleted");
       	displayMemberPage('event');

      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

      	var deleteEvent = document.getElementById('current_events').value;
      	var url = "member_menu.php";
		var params = "&deleteEvent=" + deleteEvent;
		main.open("POST", url, true);
		//Send the proper header information along with the request
		main.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		main.setRequestHeader("Content-length", params.length);
		main.setRequestHeader("Connection", "close");
    	main.send(params);//send the results
    	}

}

function displayLogin(){
	var login = CreateXmlHttpObject(); // fuction to get xmlhttp object
	document.getElementById('leftDisplay').innerHTML = "";
	document.getElementById('rightDisplay').innerHTML = "";
	if (login)
     {
      login.onreadystatechange = function()
     {

	 		if(login.readyState == 0) { document.getElementById('mainDisplay').innerHTML = 'Busy...';

  }
			if(login.readyState == 1) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
			if(login.readyState == 2) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
		    if(login.readyState == 3) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }



      if (login.readyState == 4) { //data is retrieved from server
       if (login.status == 200) { // which reprents ok status
         document.getElementById('mainDisplay').innerHTML=login.responseText;//put the results of the requests in or element
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

		var url = "login.php";
		var params = "yes";
		login.open("POST", url, true);
		//Send the proper header information along with the request
		login.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		login.setRequestHeader("Content-length", params.length);
		login.setRequestHeader("Connection", "close");
    	login.send(params);//send the results
	}
	}
	function checkCardUser()
{

		if (document.getElementById('bizzname').value == "") {
			alert("Please supply a business name");
			return;
		}
		else
		if (document.getElementById('user').value == "") {
			alert("Please supply a user name");
			return;
		}
		else
		if (document.getElementById('pass').value != document.getElementById('pass2').value) {
			alert("Passwords do not match");
			return;
		}
		else
		if (document.getElementById('pass').value == "" || document.getElementById('pass2').value == "") {
			alert("Please supply password in both fields");
			return;
		}
		else
		if (document.getElementById('province').value == "all") {
			alert("Please select a province");
			return;
		}
		var cUser = CreateXmlHttpObject(); // fuction to get xmlhttp object
		if (cUser)
     {
      cUser.onreadystatechange = function()
     {

	 		if(cUser.readyState == 0) { document.getElementById('mainDisplay').innerHTML = 'Busy...';

  }
			if(cUser.readyState == 1) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
			if(cUser.readyState == 2) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }
		    if(cUser.readyState == 3) { document.getElementById('mainDisplay').innerHTML = 'Busy...'; }



      if (cUser.readyState == 4) { //data is retrieved from server
       if (cUser.status == 200) { // which reprents ok status
         document.getElementById('mainDisplay').innerHTML=cUser.responseText;//put the results of the requests in or element
      }
      else
      {
         alert("There was a problem while using XMLHTTP:\n");
      }
      }
      }

		var url = "cUser.php";
		var bizzname = document.getElementById('bizzname').value;
		var user = document.getElementById('user').value;
		var params = "bizz=" + bizzname + "&user=" + user;
		cUser.open("POST", url, true);
		//Send the proper header information along with the request
		cUser.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		cUser.setRequestHeader("Content-length", params.length);
		cUser.setRequestHeader("Connection", "close");
    	cUser.send(params);//send the results
	}

}
