
function selectedCity(isDep,content){
   if(isDep){
     document.getElementById("departure").value=content;
   }else{
      document.getElementById("arrival").value=content;
   }
   checkFields();
}

function checkFields(){
  var radtripType,deptCity,arrCity,deptDate,retDate,adult,child,infant;
  var fromcity = document.getElementById("selorigin").value;
  var tocity = document.getElementById("seldestination").value;
  deptDate=document.form_bus_home.departureDate.value;
  retDate=document.form_bus_home.returnDate.value;
  
  if(fromcity=="0" && tocity=="0"){
  	alert("Origin and destination cities cannot be left blank");
	document.getElementById("selorigin").focus();
	return false;
  }
  if(fromcity=="0"){
	alert("Origin city cannot be left blank");
	document.getElementById("selorigin").focus();
	return false;
  }
  if(tocity=="0"){
	alert("Destination city cannot be left blank");
	document.getElementById("seldestination").focus();
	return false;
  }
  
  if(fromcity == tocity)
  {
  	alert("Origin and destination cities cannot be same");
  	return false;
  }
  if(!isValidDate(deptDate))
  {
     var departureElement = document.getElementById("arrDateOway");
     alert("Please select the departure date");
     departureElement.focus();
     return false;
  }
  
  if(radtripType=='R' && (!isValidDate(retDate)))
  {
     var departureElement = document.getElementById("RToDateDispCalBelow");
     alert("Please select the return date");
     departureElement.focus();
      return false;
  }
  
  //for date validity
  if(radtripType=='R')
  {
          var comparedatesval = compareDates(retDate,'dd/MM/yyyy',deptDate,'dd/MM/yyyy');
  	if(comparedatesval<=0){
  	       alert("Departure date should be before return date");
  	        document.getElementById("RToDateDispCalBelow").focus();
  		return false;
  	}
  }
   var totalPassenger=parseInt(adult)+parseInt(child)+parseInt(infant);
  
     if(parseInt(adult)<parseInt(infant)){
     var departureElement = document.getElementById("selnoOfAdults");
     alert("Number of infants can not be more than number of adults.");
     departureElement.focus();
     return false;
  }
  if(totalPassenger>6)
  {
    var departureElement = document.getElementById("selnoOfAdults");
        alert("Total number of passengers exceeded the maximum allowed limit of 6");
        departureElement.focus();
    return false;
   }
  
  var departureElement = document.getElementById("departure");
  var arrivalElement = document.getElementById("arrival");
	if(document.getElementById("calendar-1").style.display=='block'){
	    document.getElementById("calendar-1").style.display='none';
	}
	document.getElementById("defaultsuggestions").style.display='none';
	//document.getElementById('fade').style.display='block';
	document.form_bus_home.submit();
}

<!-- For Modify Search -->

function checkFieldsForModifySearch()
{
  var radtripType,deptDate,retDate,adult,child,infant;
  var fromcity = document.getElementById("selorigin").value;
  var tocity = document.getElementById("seldestination").value;
  deptDate=document.Results.departureDate.value;
  
  if(fromcity=="0" && tocity=="0"){
  	alert("Origin and destination cities cannot be left blank");
	document.getElementById("selorigin").focus();
	return false;
  }
  if(fromcity=="0"){
	alert("Origin city cannot be left blank");
	document.getElementById("selorigin").focus();
	return false;
   }
  if(tocity=="0"){
	alert("Destination city cannot be left blank");
	document.getElementById("seldestination").focus();
	return false;
  }
  if(fromcity == tocity)
  {
  	alert("Origin and destination cities cannot be same");
  	return false;
  }
  if(!isValidDate(deptDate))
  {
     var departureElement = document.getElementById("arrDateOway");
     alert("Please select the departure date");
     departureElement.focus();
     return false;
  }
  if(!isValidDate(deptDate))
  {
     var departureElement = document.getElementById("RFromDateDispCalBelow");
     alert("Please select the departure date");
     departureElement.focus();
     return false;
  }
  var totalPassenger=parseInt(adult)+parseInt(child)+parseInt(infant);
     if(parseInt(adult)<parseInt(infant)){
     var departureElement = document.getElementById("selnoOfAdults");
     alert("Number of infants can not be more than number of adults.");
     departureElement.focus();
     return false;
  }
  if(totalPassenger>6)
  {
    var departureElement = document.getElementById("selnoOfAdults");
        alert("Total number of passengers exceeded the maximum allowed limit of 6");
        departureElement.focus();
    return false;
   }
  var departureElement = document.getElementById("departure");
  var arrivalElement = document.getElementById("arrival");
  if(document.getElementById("calendar-1").style.display=='block'){
	    document.getElementById("calendar-1").style.display='none';
	}
	document.getElementById("defaultsuggestions").style.display='none';
	document.Results.action="/BusIntegration/bus/booking";
	document.Results.submit();
}
function checkFieldsForReturnJourney()
{
  var radtripType,deptDate,retDate;
  var fromcity = document.getElementById("selorigin").value;
  var tocity = document.getElementById("seldestination").value;
  document.getElementById("deptForm").value = fromcity;
  document.getElementById("arrForm").value = tocity;
  if(fromcity == tocity){
  	alert("Origin and Destination cannot be the same city");
  	return false;
  }
  document.returnForm.submit();
}

