function callprintoutwindow(poname,podetails)
      {
      var url= 'printout/'+poname+".asp"
      var w="800"
      var h="800"
      var myRand=parseInt(Math.random()*99999999);  
      url=url+"?rand="+myRand;
      url=url+podetails
      var sURL = url
      var sName = "popName2"
      var sFeatures = "menubar=no,scrollbars=yes,resizable=no"
      sFeatures = sFeatures + ",width=" + w + ",height=" + h;
      var wizWin = window.open(sURL, sName, sFeatures);
      }   
      
function ShowRoomAllocation(htlrid,roomcount,maxrooms)
  {
  
  //alert(htlrid+" "+roomcount)
  //alert(htlrid)
  for(var i = 1; i <= maxrooms; i++)  
    {
    //alert('htlr'+htlrid+''+i)
    document.getElementById('htlrb'+htlrid+'0').style.paddingTop='0px';
    document.getElementById('htlrc'+htlrid+'0').style.paddingTop='0px';
    document.getElementById('htlrd'+htlrid+'0').style.paddingTop='0px';
    document.getElementById('htlr'+htlrid+''+i).style.display='none';
    document.getElementById('htlre'+htlrid+''+'0').style.display='';
    }
  for(var i = 1; i <= roomcount; i++) 
    {
    document.getElementById('htlrb'+htlrid+'0').style.paddingTop='12px';
    document.getElementById('htlrc'+htlrid+'0').style.paddingTop='12px';
    document.getElementById('htlrd'+htlrid+'0').style.paddingTop='12px';
    document.getElementById('htlr'+htlrid+''+i).style.display='';
    document.getElementById('htlre'+htlrid+''+'0').style.display='none';
    }
  }

function PriceRoomAllocation(htlid)
  {
  areaToDisplay='CALCHTL'+htlid
  document.getElementById(areaToDisplay).innerHTML='<img src=/images/general/calc-loader.gif><br>'
  var elem = document.getElementById('HTL'+htlid).elements;
  var postinfo="0=0"
  for(var i = 0; i < elem.length; i++)
    {
    postinfo=postinfo+"&"+elem[i].name+"="+elem[i].value
    //alert(elem[i].options[this.selectedIndex].value)
    }
    xmlHttp=GetXmlHttpObject();
  	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request");
  		return;
  	} 
    var url="/sysincludes/CalcAllocation.asp"
    var myRand=parseInt(Math.random()*99999999);  
    url=url+"?rand="+myRand;
    //alert (url+postinfo)
    xmlHttp.onreadystatechange=stateChanged ;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", elem.length);
    xmlHttp.setRequestHeader("Connection", "close");
    xmlHttp.send(postinfo);
  }  

function CallHdst(HCOid)
  {
  areaToDisplay='Tocountries'
	
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/SEH_dest.asp?tafdstcoid="+HCOid
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand

  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

  
  }

function ClientLogin(LoginFrame)
{
	var postinfo='a';
  custEmail=escape(document.getElementById('LogincustEmail').value)
 	custPassword=escape(document.getElementById('LogincustPassword').value)
  postinfo="custEmail="+custEmail+"&custPassword="+custPassword//+"&custType=1"
  areaToDisplay = 'login1';
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  } 
  
  var url="sysincludes/login.asp?Setting=1"
  var myRand=parseInt(Math.random()*99999999);  
  url=url+"&rand="+myRand;
  
  //alert(url+'_'+postinfo);
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("POST",url,true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", 2);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(postinfo);
//alert('1');
}

function contactus()
{
  areaToDisplay='contact'
	
	var postinfo='';
	custSubject=escape(document.getElementById('custSubject').value)
	alert('1');
  custFirstName=escape(document.getElementById('custFirstName').value)
 	custLastName=escape(document.getElementById('custLastName').value)
	
	
	custEmail=escape(document.getElementById('custEmail').value)
 	custText=escape(document.getElementById('custText').value)
	alert('1');
  postinfo="custEmail="+custEmail+"&custPassword="+custPassword
	alert(url+'_'+postinfo);
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  } 
  
  var url="sysincludes/contactaction.asp?Setting=1"
  var myRand=parseInt(Math.random()*99999999);  
  url=url+"&rand="+myRand;
  
  alert(url+'_'+postinfo);
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("POST",url,true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", 2);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(postinfo);
}

