// JavaScript Document
function getNewHTTPObject1()
{
        var xmlhttp;

        /** Special IE only code ... */
        /*@cc_on
          @if (@_jscript_version >= 5)
              try
              {
                  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              }
              catch (e)
              {
                  try
                  {
                      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  catch (E)
                  {
                      xmlhttp = false;
                  }
             }
          @else
             xmlhttp = false;
        @end @*/

        /** Every other browser on the planet */
        if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
        {
            try
            {
                xmlhttp = new XMLHttpRequest();
            }
            catch (e)
            {
                xmlhttp = false;
            }
        }

        return xmlhttp;
}

function showofferdetail(offer,trip,cok,product_div,cnt)
{ 
	//document.getElementById('other_city').innerHTML=" ";
   var strURL="includes/finddetail.php?offer="+offer+"&cnt="+cnt+"&trip="+trip+"&cok="+cok;
	var xmlhttp1 = getNewHTTPObject1();
   if (xmlhttp1)
   {
     xmlhttp1.onreadystatechange = function()
     {
      if (xmlhttp1.readyState == 4)
      {
	 // only if “OK”
	 if (xmlhttp1.status == 200)
         {
	    document.getElementById(product_div).innerHTML=xmlhttp1.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + xmlhttp1.statusText);
	 }
       }
      }
   xmlhttp1.open("GET", strURL, true);
   xmlhttp1.send(null);
   }
}

function showfields(qty,trip,cok,field_div,cunt)
{ 
	//document.getElementById('other_city').innerHTML=" ";
   var strURL="includes/finddetail.php?qty="+qty+"&trip="+trip+"&cok="+cok+"&cunt="+cunt;;
	var xmlhttp1 = getNewHTTPObject1();
   if (xmlhttp1)
   {
     xmlhttp1.onreadystatechange = function()
     {
      if (xmlhttp1.readyState == 4)
      {
	 // only if “OK”
	 if (xmlhttp1.status == 200)
         {
	    document.getElementById(field_div).innerHTML=xmlhttp1.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + xmlhttp1.statusText);
	 }
       }
      }
   xmlhttp1.open("GET", strURL, true);
   xmlhttp1.send(null);
   }
}

function updatecart(price,offer,qtty,up,cok,div_update)
{ 
	//document.getElementById('other_city').innerHTML=" ";
   var strURL="includes/finddetail.php?price="+price+"&offer="+offer+"&qtty="+qtty+"&up="+up+"&cok="+cok;
	var xmlhttp1 = getNewHTTPObject1();
   if (xmlhttp1)
   {
     xmlhttp1.onreadystatechange = function()
     {
      if (xmlhttp1.readyState == 4)
      {
	 // only if “OK”
	 if (xmlhttp1.status == 200)
         {
	    document.getElementById(div_update).innerHTML=xmlhttp1.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + xmlhttp1.statusText);
	 }
       }
      }
   xmlhttp1.open("GET", strURL, true);
   xmlhttp1.send(null);
   }
}


function updatetotal(cok,total)
{ 
	//document.getElementById('other_city').innerHTML=" ";
   var strURL="includes/finddetail.php?cok="+cok+"&total="+total;
	var xmlhttp1 = getNewHTTPObject1();
   if (xmlhttp1)
   {
     xmlhttp1.onreadystatechange = function()
     {
      if (xmlhttp1.readyState == 4)
      {
	 // only if “OK”
	 if (xmlhttp1.status == 200)
         {
	    document.getElementById("div_total").innerHTML=xmlhttp1.responseText;
	 } else {
   	   alert("There was a problem while using XMLHTTP:\n" + xmlhttp1.statusText);
	 }
       }
      }
   xmlhttp1.open("GET", strURL, true);
   xmlhttp1.send(null);
   }
}