function checkemail(){
	var str=document.getElementById("emailId").value;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
		testresults=true
	else{
		alert("Please input a valid email address!")
		testresults=false
	}
	return (testresults)
}
function trimStr(ss)
{
	 thestr=ss;
	 if (thestr.length>0)
	 {
		 doubleSpaces=true;
		 while (doubleSpaces)
		 {
			  thestr=thestr.replace('  ', ' ');
			  if (thestr.indexOf('  ')==-1)
			  {
				  doubleSpaces=false;
			  }
		  }
	 for(i=0; i<thestr.length; i++)
	 {
		  if(thestr.charAt(i)!=' ')
		  {
			  thestr=thestr.substr(i,thestr.length-i);
			  break;
		  }
		  else
		  {
			  thestr=thestr.substr(i,thestr.length);
			  i=0
		  }
	  }
	 for(i=thestr.length-1; i>=0; i--)
	 {
		  if(thestr.charAt(i)!=' ')
		  {
			  thestr=thestr.substr(0,i+1);
			  break;
		  }
	  }
 }
 if (thestr==' ')
 {
	 thestr='';
 }
 return thestr;
 }


function isValidDate(val){
    var dateVal = getDateFromFormat(val,'dd/MM/yyyy');
    if(dateVal==0)return false;
    else return true;
}

function rTrip(){
	document.forms[0].returnDate.disabled=false;
	document.getElementById("calender").innerHTML ="<img id=\"deptDateRtripimgExact\" src=\"/BusIntegration/images/international/cal.gif\" style=\"cursor:hand\" onmousedown=\"javascript:displayCalendar('RToDateDispCalBelow','RToDate');\" onkeydown=\"javascript:displayCalendar('RToDateDispCalBelow','RToDate');\" >";
}

function oTrip(){
  if(document.forms[0]==null){}else{
	document.forms[0].returnDate.disabled=true;
	document.getElementById("calender").innerHTML ="<img src='/BusIntegration/images/international/cal.gif'>";
  }
}
imageSize=0 // % size the image is shown at, if set to zero the fixed width and heights are used
fixedWidth=200 // set a fixed width
fixedHeight=20 // set a fixed height
spacerWidth=0 // space between images

autoWidth=0 // 0 = no, 1 = yes, sets the width to the widest image size

defaultSpeed=20

popupLeft= 100 // pixels
popupTop= 100 // pixels

totalWidth=0
displayWidth=0
displayHeight=0
step=defaultSpeed

temp=new Array()

