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;
	}


function get_breed_list(breed_type)
{
	var aurl="http://www.pet2date.com/";
var startindex, endindex, arr_result;
	xmlHttp1=GetXmlHttpObject();
				if (xmlHttp1==null)
				{
					 alert ("Your browser does not support AJAX!");
				  	 return;
				}

				function stateChanged()
				{
					if(xmlHttp1.readyState==4)
					{
						arr_result=xmlHttp1.responseText;
						

startindex=arr_result.indexOf('<select');
endindex=arr_result.indexOf('</body>');
endindex--;

arr_result=arr_result.substring(startindex, endindex);


document.getElementById('breedlist_home').innerHTML=arr_result;

					}
				}
				var url=aurl+"index2.php?option=com_registration&task=outputbreed&pet_type="+breed_type;
			

				xmlHttp1.onreadystatechange=stateChanged;
				xmlHttp1.open("GET",url,true);
				xmlHttp1.send(null);

}


function get_breed_list_search(breed_type, selected_breed)
{
 
	var aurl="http://www.pet2date.com/";
var startindex, endindex, arr_result;
	xmlHttp1=GetXmlHttpObject();
				if (xmlHttp1==null)
				{
					 alert ("Your browser does not support AJAX!");
				  	 return;
				}

				function stateChanged()
				{
					if(xmlHttp1.readyState==4)
					{
						arr_result=xmlHttp1.responseText;
						

startindex=arr_result.indexOf('<select');
endindex=arr_result.indexOf('</body>');
endindex--;

arr_result=arr_result.substring(startindex, endindex);

document.getElementById('breedforsearch').innerHTML=arr_result;

					}
				}
				var url=aurl+"index2.php?option=com_registration&task=outputbreed&pet_type="+breed_type+"&selected_breed="+selected_breed;

				xmlHttp1.onreadystatechange=stateChanged;
				xmlHttp1.open("GET",url,true);
				xmlHttp1.send(null);

}


