var newXmlHttp;
var divId="";
var txt='';
var baseprice ;
function ajaxLink(url,did)
{
	divId=did;
	//$id('topbar').style.display='';	
	newXmlHttp=GetnewXmlHttpObject();
	if (newXmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	if(url.indexOf("?")!=-1)
	url=url+"&stid="+Math.random();
	else
	url=url+"?stid="+Math.random();
	//alert(url);
	newXmlHttp.onreadystatechange=newStateChanged ;
	newXmlHttp.open("GET",url,true);
	newXmlHttp.send(null);
} 

function newStateChanged()
{ 
	if (newXmlHttp.readyState==4 || newXmlHttp.readyState=="complete")
	{ 
	//alert(divId);
	//alert(newXmlHttp.responseText);
	$id(divId).innerHTML=newXmlHttp.responseText ;	
	//$id('topbar').style.display='none';	
	}
}



///////////////////////////////////genreral ajax

function ajaxshow(url,did)
{
	divId=did;
	showXmlHttp=GetnewXmlHttpObject();
	if (showXmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	if(url.indexOf("?")!=-1)
	url=url+"&sid="+Math.random();
	else
	url=url+"?sid="+Math.random();
	showXmlHttp.onreadystatechange=showStateChanged ;
	showXmlHttp.open("GET",url,true);
	showXmlHttp.send(null);
} 

function showStateChanged()
{ 

	if (showXmlHttp.readyState==4 || showXmlHttp.readyState=="complete")
	{ 
		$id(divId).innerHTML=showXmlHttp.responseText ;	
	}
} 

///////////////////////////////////End genreral ajax
//////////////////////////////ajaxAlert
function ajaxAlert(url)
{
	//$id('topbar').style.display='';	
	newXmlHttp=GetnewXmlHttpObject();
	if (newXmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	if(url.indexOf("?")!=-1)
	url=url+"&sid="+Math.random();
	else
	url=url+"?sid="+Math.random();
	//alert(url);
	newXmlHttp.onreadystatechange=alertStateChanged ;
	newXmlHttp.open("GET",url,true);
	newXmlHttp.send(null);
} 

function alertStateChanged()
{ 
	if (newXmlHttp.readyState==4 || newXmlHttp.readyState=="complete")
	{ 
		alert(newXmlHttp.responseText);
	//$id('topbar').style.display='none';	
	}
} 
//////////////////////////////END ajaxAlert

function GetnewXmlHttpObject()
{ 
	var objnewXmlHttp=null;
	if (window.XMLHttpRequest)
	{
		objnewXmlHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objnewXmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	return objnewXmlHttp;
} 

function ajaxGetServiceAttributeOptionValue(url,did , bprice)
{
	divId = did ;
	baseprice = bprice;
	showXmlHttp=GetnewXmlHttpObject();
	if (showXmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	if(url.indexOf("?")!=-1)
	url=url+"&sid="+Math.random();
	else
	url=url+"?sid="+Math.random();
	
	showXmlHttp.onreadystatechange=getServiceAttributeOptionValueStateChange ;
	showXmlHttp.open("GET",url,true);
	showXmlHttp.send(null);
}

function getServiceAttributeOptionValueStateChange()
{
	if (showXmlHttp.readyState==4 || showXmlHttp.readyState=="complete")
	{ 
		custmoerSAOPrice=parseFloat( showXmlHttp.responseText );
		total = (baseprice+custmoerSAOPrice)  
		$id(divId).innerHTML='$' +total.toFixed(2);	
	}
}