function initHS2b(){
imgBox=document.getElementById("image_box") // element containing the images
imgTags=imgBox.getElementsByTagName("IMG")
imgNum=imgTags.length // number of images

if(document.getElementById&&document.all){ // border needs adding to inner_box height in IE
ieBorder=parseInt(document.getElementById("inner_box").style.borderWidth)*2
}
else{
ieBorder=0
}

for(var i=0;i<imgNum;i++){ // set image size

if(imageSize!=0){ // use percentage size
currentImage=new Image()
currentImage.src=myImages[i]
imgTags[i].style.width=currentImage.width/100*imageSize+"px"
//imgTags[i].style.width=imgTags[i].offsetWidth/100*imageSize+"px"
//imgTags[i].style.height=(imgTags[i].offsetHeight/100)*imageSize+"px"
}
else{ // use fixed size
imgTags[i].style.width=fixedWidth+"px"
imgTags[i].style.height=fixedHeight+"px"
}

}

for(var i=0;i<imgNum;i++){
totalWidth+=(document.getElementById("pic"+i).offsetWidth+4) // get all image widths
totalWidth+=spacerWidth
document.getElementById("pic"+i).style.marginRight=spacerWidth+"px" // add spacer

if(autoWidth==1){
if(document.getElementById("pic"+i).offsetWidth>displayWidth){ // set to largest image width
displayWidth=document.getElementById("pic"+i).offsetWidth
}

}
else{
displayWidth=parseInt(document.getElementById("inner_box").style.width) // set to div width
}


if(document.getElementById("pic"+i).offsetHeight>displayHeight){ // set to largest image height
displayHeight=document.getElementById("pic"+i).offsetHeight+ieBorder // include border for IE
}

temp[i]=totalWidth-(document.getElementById("pic"+i).offsetWidth-4)-spacerWidth-ieBorder // get image positions

}

for(var i=0;i<imgNum;i++){ // vertically center images
document.getElementById("pic"+i).style.marginBottom=(displayHeight-document.getElementById("pic"+i).height)/2+"px"
}

imgHolderWidth=displayWidth
document.getElementById("outer_box").style.width=imgHolderWidth+"px"
document.getElementById("inner_box").style.width=imgHolderWidth+"px"
imgBox.style.width=totalWidth+"px"

imgHolderHeight=displayHeight
document.getElementById("inner_box").style.height=imgHolderHeight+"px" //isBorder+
document.getElementById("inner_box").style.clip="rect(0,"+(imgHolderWidth+"px")+","+(imgHolderHeight+"px")+",0)"

halfWay=displayWidth/2
}

timer=""
count= 0
running=0
counted=0
function scrollHS2b(n){
clearTimeout(timer)

imgBoxPos=parseInt(imgBox.style.left)
if(running==0){

if(n==1){

if(imgBoxPos>=0 && temp[count]<halfWay){ // when starting, if image box = zero and next image is < half display width
count++
counted=1
scrollHS2b(n)
return
}

if(count==imgNum-1){
return
}
else if(imgBoxPos== -(totalWidth-displayWidth)){ // if at right end
return
}
else{
if(counted==0){count++}
}

}
counted=0

if(n==0){

if(count==0){return}
else{count--}
}

}

running=1

if(n==1){imgBoxPos-=step}
else{imgBoxPos+=step}

imgBox.style.left=imgBoxPos+"px"
timer=setTimeout("scrollHS2b("+n+")",50)

imgStartPos= -temp[count]+(halfWay-(document.getElementById("pic"+count).offsetWidth/2))

if(n==1&&imgBoxPos< imgStartPos){ // if at next right postion
imgBox.style.left=imgStartPos+"px"
clearTimeout(timer)
running=0
highLightBorder()
}

if(imgBoxPos< -(totalWidth-displayWidth)){ // if at right end
imgBox.style.left= -(totalWidth-displayWidth)
clearTimeout(timer)
running=0
}

if(n==0){

if(imgBoxPos>imgStartPos){ // if at next left position
imgBox.style.left=imgStartPos
clearTimeout(timer)
running=0
highLightBorder()
}

if(imgBoxPos>=0){ // when scrolling left, if next image is < half display width and image box = zero
imgBox.style.left=0
clearTimeout(timer)
running=0
}

}

}

picWin=null

function getBigPic(p){
if(myImages[p]&&myImages[p]!=""){

bigImg=new Image()
bigImg.src=myImages[p]

data="\n<center>\n<img src='"+bigImg.src+"'>\n</center>\n"

if(picWin){picWin.close()} // if window exists close it

var winProps = "left= "+popupLeft+", top = "+popupTop+", width="+(bigImg.width+20)+", height="+(bigImg.height+20)+", scrollbars=no, toolbar=no, directories=no, menu bar=no, resizable=yes, status=no" 
picWin=window.open("","win1",winProps)
picWin.document.write("<HTML>\n<HEAD>\n<TITLE></TITLE>\n")
picWin.document.write("</HEAD>\n")
picWin.document.write("<BODY bgcolor='black' topmargin=10px leftmargin=10>\n")
picWin.document.write("<div id=\"display\">"+data+"</div>")
picWin.document.write("\n</BODY>\n</HTML>")
}
}