function callhotline()
{
  areaToDisplay='callhotline'
	
	var postinfo='';
	
	var hotlSubject=escape(document.getElementById('hotlSubject').value)
	//alert(hotlSubject)
  var hotlFirstName=escape(document.getElementById('hotlFirstName').value)
 	var hotlLastName=escape(document.getElementById('hotlLastName').value)
 	var hotlContactBy=escape(document.getElementById('hotlContactBy').value)
	var hl2captchacode=escape(document.getElementById('hl2captchacode').value)
	
  postinfo="hotlFirstName="+hotlFirstName+"&hotlLastName="+hotlLastName+"&hotlSubject="+hotlSubject+"&hotlContactBy="+hotlContactBy+"&hl2captchacode="+hl2captchacode
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  } 
  
  var url="sysincludes/contactaction.asp?subpage=hotline2"
  var myRand=parseInt(Math.random()*99999999);  
  url=url+"&rand="+myRand;
  
  //alert(url+'_'+postinfo);
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("POST",url,true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", 2);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(postinfo);
}

function switchFltHtl(searchCase,location)
{
  areaToDisplay='fltHTL'
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  
	if (searchCase=='flt')
	{
	 if (location=='sysincludes')
	 {
	 		var url="/include_search/search_inner.asp?location=sysincludes";
	 }
	 else
	 {
	 		var url="/include_search/search_inner.asp?";
	 }
	}
	else
	{
	 if (location=='sysincludes')
	 {
	 		var url="/include_search/search_inner_hotel.asp?location=sysincludes";
	 }
	 else
	 {
	 		var url="/include_search/search_inner_hotel.asp?";
	 }
	 
	} 
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  //alert(url)
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
	//alert(url)
}


function searchAfrica()
{
  areaToDisplay='query'
	var query=escape(document.getElementById('query').value)
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/searchAfrica.asp?query="+query
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  //alert(url)
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
	//alert(url)
}

function showdeparturecal()
        {
        
        if(document.getElementById('TripType'[0]).checked==true)
          {
          
          showd(this,'calendar',-170,20)
          }else{
          showd(this,'calendar3',-170,20)
          }
        }
function checkSEH()
  {
  var postform=true
  if(document.getElementById('HCOid').value==0){alert('Please select country and then destination');postform=false}
  if(document.getElementById('HDSTid').value==0 && postform==true){alert('Please select destination');postform=false}
  if(document.getElementById('CHECKINDateVal').value=='' && postform==true){alert('Please select Check-in date');postform=false}
  if(document.getElementById('CHECKOUTDateVal').value=='' && postform==true){alert('Please select Check-out date');postform=false}
  if(document.getElementById('CHECKOUTDateVal').value<document.getElementById('CHECKINDateVal').value && postform==true){alert('Please select appropriate date range');postform=false}
  if(document.SEH.HinvAdlt.value==0 && postform==true){alert('Please select number of Adults');postform=false}
  if(document.SEH.Hrooms.value==0 && postform==true){alert('Please select number of Rooms');postform=false}
  if(document.SEH.Hrooms.value>document.SEH.HinvAdlt.value && postform==true){alert('The number of Rooms can not be smaller than the number of adults.\nPlease modify.');postform=false}
  if(postform==true){document.getElementById('SEH').submit()}
  }
  
function checkSE()
  {
  var postform=true
  if(document.getElementById('FromDSTid').value==0){alert('Please select Departure origin');postform=false}
  if(document.getElementById('ToDSTid').value==0 && postform==true){alert('Please select Destination');postform=false}
  if(document.getElementById('FromDSTid').value==document.getElementById('ToDSTid').value  && postform==true){alert('Please select different Departure and Destination');postform=false}
  if(document.getElementById('DEPARTUREDateVal').value=='' && postform==true){alert('Please select Departure date');postform=false}
  if(document.getElementById('RETURNDateVal').value=='' && postform==true && document.SE.TripType[0].checked==true){alert('Please select Return Date');postform=false}
  if(document.getElementById('RETURNDateVal').value<document.getElementById('DEPARTUREDateVal').value && postform==true && document.SE.TripType[0].checked==true){alert('Please select appropriate date range');postform=false}
  if(document.SE.paxADLTqty.value==0 && postform==true){alert('Please select number of Adults');postform=false}
  if(postform==true){document.getElementById('SE').submit()}
  }

function CallInnerCal(CalName,CalWindow,MinDate,MaxDate,SelectedDate,DisplayDate)
  {
  areaToDisplay=CalName+CalWindow
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="/sysincludes/SE_calendar.asp?CalName="+CalName+"&CalWindow="+CalWindow+"&MinDate="+MinDate+"&SelectedDate="+SelectedDate+"&DisplayDate="+DisplayDate
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  //alert(url)
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  //alert(CalName+CalWindow)
  }

