function show_state(str,str2)
  { 
  //document.getElementById("sport_new").style.display="none";
  //document.getElementById("sport_new_country").style.display="none";
  //document.getElementById("sport_new_country").style.display="none";   
   xmlHttp=CreateXmlHttpObject();

  if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
  var url="check_drop_new.php";
  url=url+"?rid="+str+"&bookid="+str2;
//alert(url); 
  //url=url+"&sid="+Math.random();  
  xmlHttp.onreadystatechange=stateChanged 
  xmlHttp.open("GET",url,true)
  xmlHttp.send(null)
  }
  
  
  function stateChanged() 
  { 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
    document.getElementById("totalprice").innerHTML=xmlHttp.responseText;	
	
    } 	
  } 
  /*############################## ########################################*/
  
  /*#####################  For City ###################################*/
  
  function show_city(ST,ST2)
  { 
   
   xmlHttp2=CreateXmlHttpObject();
 
  if (xmlHttp2==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
  var url2="check_drop_new_city.php";
  url2=url2+"?rid="+ST+"&bookid="+ST2;
  //alert(url2); 
  //url=url+"&sid="+Math.random();  
  xmlHttp2.onreadystatechange=stateChangedCity 
  xmlHttp2.open("GET",url2,true)
  xmlHttp2.send(null)
  }
  
  
  function stateChangedCity() 
  { 
    if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
    { 
    document.getElementById("rentduedate").innerHTML=xmlHttp2.responseText;	
    } 	
  } 
  /*########################################################*/
   
 
 function show_state_ext(exstr,exstr2)
  { 
  //alert("ffffffffffffffffff");
  //document.getElementById("sport_new").style.display="none";
  //document.getElementById("sport_new_country").style.display="none";
  //document.getElementById("sport_new_country").style.display="none";   
   xmlHttp3=CreateXmlHttpObject();
 
  if (xmlHttp3==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
  var url3="check_drop_new.php";
  url3=url3+"?exid="+exstr+"&exbookid="+exstr2;
//alert(url3); 
  //url=url+"&sid="+Math.random();  
  xmlHttp3.onreadystatechange=stateChanged_ext 
  xmlHttp3.open("GET",url3,true)
  xmlHttp3.send(null)
  }
  
  
  function stateChanged_ext() 
  { 
    if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
    { 
    document.getElementById("totalprice").innerHTML=xmlHttp3.responseText;	
	
    } 	
  } 
 /*###############################    ##############################*/
 
  function show_city_ext(EXST,EXST2)
  { 
   
   xmlHttp4=CreateXmlHttpObject();
 
  if (xmlHttp4==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
  var url4="check_drop_new_city.php";
  url4=url4+"?exid="+EXST+"&exbookid="+EXST2;
  //alert(url4); 
  //url=url+"&sid="+Math.random();  
  xmlHttp4.onreadystatechange=stateChangedCity_ext 
  xmlHttp4.open("GET",url4,true)
  xmlHttp4.send(null)
  }
  
  
  function stateChangedCity_ext() 
  { 
    if (xmlHttp4.readyState==4 || xmlHttp4.readyState=="complete")
    { 
    document.getElementById("rentduedate").innerHTML=xmlHttp4.responseText;	
    } 	
  } 
  /*######################### Rerent Starts    ###############################*/
 function show_rerent_cost(str,str2)
  { 
  xmlHttp5=CreateXmlHttpObject();
  if (xmlHttp5==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
  var url="rerent_cost.php";
  url=url+"?rid="+str+"&bookid="+str2;
 //alert(url); 
  //url=url+"&sid="+Math.random();  
  xmlHttp5.onreadystatechange=rentCostChanged 
  xmlHttp5.open("GET",url,true)
  xmlHttp5.send(null)
  }
  
  
  function rentCostChanged() 
  { 
    if (xmlHttp5.readyState==4 || xmlHttp5.readyState=="complete")
    { 
    document.getElementById("rerentprice").innerHTML=xmlHttp5.responseText;	
	
    } 	
  } 
  
  function show_rerent_due(str,str2)
  { 
  xmlHttp6=CreateXmlHttpObject();
 
  if (xmlHttp6==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
  var url="rerent_due.php";
  url=url+"?rid="+str+"&bookid="+str2;
//alert(url); 
  //url=url+"&sid="+Math.random();  
  xmlHttp6.onreadystatechange=rentDueChanged 
  xmlHttp6.open("GET",url,true)
  xmlHttp6.send(null)
  }
  
  
  function rentDueChanged() 
  { 
    if (xmlHttp6.readyState==4 || xmlHttp6.readyState=="complete")
    { 
    document.getElementById("rerentdue").innerHTML=xmlHttp6.responseText;	
	
    } 	
  } 
 /*############################### Rerent Ends  #################################*/
 
 
function CreateXmlHttpObject()
  { 
  var objXMLHttp=null
  if (window.XMLHttpRequest)
  {
  	objXMLHttp=new XMLHttpRequest()
  }

  else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
  return objXMLHttp
  }
  
  
function dropdownreset_ext()
{

document.form_rental.rent_duration_extn.selectedindex=0;
document.form_rental.rent_duration_extn.options[0].selected = true;
}

function show_buynow(e)
{
	var earray=new Array();
	
	earray=e.split("|");	
	
	if (earray[0]=="buy"){ 
		
		document.getElementById("listprice_label").innerHTML="<b>Buy Now:</b>";
		document.getElementById("listprice_row").style.textDecoration="none";
		document.getElementById("listprice_row").innerHTML="$"+earray[1];
		document.getElementById("ourprice").style.display="none";
		document.getElementById("totalprice").style.display="none";
		document.getElementById("extension_row").style.display="none";
		document.getElementById("extensionlist_row").style.display="none";
		document.getElementById("due_row").style.display="none";
		document.getElementById("rentduedate").style.display="none";
	//	document.getElementById("resacopy").style.display="none";
		//document.getElementById("emailafriend").style.display="none";
	}
	else
	{
		
		document.getElementById("listprice_label").innerHTML="<b>LIST PRICE:</b>";
		document.getElementById("listprice_row").style.textDecoration="line-through";
		document.getElementById("listprice_row").innerHTML="$"+document.getElementById("orglistprice").innerHTML;
		document.getElementById("ourprice").style.display="";
		document.getElementById("totalprice").style.display="";
		document.getElementById("extension_row").style.display="";
		document.getElementById("extensionlist_row").style.display="";
		document.getElementById("due_row").style.display="";
		document.getElementById("rentduedate").style.display="";
		//document.getElementById("resacopy").style.display="";
		//document.getElementById("emailafriend").style.display="";
	}
	
}