lastC=""
function highLightBorder(){
	if(lastC!=""){document.getElementById("pic"+(lastC)).style.borderColor=""}
	document.getElementById("pic"+(count)).style.borderColor="white"
	lastC=count
}

var currLayerId = "text0"; 

//Used when user selects flight.
function selectedFlight(id){
   document.forms[0]._eventId.value='ReviewItinerary';
   document.forms[0].data.value=id;
	var adult = document.forms[0].previousAdults.value;
	
   Effect.Fade('body',{duration:0.05});
   Effect.Fade('header',{duration:0.05});
   Effect.Fade('footer',{duration:0.05});
   Effect.Appear('interstatial',{duration:0.05});
   Effect.Appear('interstatialheading',{duration:0.05});
   
   document.forms[0].submit();
   return false;
  }
  
function submitpage(){
     if(!document.getElementById('accept').checked){
        alert('Kindly accept rules and restrictions');
        
        return false;
      }    
	if(document.getElementById("eCouponRefId") != null){
		 var eCoupon = document.getElementById("eCouponRefId").value;
		 if (!alphanumeric(eCoupon)){
			 alert("Please enter a valid coupon Number");
			 return false;
		}
		 document.getElementById("eCouponId").value = eCoupon;
	 }
	 document.getElementById("body").style.display = "none";
	 document.getElementById("header").style.display = "none";
	 document.getElementById("footer").style.display = "none";
	 document.getElementById("interstatial").style.display = "block";
	 document.getElementById("interstatialheading").style.display = "block";
     document.form_itinerary_review.submit();
 }
 
function alphanumeric(alphane)
  {
  	var numaric = alphane;
  	for(var j=0; j<numaric.length; j++)
  		{
  		  var alphaa = numaric.charAt(j);
  		  var hh = alphaa.charCodeAt(0);
  		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
  		  {
  		  }
  		else	{
  			 return false;
  		  }
  		}
   return true;
  }

function tripType(){
	document.getElementById('oTrip').checked = true;
}
function weekend(){
	var weekend = new Date();
	var weekday=new Array(7);
	weekday[0]="Sunday";
	weekday[1]="Monday";
	weekday[2]="Tuesday";
	weekday[3]="Wednesday";
	weekday[4]="Thursday";
	weekday[5]="Friday";
	weekday[6]="Saturday";
	while(weekday[weekend.getDay()] != "Saturday")
	{
		weekend.setDate(weekend.getDate()+1);
	}
	var datedigit = weekend.getDate();
	var monthdigit = (weekend.getMonth() + 1);
	if(weekend.getDate() < 10 )
	{
		datedigit = "0"+weekend.getDate();
	}	

	if(weekend.getMonth() < 10 )
	{
		monthdigit = "0"+(weekend.getMonth()+1);
	}
	var weekendDate = datedigit+"/"+monthdigit+"/"+weekend.getFullYear();
	return weekendDate;
}

function trip(ori,dest){
	document.getElementById('selorigin').value = ori;
	document.getElementById('seldestination').value = dest;
	
	document.getElementById('RFromDateDispCalBelow').value = weekend();
	checkFields();

}