function Removeitin(invid)
  {
  areaToDisplay="INV_Catch"
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/itin_remove.asp?invid="+invid
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  
  }

function CreatePNR(paxamount)
  {
  var postform=true
  if (CheckPax(paxamount)==false)
    {
    alert('Dear Customer\nPlease check for missing passengers details \nNote that some fields are marked with an astriks and are mandatory');
    postform=false
    }
  if (CheckCustomer()==false && postform==true)
    {
    alert('Dear Customer\nPlease check for missing customer details\nNote that some fields are marked with an astriks and are mandatory');
    postform=false
    }
  if (CheckRulesCheckBoxes()==false && postform==true)
    {
    alert('Dear Customer\nPlease approve reading and accepting Terms & Conditions, No-Shows and cancellation policy.');
    postform=false
    }
  if (postform==true)
    {
    areaToDisplay="SYS_itin"
    var postinfo="0=0"
    var elem = document.getElementById('itin_form').elements;
    for(var i = 0; i < elem.length; i++)
      {
      postinfo=postinfo+"&"+elem[i].name+"="+elem[i].value
      }
      xmlHttp=GetXmlHttpObject();
    	if (xmlHttp==null)
    	{
    		alert ("Browser does not support HTTP Request");
    		return;
    	} 
      var url="sysincludes/makepnr.asp"
      var myRand=parseInt(Math.random()*99999999);  
      url=url+"?rand="+myRand;
      //alert (url+postinfo)
      xmlHttp.onreadystatechange=stateChanged ;
      xmlHttp.open("POST",url,true);
      xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      xmlHttp.setRequestHeader("Content-length", elem.length);
      xmlHttp.setRequestHeader("Connection", "close");
      xmlHttp.send(postinfo);
      
    }
  }

function CheckCustomer()
  {
  var postform=true
  var CheckCustomer=false
  document.getElementById('XcustFirstName').style.display='none'
  document.getElementById('XcustLastName').style.display='none';
  document.getElementById('XcustStreetAddress1').style.display='none'
  document.getElementById('XcustPhone1').style.display='none';
  document.getElementById('XcustCity').style.display='none';
  document.getElementById('XcustEmail').style.display='none';
  document.getElementById('XcustPassword').style.display='none';
  document.getElementById('XcustCountry').style.display='none';
  
  if(document.getElementById('custFirstName').value==''){document.getElementById('XcustFirstName').style.display='';postform=false;}
  if(document.getElementById('custLastName').value==''){document.getElementById('XcustLastName').style.display='';postform=false;}
  if(document.getElementById('custStreetAddress1').value==''){document.getElementById('XcustStreetAddress1').style.display='';postform=false;}
  if(document.getElementById('custPhone1').value==''){document.getElementById('XcustPhone1').style.display='';postform=false;}
  if(document.getElementById('custCity').value==''){document.getElementById('XcustCity').style.display='';postform=false;}
  if(document.getElementById('custEmail').value==''){document.getElementById('XcustEmail').style.display='';postform=false;}
  if(document.getElementById('custPassword').value==''){document.getElementById('XcustPassword').style.display='';postform=false;}
  if(document.getElementById('custCountry').value=='0'){document.getElementById('XcustCountry').style.display='';postform=false;}
  if (postform==false){return false;}else{return true;}
  }

function CheckRulesCheckBoxes()
  {
  var postform=true
  var CheckCustomer=false
  if(document.getElementById('rulcheck').checked==false){postform=false;}
  if(document.getElementById('cancelpol').checked==false){postform=false;}
  if (postform==false){return false;}else{return true;}
  }

function CheckPax(paxamount)
  {
  var postform=true
  var CheckPax=false
  for(var i = 1; i < paxamount+1; i++)
    {
    document.getElementById('paxFirstName'+i).className ='mformselect3';
    document.getElementById('paxLastName'+i).className='mformselect3';
    document.getElementById('paxAge'+i).className='mformselect3';
    if(document.getElementById('paxFirstName'+i).value==''){postform=false;document.getElementById('paxFirstName'+i).className ='mformselect3red';}
    if(document.getElementById('paxLastName'+i).value==''){postform=false;document.getElementById('paxLastName'+i).className='mformselect3red';}
    if(document.getElementById('PAXtitid'+i).value=='3' && document.getElementById('paxAge'+i).value==''){postform=false;document.getElementById('paxAge'+i).className='mformselect3red';}
    }
  if (postform==false){return false;}else{return true;}
  }
  
