var xmlHttp

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


//============== Model ================
function showdollar(start,pid)
{ 

 if(start!=""){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="getadollar.php"
	url=url+"?start="+start+"&pid="+pid
	xmlHttp.onreadystatechange=onchange
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
 }
}
//======================================= Model ================
//=========================== script for sub prod price convert ==========================

function showdollar_sub(start,pid)
{ 
//alert(start);
 if(start!=""){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="getadollar_sub.php"
	url=url+"?start="+start+"&pid="+pid
	xmlHttp.onreadystatechange=onchange_sub
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
 }
}

function onchange_sub() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Show_dollar_sub").innerHTML=xmlHttp.responseText 
	} 
	
}

//=========================================================================================

//=========================== script for sub prod price convert ==========================

function showdollar_sub_special(start,pid,specialvar)
{ 
//alert(start);
//alert(pid);
//alert(specialvar);
 if(start!=""){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="getadollar_sub_special.php"
	url=url+"?start="+start+"&pid="+pid+"&specialvar="+specialvar
	xmlHttp.onreadystatechange=onchange_sub_special
	//alert(url);
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
 }
}

function onchange_sub_special() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Show_dollar_sub_special").innerHTML=xmlHttp.responseText 
	} 
	
}

//=========================================================================================
//===============================shopping cart conver price======================

//===============================shopping cart conver price======================
function showdollar_shoppingcart(amount)
{ 
//alert(amount);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="get_show_totaldollarprice.php"
	url=url+"?amount="+amount
	xmlHttp.onreadystatechange=onchange_1212
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
}
function onchange_1212() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Show_dollar_amount").innerHTML=xmlHttp.responseText 
	} 
	
}
//============== Model ================
function showdollar1(start,pid)
{ 
 if(start!=""){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="getadollar1.php"
	url=url+"?start="+start+"&pid="+pid
	xmlHttp.onreadystatechange=onchange
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
 }
}

//============== Model ================
function showdollar2(start,pid)
{ 
 if(start!=""){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="getadollar2.php"
	url=url+"?start="+start+"&pid="+pid
	xmlHttp.onreadystatechange=onchange
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
 }
}

function onchange() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Show_dollar").innerHTML=xmlHttp.responseText 
	} 
	
}

//===========================================Discout for product=============================================

function Get_discount_dollarprice(start,pid,discount_price)
{ 
//alert(start);
//alert(pid);
//alert(discount_price);

 if(start!=""){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="Get_discount_dollarprice.php"
	url=url+"?start="+start+"&pid="+pid+"&discount_price="+discount_price
	xmlHttp.onreadystatechange=Get_discount_dollarprice_event
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
 }
}

function Get_discount_dollarprice_event() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Get_discount_dollarprice_event_1").innerHTML=xmlHttp.responseText 
	} 
	
}

//================================================Final invoice page Terms======================================

function Get_Show_Payment_Terms(trrm)
{ 
if(trrm=="one")
{
	location.reload(true);
	 document.getElementById('term123').checked = true;
}
else
{
	document.getElementById("baldue").value="";
	document.getElementById("payment").value=document.getElementById("total").value;
    document.getElementById('term123').checked = true;

}
document.getElementById("Get_Show_Payment_Method").

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		//alert ("Browser does not support HTTP Request")
		return
	} 
	var url="Get_Show_Payment_Terms.php"
	url=url+"?trrm="+trrm
	xmlHttp.onreadystatechange=Get_Show_Payment_Terms_1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function Get_Show_Payment_Terms_1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Get_Show_Payment_Terms").innerHTML=xmlHttp.responseText 
	} 
	
}

//================================================ Final invoice page Method ======================================

function Get_Show_Payment_Method(method)
{ 
//alert(trrm);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="Get_Show_Payment_Method.php"
	url=url+"?method="+method
	xmlHttp.onreadystatechange=Get_Show_Payment_Method_1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function Get_Show_Payment_Method_1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	document.getElementById("Get_Show_Payment_Method").innerHTML=xmlHttp.responseText 
	} 
	
}


//================================================Check_special product status======================================

function Check_status()
{ 
//alert(cid);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
var url="webmaster/Get_discount.php"
	//url=url+"?cid="+cid
	url=url+"&sid="+Math.random()
	alert(url);
	xmlHttp.onreadystatechange=stateChanged_subcat
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged_subcat() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("Get_discount").innerHTML=xmlHttp.responseText 
	} 
}













