/***************************************************
 * AWD CMS                                         *
 * Client: Mordialloc                              *
 * <http://www.mordialloc.com>                     *
 *                                                 *
 * @author Junwei Cheng <junwei@awebd.com.au>      *
 * @version 1.0                                    *
 * @copyright 2010 AWD <http://www.awebd.com.au>   *
 ***************************************************/
		
	function SwitchMap(str1, str2, str3)
	{ 
	   xmlHttp=GetXmlHttpObject();
	   if (xmlHttp==null)
	   {
		  alert ('Browser does not support HTTP Request');
		  return;
	   }

       var q = "SwitchMap";
   
	   var url='controllers/Ajax.php';	
	   url=url+'?query='+encodeURIComponent(q);	 
	   url=url+'&category_id='+encodeURIComponent(str1);	 
	   url=url+'&business_id='+encodeURIComponent(str2);	
	   url=url+'&type='+encodeURIComponent(str3);	
	   xmlHttp.onreadystatechange=SiteMapStateChanged;
	   xmlHttp.open('GET',url,true);
	   xmlHttp.send(null);
	}

	function SiteMapStateChanged() 
	{ 
	   if (xmlHttp.readyState==4 || xmlHttp.readyState=='complete')
	   { 
		  document.getElementById('mapcontent').innerHTML=xmlHttp.responseText; 
		  initialize_ajax();
	   }
	}	

	function GetXmlHttpObject()
	{
	   var xmlHttp=null;
	   
	   try
	   {
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
	   }
	   catch (e)
	   { 
		  //Internet Explorer
		  try
		  {
			 xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		  }
		  catch (e)
		  {
			 xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
		  }
	   }
	   return xmlHttp;
	} 
