var xmlHttp

function sendEmail()
 { 
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 var t_name = document.getElementById('name').value;
 var t_email = document.getElementById('email').value;
 var t_msg = document.getElementById('msg').value;
 var t_capt = document.getElementById('valid').value;
 var url="/email_send.php"
 var queryString = "?name=" + t_name;
 queryString +=  "&email=" + t_email;
 queryString +=  "&msg=" + t_msg;
 queryString +=  "&capt=" + t_capt;
 url=url+queryString+"&sid="+Math.random()
 xmlHttp.onreadystatechange=formUpdate 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }
function formUpdate() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("contactform").innerHTML=xmlHttp.responseText
 } 
}
function newCaptcha()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="/new_captcha.php?sid="+Math.random()
xmlHttp.onreadystatechange=loadCaptcha 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function loadCaptcha() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("captimg").innerHTML=xmlHttp.responseText 
 } 
}
function statusBar()
{
	if (xmlHttp.readyState!=4 || xmlHttp.readyState!="complete")
	{
		document.getElementById("status").style.display="block"
	}
	else
	{
		document.getElementById("status").style.display="none"
	}
}
function viewVideo(str)
 { 
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="/load_video.php"
 var queryString = "?q=" + str;
 url=url+queryString+"&sid="+Math.random()
 xmlHttp.onreadystatechange=videoUpdate 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }
 function videoUpdate() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("video_frame").innerHTML=xmlHttp.responseText
 } 
}
function faresChange(str)
 { 
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="/fare_switch.php"
 var queryString = "?q=" + str;
 url=url+queryString+"&sid="+Math.random()
 xmlHttp.onreadystatechange=fareUpdate 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }
 function fareUpdate() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("sw_bd").innerHTML=xmlHttp.responseText
 } 
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
// Print External Pages Function
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
function setPrintedPage(altdoc) {
var prt;
var prt = document.getElementsByTagName("link")[0];
prt.setAttribute("href", altdoc);
printWindow();
}