
var tidFTF ="";
var tidFTFindex ="";
var tidFTSearch ="";
function callft(pURLFTF,tidFTFN, tidFTFindexN, tidFTSearchN){
document.getElementById('toDiv').innerHTML="<table><tr><td  style='font-size: 9px'> Please Wait...</td></tr></table>"
tidFTF = tidFTFN;
tidFTFindex = tidFTFindexN;
//tidFTSearch = tidFTSearchN;
var ftdateajxlay = new Date();
var URLFTF = pURLFTF+"&t="+ftdateajxlay.getTime();
FTFHttpRequest=makeRequestTG();
getFTFUrl(FTFHttpRequest,URLFTF, tidFTSearchN);
}

function getFTFUrl(FTFhttpRequest,FTFurl, FTFtidFTSearchN) {
	FTFhttpRequest.onreadystatechange = function(){doFTFParse(FTFhttpRequest, FTFtidFTSearchN);};
        try {
        	FTFhttpRequest.open('GET', FTFurl, true);
        	}	 
        	catch (e) { alert (e);}
        FTFhttpRequest.send('');
    }
    
function doFTFParse(parseFTFhttpRequest, doFTFParseFTFtidFTSearchN) {
		var returnVal="";
        if (parseFTFhttpRequest.readyState == 4) {
            if (parseFTFhttpRequest.status == 200) {        
            	writeFTFcontent(parseFTFhttpRequest.responseText, doFTFParseFTFtidFTSearchN);
            } else {
            	writeFTFcontent('Try Again', doFTFParseFTFtidFTSearchN);            
            }
        }
}
    
function writeFTFcontent(FTFtext, writeFTFcontentFTFtidFTSearchN){


	var reNFTF = /Oops!/;
	var reNFTF1 = /HTTP Status 500/;
		if (reNFTF.test(FTFtext)){
			writeFTFcontentReturnVal ="Try Again";
			}
			else{					
				if (reNFTF1.test(FTFtext)){
					writeFTFcontentReturnVal ="Try Again";
				}
				else{
					writeFTFcontentReturnVal =FTFtext;
				  }
		}

document.getElementById('toDiv').innerHTML=writeFTFcontentReturnVal;
if (document.TravelBkgSearchForm.toLocation != null){
	document.TravelBkgSearchForm.toLocation.focus();
}
if (tidFTF != ""){
	document.TravelBkgSearchForm.toLocation.value = tidFTF;
}
if (tidFTFindex != ""){
	document.TravelBkgSearchForm.toLocation.selectedIndex=tidFTFindex;	
}	
storeFromSelectedIndex();
storeToSelectedIndex();
if (writeFTFcontentFTFtidFTSearchN != ""){
	search();
}
}

function diva(fromid,toid,tdate){document.TravelBkgSearchForm.datePickup.value = tdate;	document.TravelBkgSearchForm.specialFlag.value = '1';document.TravelBkgSearchForm.fromLocation.value = fromid;changeToFetch(document.TravelBkgSearchForm.fromLocation,toid,'','yes');}