function clickEmailText(){	
	var email_text = document.getElementById('emailId').value;
	if(email_text == "" || email_text == null)
		document.getElementById('emailId').value = "To get discount coupons later";
	if(email_text == "To get discount coupons later")
		document.getElementById('emailId').value = "";
		
}
function setEmailText(){
	document.getElementById('emailId').value = "To get discount coupons later";
}
function clickEmailText1(){	
	var email_text = document.getElementById('usrMail').value;
	if(email_text == "" || email_text == null)
		document.getElementById('usrMail').value = "Enter your booking email id";
	if(email_text == "Enter your booking email id")
		document.getElementById('usrMail').value = "";
		
}
function setEmailText1(){
	document.getElementById('usrMail').value = "Enter your booking email id";
}
function clickPNRText(){	
	var pnrTxt = document.getElementById('mmtPnr').value;
	if(pnrTxt == "" || pnrTxt == null)
		document.getElementById('mmtPnr').value = "Enter your mmt pnr no";
	if(pnrTxt == "Enter your mmt pnr no")
		document.getElementById('mmtPnr').value = "";
}
function checkEmail(emailField){
      var emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
      if( !emailpat.test( emailField ) ) {
            return false;
      }
      return true;
}
function print_e_ticket_closebox(){

	if(document.getElementById('selorigin') != null){
		 	document.getElementById("selorigin").disabled = false;
	}
	if(document.getElementById('seldestination') != null){
		 	document.getElementById("seldestination").disabled = false;
	}
	if(document.getElementById('selbusType') != null){
		 	document.getElementById("selbusType").disabled = false;
	}
	if(document.getElementById('bpl') != null){
		 	document.getElementById("bpl").disabled = false;
	}
	if(document.getElementById('travel') != null){
		 	document.getElementById("travel").disabled = false;
	}
	if(document.getElementById('selBP0') != null){
		if(arrBus != null){
		for (var i = 0; i < arrBus.length; i++)
	    		{
	  		 		document.getElementById('selBP'+i).style.display='block';
	  		 	}
		}
  	}
  	if(document.getElementById('no_of_title') != null){
		 var noOfTitle = document.getElementById('no_of_title').value;
		 		for (var i = 0; i < noOfTitle; i++)
	    		{	
		 			if(document.getElementById('Title_ADT_'+i) != null)
		 				document.getElementById('Title_ADT_'+i).disabled = false;
	  		 	}
	}
	if(document.getElementById('selPayemntThroughNormal') != null){
		 		document.getElementById('selPayemntThroughNormal').style.display='block';
		 		document.getElementById('overlay_selPayemntThroughNormal').style.display='none';
	}
	if(document.getElementById('netbank') != null){
		 		document.getElementById('netbank').style.display='block';
		 		document.getElementById('overlay_netbank').style.display='none';
	}
	if(document.getElementById('selPayemntThroughNetBanking') != null){
		 		document.getElementById('selPayemntThroughNetBanking').style.display='block';
		 		document.getElementById('overlay_selPayemntThroughNetBanking').style.display='none';
	}
	if(document.getElementById('selPayemntThroughCashCard') != null){
		 		document.getElementById('selPayemntThroughCashCard').style.display='block';
		 		document.getElementById('overlay_selPayemntThroughCashCard').style.display='none';
	}
	if(document.getElementById('cardType') != null){
		 		document.getElementById('cardType').style.display='block';
	}
	if(document.getElementById('expMonth') != null){
		 		document.getElementById('expMonth').style.display='block';
	}
	if(document.getElementById('expYear') != null){
		 		document.getElementById('expYear').style.display='block';
	}
	if(document.getElementById('billingCountry') != null){
		 		document.getElementById('billingCountry').disabled = false;
	}
	if(document.getElementById('billingState') != null){
		 		document.getElementById('billingState').disabled = false;
	}		 
	document.getElementById('print_e_ticket_fade').style.display='none';
    document.getElementById('print_e_ticket_box').style.display='none';
    document.getElementById('print_e_ticket_filter').style.display='none';   
    document.getElementsByTagName('body')[0].style.overflow='auto'; 


}

function clickEmailText1()
{	
	var email_text = document.getElementById('usrMail').value;
	if(email_text == "" || email_text == null)
		document.getElementById('usrMail').value = "Enter your booking email id";
	if(email_text == "Enter your booking email id")
		document.getElementById('usrMail').value = "";
		
}

function clickPNRText()
{	
	var pnrTxt = document.getElementById('mmtPnr').value;
	if(pnrTxt == "" || pnrTxt == null)
		document.getElementById('mmtPnr').value = "Enter your mmt pnr no";
	if(pnrTxt == "Enter your mmt pnr no")
		document.getElementById('mmtPnr').value = "";
		
}

function submitForm(){
	if( (checkPNR(document.getElementById('mmtPnr').value)) == false){
			alert("Please enter a valid MakeMyTrip Id.");
			return false;
	}
	
	if(document.getElementById('mmtPnr').value.length <7){
			alert("Please enter a valid MakeMyTrip Id.");
			return false;
	}
	
	if(!checkPNRPatt(document.getElementById('mmtPnr').value.substring(0,7))){
			alert("Please enter a valid MakeMyTrip Id.");
			return false;
	}
	if(document.getElementById('usrMail').value !='' && document.getElementById('usrMail').value !=null && document.getElementById('usrMail').value !='Enter your booking email id'){
		if(!checkEmailForPrintETicket(document.getElementById('usrMail').value)){
			alert("Please enter a valid Email address");
			return false;
			}
	}
	
	
	document.getElementById('print_e_ticket_fname').action = "/BusIntegration/bus/retrieve";
	document.getElementById('userEmail').value = document.getElementById('usrMail').value; 
	document.getElementById('userPnrNo').value = document.getElementById('mmtPnr').value;
	
	document.print_e_ticket_fname.submit();
}



