// JavaScript Document

function ajaxget(url,action) 
{
var xmlHttp; 
var isie;

 isie=true;

try {
	// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	    isie=false;
    } 
    catch (e) {
	// Internet Explorer
	try {
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	      } catch (e)  {
		try {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	      	} 
	            catch (e) {
			alert("Your browser does not support AJAX!");
			return false;
	           		}
		  }
    }


xmlHttp.onreadystatechange=function() {
	  if(xmlHttp.readyState==4) { 
		// This is where the functional code goes
		switch (action) {
		case 1:
		//	document.getElementById("pricesdiv").innerHTML=xmlHttp.responseText ; 			
			break;
		case 2:
			return ( xmlHttp.responseText );
			break;
		}

        responsetext =  xmlHttp.responseText ;

		// return the text
	  } 
} 

if (url.indexOf('?')>0) {
	url = url+'&'+Math.random(100);
} else {
	url = url+'?'+Math.random(100);
}


if (action==0 || isie ) {
	// Asynchronous get does not seem to work with Firefox so do it this way!
	xmlHttp.open("GET",url,false); 
} else {
	xmlHttp.open("GET",url,true); 
}

xmlHttp.send(null);

return ( xmlHttp.responseText  );


} 