function CatchINV(invtype,crtiid)
  {
  areaToDisplay="INV_Catch"
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/catchinv.asp?invtype="+invtype+"&crtiid="+crtiid
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  
  }

  
function CatchINVH(htlid)
  {
  areaToDisplay="INVH_Catch"
  var elem = document.getElementById('HTL'+htlid).elements;
  var postinfo="0=0"
  for(var i = 0; i < elem.length; i++)
    {
    postinfo=postinfo+"&"+elem[i].name+"="+elem[i].value
    }
    xmlHttp=GetXmlHttpObject();
  	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request");
  		return;
  	} 
    var url="/sysincludes/catchinvh.asp"
    var myRand=parseInt(Math.random()*99999999);  
    url=url+"?rand="+myRand;
    //alert (url+postinfo)
    xmlHttp.onreadystatechange=stateChanged ;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", elem.length);
    xmlHttp.setRequestHeader("Connection", "close");
    xmlHttp.send(postinfo);
  }  
  
function CallSRflights(FromDSTid,ToDSTid,DepartureDateVal,ReturnDateVal,TripType,paxADLTqty,paxCHLDqty)
  {
  areaToDisplay="SYS_SR"
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/sr_action.asp?FromDSTid="+FromDSTid+"&ToDSTid="+ToDSTid+"&DepartureDateVal="+DepartureDateVal+"&ReturnDateVal="+ReturnDateVal+"&TripType="+TripType+"&paxADLTqty="+paxADLTqty+"&paxCHLDqty="+paxCHLDqty
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  //alert(url)
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  
function CallSRhotels(HCOid,HDSTid,HinvAdlt,HinvKids,Hrooms,CHECKINDateVal,CHECKOUTDateVal)
  {
  areaToDisplay="SYS_SRH"
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/srh_action.asp?HCOid="+HCOid+"&HDSTid="+HDSTid+"&HinvAdlt="+HinvAdlt+"&HinvKids="+HinvKids+"&Hrooms="+Hrooms+"&CHECKINDateVal="+CHECKINDateVal+"&CHECKOUTDateVal="+CHECKOUTDateVal
  var myRand=parseInt(Math.random()*99999999);
  url=url+"&rand="+myRand
  //document.write(url)
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  
function CallSRfilter(FilterSortBy)
  {
  var postinfo="FilterSortBy="+FilterSortBy
  var elem = document.getElementById('SRFilter').elements;
  for(var i = 0; i < elem.length; i++)
    {
    if(elem[i].checked==true){postinfo=postinfo+"&"+elem[i].name+"=1"}else{postinfo=postinfo+"&"+elem[i].name+"=0"}
    }
  //alert(postinfo)
  Callapp('SR_flights','SYS_SR_FLT',postinfo)
  }

function CallHTLSRfilter(FilterSortBy)
  {
  var postinfo="FilterSortBy="+FilterSortBy
  var elem = document.getElementById('SRFilter').elements;
  for(var i = 0; i < elem.length; i++)
    {
    if(elem[i].checked==true){postinfo=postinfo+"&"+elem[i].name+"=1"}else{postinfo=postinfo+"&"+elem[i].name+"=0"}
    }
  //alert(postinfo)
  Callapp('SR_hotels','SYS_SR_HTL',postinfo)
  }	
	
	
function Callapp(appname,applocation,vars)
  {
  areaToDisplay=applocation
  //document.getElementById(areaToDisplay).innerHTML=''
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 
  var url="sysincludes/"+appname+".asp"
  var myRand=parseInt(Math.random()*99999999);
  url=url+"?rand="+myRand+"&"+vars
  //alert (url)
  xmlHttp.onreadystatechange=stateChanged ;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  } 

function stateChanged() 
  { 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {
    switch(areaToDisplay)
      {
			case "SYS_SR_FLT":
        document.getElementById('SYS_SR_FLT').innerHTML=xmlHttp.responseText;
			break	
      case "SYS_SR_HTL":
        document.getElementById('SYS_SR_HTL').innerHTML=xmlHttp.responseText;
      break
      case "SYS_SR":
        location.href='search_result.asp';
      break
      case "SYS_SRH":
        location.href='search_result_hotel.asp';
      break
      case "INV_Catch":
        location.href='/itinerary.asp';
      break
      case "INVH_Catch":
        //alert(xmlHttp.responseText)
        responsefromaction = xmlHttp.responseText;
    		splitFirstValues = responsefromaction.split(";");
        if(splitFirstValues[0]=='001'){alert(splitFirstValues[1])}
        if(splitFirstValues[0]=='000'){location.href='/itinerary.asp';}
        if(splitFirstValues[0]=='999'){alert( xmlHttp.responseText)}
      break
      case "SYS_itin":
        location.href='https://secure.tafrica.com/payment.asp?ID='+xmlHttp.responseText;;
      break
      case "DEPARTURE1":
        document.getElementById('DEPARTURE1').innerHTML=xmlHttp.responseText;
      break
      case "DEPARTURE2":
        document.getElementById('DEPARTURE2').innerHTML=xmlHttp.responseText;
      break
      case "RETURN1":
        document.getElementById('RETURN1').innerHTML=xmlHttp.responseText;
      break
      case "RETURN2":
        document.getElementById('RETURN2').innerHTML=xmlHttp.responseText;
      break
      case "CHECKIN1":
        document.getElementById('CHECKIN1').innerHTML=xmlHttp.responseText;
      break
      case "CHECKIN2":
        document.getElementById('CHECKIN2').innerHTML=xmlHttp.responseText;
      break
      case "CHECKOUT1":
        document.getElementById('CHECKOUT1').innerHTML=xmlHttp.responseText;
      break
      case "CHECKOUT2":
        document.getElementById('CHECKOUT2').innerHTML=xmlHttp.responseText;
      break
      case "Tocountries":
        //alert(xmlHttp.responseText)
        document.getElementById('Tocountries').innerHTML=xmlHttp.responseText;
      break
			case "login1":
					 if(xmlHttp.responseText=="exist")
					 {
					 	document.location.href="myaccount.asp"
					 }
					 else
					 {
					 	alert('Sorry, We cannot seem to find the customer details. \n Please try again.');
					 }
      break
			
			case "query":
					 //alert(xmlHttp.responseText);
					 responsefromaction = xmlHttp.responseText;
    			 splitFirstValues = responsefromaction.split(";");
					 switch(splitFirstValues[0])
           {
            case "r0":
							alert('No results');
						  break;
						case "r10":
							pages = splitFirstValues[1];
    					splitPages = pages.split("_");
							var msg='We have found several results for your query:\n';
							for (f=0;f<splitPages.length;f++)
							{
							 msg=msg+splitPages[f]+'\n';
							}
						  alert(msg);
						  break;
						case "r1":
							//alert('z');
						  var finallink=''
							responsefromaction = splitFirstValues[1];
    					splitValues = responsefromaction.split("_");
							switch(splitValues[1])
              {
               case "1":
							   finallink='/Countries/'+splitValues[0]+'.asp'
    						 document.location.href=finallink
    						 break;
							 case "2":
    						 finallink='/Regions/'+splitValues[0]+'.asp'
    						 document.location.href=finallink
    						 break;
							 case "3":
    						 finallink='/Destinations/'+splitValues[0]+'.asp'
    						 document.location.href=finallink
    						 break;
							}
						  break;
					 }
      break
			
			case "contact":
					 if(xmlHttp.responseText=="OK")
					 {
					 	alert('OK');
					 }
					 else
					 {
					 	alert('Error');
					 }
      break;
			
			case "fltHTL":
					 //alert(xmlHttp.responseText);
					 document.getElementById('SEdiv').innerHTML=xmlHttp.responseText;
      break;
			
			case "callhotline":
					 if(xmlHttp.responseText=="OK")
					 {
					 	alert('Thank You for Contacting TAfrica, We will get back to you shortly TAfrica Support Team');
						closeContentS('hot','reka');
					 }
					 else
					 {
					  if(xmlHttp.responseText=="BADCAPTCHA")
						{
						 	 alert('The Security code is incorrect, Please try again');
						   //document.getElementById('imgCaptcha').src="Sysincludes/captcha.asp?Math.random();";
							 var myRand=parseInt(Math.random()*99999999);
  						 document.getElementById('imgCaptcha').src='Sysincludes/captcha.asp?&rand='+myRand
						}
						else
						{
					 	 alert('Error');
						}
					 }
      break;
			default:
        document.getElementById(areaToDisplay).innerHTML=xmlHttp.responseText;
        //alert(xmlHttp.responseText)
      break;
      }
			
			
			
    }
  }


function GetXmlHttpObject()
  { 
  var objXMLHttp=null;
  if (window.XMLHttpRequest)
    {
    objXMLHttp=new XMLHttpRequest();
    }
    else 
    if (window.ActiveXObject)
      {
      objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    return objXMLHttp;
  }