function checkPNR(pnr){      
  var pnrpat = /^([a-zA-Z0-9])+$/;
      if( !pnrpat.test(pnr) ) {
            return false;
      }
      return true;
}
function checkPNRPatt(pnrStr){
	var pnrPattern = 'BUS5000';
	if(pnrStr !=pnrPattern){
		return false;
	}
	return true;
}

function checkEmailForPrintETicket(emailField){
      var emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
      if( !emailpat.test( emailField ) ) {
            return false;
      }
      return true;
}

function print_e_ticket(){
	 document.getElementById('circleanim').style.display="block";
	 document.getElementById('circleanim').style.position='absolute';
	 document.getElementById('circleanim').style.left =500;
	 document.getElementById('circleanim').style.top = 135;
	 var box = document.getElementById('print_e_ticket_box'); 
	 var title = document.getElementById('print_e_ticket_boxtitle');
	 title.innerHTML = "Enter your booking details";   
	 var content = document.getElementById('print_e_ticket_BoxContent');

	 var status = "<form name='print_e_ticket_fname' method='POST' id='print_e_ticket_fname' ><input type='hidden' name='userEmail' id='userEmail' /> <input type='hidden' name='userPnrNo' id='userPnrNo' /><table width='100%' border='0' align='center'><tr><td width='100%'>";

	 status = status +  "<div class='container-lb'><div class='rounded-corner-container-lb'><div class='rounded-corner-lb1'></div><div class='rounded-corner-lb2'> </div><div class='rounded-corner-lb3'> </div><div class='rounded-corner-lb4'> </div><div class='rounded-corner-lb5'> </div></div><div class='content-lb'><table><tr><td height='5px'></td></tr><tr><td class='text-12-email' style='color:#173279'>Please enter your MakeMyTrip Id and Email Address to get your booking details.</td></tr><tr><td height='5px'></td></tr><tr><td><table width='70%'><tr><td class='text-12' style='color:#173279'>Make My Trip Id*:</td><td><input type='text' id='mmtPnr' name='mmtPnr' value='Enter your mmt pnr no' Style='color:#696969;' size='25' onBlur='clickPNRText();' onFocus='clickPNRText();' /></td></tr><tr><td height='5px'></td></tr><tr><td class='text-12' style='color:#173279'>Email ID:</td><td><input type='text' id='usrMail' name='usrMail' value='Enter your booking email id' size='25' Style='color:#696969;' onBlur='clickEmailText1();' onFocus='clickEmailText1();'/></td></tr><tr><td height='2px'></td</tr><tr><td></td><td class='text-12' style='color:#173279'><input type='image' src='/BusIntegration/images/bus/submit.gif'  width='85px' border='0' align='middle' onclick='return submitForm();' style='cursor:pointer'/></td></tr></table></td></tr></table></div><div class='rounded-corner-container-lb'><div class='rounded-corner-lb5'> </div><div class='rounded-corner-lb4'> </div> <div class='rounded-corner-lb3'> </div><div class='rounded-corner-lb2'> </div> <div class='rounded-corner-lb1'> </div></div></div></div>";
	 status = status + "</td><td width='2%'></td></tr></table></form>";

	 content.innerHTML = status;
	 
	 document.getElementById('print_e_ticket_box').style.display='block';
	 document.getElementById('print_e_ticket_fade').style.display='block';	
	 
	 document.getElementById('circleanim').style.display="none";
	 if(document.getElementById('selorigin') != null){
	 	document.getElementById("selorigin").disabled = true;
	 }
	 if(document.getElementById('seldestination') != null){
	 	document.getElementById("seldestination").disabled = true;
	 }
	 if(document.getElementById('selbusType') != null){
	 	document.getElementById("selbusType").disabled = true;
	 }
	 if(document.getElementById('bpl') != null){
	 	document.getElementById("bpl").disabled = true;
	 }
	 if(document.getElementById('travel') != null){
	 	document.getElementById("travel").disabled = true;
	 }
    if(document.getElementById('selBP0') != null){
    	if(arrBus != null){
		 for (var i = 0; i < arrBus.length; i++)
    		{
    		
  		 		document.getElementById('selBP'+i).style.display='none';
  		 	}
    	}
	 }
	 if(document.getElementById('no_of_title') != null){
	 var noOfTitle = document.getElementById('no_of_title').value;
	 		for (var i = 0; i < noOfTitle; i++)
    		{
	 			if(document.getElementById('Title_ADT_'+i) != null)
	 				document.getElementById('Title_ADT_'+i).disabled = true;
  		 	}
	 }
	 
	 if(document.getElementById('selPayemntThroughNormal') != null){
	 		document.getElementById('selPayemntThroughNormal').style.display='none';
	 		document.getElementById('overlay_selPayemntThroughNormal').style.display='block';
	 }
	 if(document.getElementById('netbank') != null){
	 		document.getElementById('netbank').style.display='none';
	 		document.getElementById('overlay_netbank').style.display='block';
	 }
	 if(document.getElementById('selPayemntThroughNetBanking') != null){
	 		document.getElementById('selPayemntThroughNetBanking').style.display='none';
	 		document.getElementById('overlay_selPayemntThroughNetBanking').style.display='block';
	 }
	 if(document.getElementById('selPayemntThroughCashCard') != null){
	 		document.getElementById('selPayemntThroughCashCard').style.display='none';
	 		document.getElementById('overlay_selPayemntThroughCashCard').style.display='block';
	 }
	 if(document.getElementById('cardType') != null){
	 		document.getElementById('cardType').style.display='none';
	 }
	 if(document.getElementById('expMonth') != null){
	 		document.getElementById('expMonth').style.display='none';
	 }
	 if(document.getElementById('expYear') != null){
	 		document.getElementById('expYear').style.display='none';
	 }
	 if(document.getElementById('billingCountry') != null){
	 		document.getElementById('billingCountry').disabled = true;
	 }
	 if(document.getElementById('billingState') != null){
	 		document.getElementById('billingState').disabled = true;
	 }	
	 
	 document.getElementsByTagName('body')[0].style.overflow='hidden';
}


function ddrivetip(thetext,thewidth,theheight,pttop,ptleft,top,left,thecolor,image){
	if(ns6||ie){
	if(typeof thewidth!="undefined")
		document.getElementById("dhtmltooltip").style.width=thewidth +"px";
	if(typeof theheight!="undefined")
		document.getElementById("dhtmltooltip").style.height=theheight+"px";
	if(typeof thecolor!="undefined"&&thecolor!="")
		document.getElementById("dhtmltooltip").style.backgroundColor=thecolor;
	if(typeof image!="undefined"){
		document.getElementById("dhtmltooltip").style.border='none';
		document.getElementById("dhtmltooltip").innerHTML="<table width='"+thewidth+"' height='"+theheight+"'><tr><td width='"+thewidth+"' height='"+theheight+"' background='"+image+"' align='center' valign='center' style='padding-bottom:28px;font-size: 10px;'>"+thetext+"</td></tr></table>";
	}else 
		document.getElementById("dhtmltooltip").innerHTML=thetext;enabletip=true; 
		document.getElementById("dhtmlpointer").style.top=pttop+"px";document.getElementById("dhtmlpointer").style.left=ptleft+"px";
	
	if(thetext.indexOf("sorry")!=-1)
		document.getElementById("dhtmltooltip").style.top=top-10+"px";
	else 
		document.getElementById("dhtmltooltip").style.top=top+"px";
		document.getElementById("dhtmltooltip").style.left=left+"px";
		document.getElementById("dhtmlpointer").style.visibility='visible';
		document.getElementById("dhtmltooltip").style.visibility='visible';
		dropdowncount=0;setTimeout(closeCallout,2000);
	}
}

function hideddrivetip(){
	if(ns6||ie){
		enabletip=false;
		document.getElementById("dhtmltooltip").style.visibility="hidden";
		document.getElementById("dhtmlpointer").style.visibility="hidden";
	}
}

function closeCallout(){
	if((document.getElementById("dhtmltooltip").style.visibility=='visible')&&(dropdowncount==0)){
		document.getElementById("dhtmltooltip").style.visibility='hidden';
		document.getElementById("dhtmlpointer").style.visibility='hidden';
	}
	if(dropdowncount==1)
		dropdowncount=0;
}

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };