			var searchFormVValue=-1;
			var today=new Date();
			var this_year=today.getYear();
			var next_year=this_year+1;
			var xmlHttp;
			var isMozilla = false;
						
			var departurePointCountry;
		    var departurePointCode;
			var departurePoint;
			var arrivalPointCountry;
			var arrivalPointCode;
			var arrivalPoint;
			var departureDay;
			var departureMonth;
			var departureYear;
			var arrivalDay;
			var arrivalMonth;
			var arrivalYear;
			var numberOfAdults;
			var numberOfChildren;
			var numberOfInfants;
			
			var internalQueryParameters = new Array();
			
			var kelkooSearchResultsLoaded = false;
			var kayakSearchResultsLoaded = false;
			var travelFusionSearchResultsLoaded = false;
			var tsmSearchResultsLoaded = false;
			var mobSearchResultsLoaded = false;
			var skySearchResultsLoaded = false;
			var wegoResultsLoaded = false;
			var momondoResultsLoaded = false;
			var cheapflightsResultsLoaded = false;
			var lastminuteResultsLoaded = false;
			var ebookersResultsLoaded = false;
			var expediaResultsLoaded = false;
			var opodoResultsLoaded = false;
			var netflightsResultsLoaded = false;
			var globaltravelResultsLoaded = false;
			var pricelineResultsLoaded = false;
			var travelocityResultsLoaded = false;
			var thomascookResultsLoaded = false;
			var terminalaResultsLoaded = false;
			var FlightsdirectResultsLoaded = false;
			var travelmarketResultsLoaded = false;
			var farecastResultsLoaded = false;
			var flyResultsLoaded = false;
			
			var airportMappings = new Array();
			
			var IS_IE = false;
			var IS_MOZILLA = false;
			function setBrowserType()
			{
				if (BrowserDetect.browser == "Firefox")
				{
					IS_MOZILLA = true;
					IS_IE = false;
				}
				else if (BrowserDetect.browser == "Explorer")
				{
					IS_MOZILLA = false;
					IS_IE = true;
				}
			}
			
			function SetCookie() 
			{
				if(arguments.length < 2) 
				{ 
					return; 
				}
				var n = arguments[0];
				var v = arguments[1];
				var d = 0;
				if(arguments.length > 2) 
				{ 
					d = parseInt(arguments[2]); 
				}
				var exp = '';
				if(d > 0) 
				{
					var now = new Date();
					then = now.getTime() + (d * 24 * 60 * 60 * 1000);
					now.setTime(then);
					exp = '; expires=' + now.toGMTString();
				}
				document.cookie = n + "=" + escape(String(v)) + '; path=/' + exp;
			} 
			
			function ReadCookie(n) 
			{
				var cookiecontent = new String();
				if(document.cookie.length > 0) 
				{
					var cookiename = n+ '=';
					var cookiebegin = document.cookie.indexOf(cookiename);
					var cookieend = 0;
					if(cookiebegin > -1) 
					{
						cookiebegin += cookiename.length;
						cookieend = document.cookie.indexOf(";",cookiebegin);
						if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
						cookiecontent = document.cookie.substring(cookiebegin,cookieend);
					}
				}
				return unescape(cookiecontent);
			} 
			
			function setDepartureDateMainForm(y,m,d)
			{
				var departureDaySelect = document.getElementById("departureDay"); 
				var departureMonthSelect = document.getElementById("departureMonth"); 
				var departureYearSelect = document.getElementById("departureYear"); 
				

				departureDaySelect.selectedIndex = d;
				departureMonthSelect.selectedIndex = m;
				departureYearSelect.selectedIndex = y-this_year;								
			}
			
			function getCorrectDay(m,d)
			{
				if (d == 31 && (m==0 || m==2 || m==4 || m==6 || m ==7 || m==9 || m==11))
					return 0;
				else if (d == 30 && (m==1 || m==3 || m==5 || m==8 || m ==10))
					return 0;
				
				return d;
			}
			
			function getCorrectMonth(m,d)
			{
				if (d == 31 && (m==0 || m==2 || m==4 || m==6 || m ==7 || m==9 || m==11))
					return m+1;
				else if (d == 30 && (m==1 || m==3 || m==5 || m==8 || m ==10))
					return m+1;
				
				return m;
			}

			function setReturnDateMainForm(y,m,d)
			{
				
			}
			
			function resetDatesMainForm()
			{
				var correctDay = getCorrectDay(today.getMonth(),today.getDate());
				var correctMonth = getCorrectMonth(today.getMonth(),today.getDate());

				setDepartureDateMainForm(today.getYear(), correctMonth, correctDay);
				
				correctDay = getCorrectDay(correctMonth+1, correctDay);
				correctMonth = getCorrectMonth(correctMonth+1, correctDay);


				
				departurePointCountry = document.getElementById("departurePointCountry");
				departurePointCode = document.getElementById("departurePointCode");
				departurePoint = document.getElementById("departurePoint");
				arrivalPointCountry = document.getElementById("arrivalPointCountry");
				arrivalPointCode = document.getElementById("arrivalPointCode");
				arrivalPoint = document.getElementById("arrivalPoint");
				departureDay = document.getElementById("departureDay");
				departureMonth = document.getElementById("departureMonth");
				departureYear = document.getElementById("departureYear");

				numberOfAdults = document.getElementById("numberOfAdults");
				numberOfChildren = document.getElementById("numberOfChildren");
				numberOfInfants = document.getElementById("numberOfInfants");
				
				//populateCountries();
				
				//setBrowserType();
				
				populateDefaultValues();
			}
			
			function populateDefaultValues()
			{
                selectDefaultValue('departurePointCountry', ReadCookie('departurePointCountry'));
                selectDefaultValue('departurePointCode'   , ReadCookie('departurePointCode'));
                
                if (  ReadCookie('departurePoint').length > 0 )
                {
                    selectDefaultValue('departurePoint', ReadCookie('departurePoint'));
                }

                selectDefaultValue('arrivalPointCountry', ReadCookie('arrivalPointCountry'));
                selectDefaultValue('arrivalPointCode'   , ReadCookie('arrivalPointCode'));

                if (  ReadCookie('arrivalPoint').length > 0 )
                {
                    selectDefaultValue('arrivalPoint', ReadCookie('arrivalPoint'));
                }

                selectDefaultValue('departureDay'  , ReadCookie('departureDay'));
                selectDefaultValue('departureMonth', ReadCookie('departureMonth'));
                selectDefaultValue('departureYear' , ReadCookie('departureYear'));



                selectDefaultValue('numberOfAdults'  , ReadCookie('numberOfAdults'));
                selectDefaultValue('numberOfChildren', ReadCookie('numberOfChildren'));
                selectDefaultValue('numberOfInfants' , ReadCookie('numberOfInfants'));
			}
			
			function selectDefaultValue(selectObjID, value)
			{
			    var selectObj = document.getElementById(selectObjID); 
			 
				if ( typeof(selectObj.options) != 'undefined' )
				{
				    for (var i=0; i<selectObj.options.length; i++)
				    {
					    if (selectObj.options[i].value == value)
					    {
					 	    selectObj.selectedIndex = i;
						    break;
					    }
				    }
			    }
			    else
			    {
                    selectObj.value = value;
                }
			}
			
			function populateCities(countrySelectID, citySelectID)
			{
				var countrySelectObj = document.getElementById(countrySelectID);
				var selectedCountry = countrySelectObj[countrySelectObj.selectedIndex].value;
				
				var citySelectObj = document.getElementById(citySelectID);
				citySelectObj.length = 1;
				var allCities = airportMappings[selectedCountry];
				
				var counter = 1;
				for (var i=0; i<allCities.length; i+=2)
				{
					var option = new Option(allCities[i+1], allCities[i]);	
					citySelectObj[counter++] = option;
				} 
			}
			
			function submitCommonSearch()
			{
				var uri = 'departure=' + departurePointCode.value;
				uri += '&arrival=' + arrivalPointCode.value;
				uri += '&departureDay=' + departureDay[departureDay.selectedIndex].value;
				uri += '&departureMonth=' + departureMonth[departureMonth.selectedIndex].value;
				uri += '&departureYear=' + departureYear[departureYear.selectedIndex].value;

				uri += '&adults=' + numberOfAdults[numberOfAdults.selectedIndex].value;
				uri += '&children=' + numberOfChildren[numberOfChildren.selectedIndex].value;
				uri += '&infants=' + numberOfInfants[numberOfInfants.selectedIndex].value;
				
				uri += '&departureCountryName=' + departurePointCountry.value;
				uri += '&arrivalCountryName=' + arrivalPointCountry.value;
				uri += '&departureCityName=' + departurePoint.value;
				uri += '&arrivalCityName=' + arrivalPoint.value;
                
                SetCookie('departurePointCountry', departurePointCountry.value, 3000);
                SetCookie('departurePointCode'   , departurePointCode.value   , 3000);
                SetCookie('departurePoint'       , departurePoint.value       , 3000);

                SetCookie('arrivalPointCountry', arrivalPointCountry.value, 3000);
                SetCookie('arrivalPointCode'   , arrivalPointCode.value   , 3000);
                SetCookie('arrivalPoint'       , arrivalPoint.value       , 3000);

                SetCookie('departureDay'  , departureDay[departureDay.selectedIndex].value    , 3000);
                SetCookie('departureMonth', departureMonth[departureMonth.selectedIndex].value, 3000);
                SetCookie('departureYear' , departureYear[departureYear.selectedIndex].value  , 3000);



                SetCookie('numberOfAdults'  , numberOfAdults[numberOfAdults.selectedIndex].value, 3000);	
                SetCookie('numberOfChildren', numberOfChildren[numberOfChildren.selectedIndex].value, 3000);
                SetCookie('numberOfInfants' , numberOfInfants[numberOfInfants.selectedIndex].value, 3000);

				window.location="onewayresults.html?" + uri;
			}
			
			function _submitCommonSearch()
			{
				searchKelkoo();
				searchKayak();
				searchDohop();
				searchMobissimo();
				searchSkyScanner();
				searchWego();
				searchMomondo();
				searchCheapflights();
				searchLastminute();
				searchEbookers();
				searchExpedia();
				searchOpodo();
				searchNetflights();
				searchGlobaltravel();
				searchPriceline();
				searchTravelocity();
				searchThomascook();
				searchTerminala();
				searchFlightsdirect();
				searchTravelmarket();
				searchFarecast();
				searchFly();
				
				wait(3500);
			}
			
			function createCookiev(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookiev(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}	

			function searchKelkoo()
			{
				var departurev=internalQueryParameters["departure"].toLowerCase();
				var arrivalv=internalQueryParameters["arrival"].toLowerCase();

				var uri = '';
				uri += 'from=' + departurev + '&to=' + arrivalv;
				uri += '&dep_day=' + internalQueryParameters["departureDay"] + '&dep_month=' + internalQueryParameters["departureMonth"] + '&dep_year=' + internalQueryParameters["departureYear"];
				uri += '&num_adults=' + internalQueryParameters["adults"] + '&num_children=' + internalQueryParameters["children"] + '&num_babies=' + internalQueryParameters["infants"];
				var lur=internalQueryParameters["departureCountryName"];
				lur+='+'+internalQueryParameters["arrivalCountryName"];
				lur+='+'+internalQueryParameters["departureCityName"];
				lur+='+'+internalQueryParameters["arrivalCityName"];
				lur+='+'+internalQueryParameters["departureDay"];
				lur+='+'+internalQueryParameters["departureMonth"];
				lur+='+'+internalQueryParameters["departureYear"];
				lur+='+l+s+r';
				lur+='+'+internalQueryParameters["adults"];
				lur+='+'+internalQueryParameters["children"];
				lur+='+'+internalQueryParameters["infants"];
				var hfrnt= readCookiev('t_lh');
				if(!hfrnt)
				{var lurv='nys';}
				else{var lurv=readCookiev('t_lh');}	
				lur+='+ow';
				lur+='+'+lurv;

 document.getElementById("kelkooR").innerHTML='<form action="results.php" method="post" style="display:inline;" name="KelkooRv" id="kelkooRv" target="kelkoolFrame"><input type="hidden" name="rs"><input type="hidden" name="hk"></form>';
 document.KelkooRv.rs.value=uri;
 document.KelkooRv.hk.value=lur;
 document.KelkooRv.submit();

			}
			
			function searchKayak()
			{
				var uri = _searchKayakInternal();
				
    			if (IS_MOZILLA)
    			{
    				var kayakIFrame = document.getElementById("kayakIFrame");
    				kayakIFrame.src = uri;
				}
				else if (IS_IE)
				{
					var kayakIFrame = document.getElementById("kayakIFrame");
					
    				kayakIFrame.src = uri;
    			}
			}
			
			function searchKayakInNewWindow()
			{
				var uri = _searchKayakInternal();
				window.open(uri, "kayakSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchKayakInternal()
			{
				var uri = 'http://trk.acetrk.com/r/BJ/TM/TJ/?url_id=180&url=';
				uri += 'http%3A%2F%2Fwww.kayak.com%2Fs%2Fsearch%2Fair%3Fai%3Datrinsic%26p%3D180%252FTJ%252FTM%26ft%3Dow%26ns%3Dn%26cb%3De%26l1%3D' + internalQueryParameters["departure"] + '%26l2%3D' + internalQueryParameters["arrival"];
				uri += '%26d1%3D' + internalQueryParameters["departureMonth"] + '%252F' + internalQueryParameters["departureDay"] + '%252F' + internalQueryParameters["departureYear"] + '%26d2%3D' + internalQueryParameters["returnMonth"] + '%252F' + internalQueryParameters["returnDay"] + '%252F' + internalQueryParameters["returnYear"];

				return uri;
			}

		function searchLiligoInNewWindow()
			{
document.getElementById('background_').style.backgroundPosition='-2010px 0';
				var uri = _searchLiligoInternal();

document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';

document.getElementById('first_column').innerHTML='<iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="float:right;width:1000px;height:1750px;display:inline;margin:0;padding:0;position:relative;top:-128px;right:0;" scrolling="yes"></iframe>';
document.getElementById('kelkoolFramev').src=uri;



document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='hidden';
var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}



searchLiligoInNewWindowb();


/*				window.open(uri, "LiligoSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
*/
			}


							function searchLiligoInNewWindowb()
							{
document.getElementById('first_column').style.width='70%';
document.getElementById('second_column').style.width='30%';
document.getElementById('Layer2').style.marginTop='-220px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1800px';
setTimeout('scrollto()',5500);
			}

function _searchLiligoInternal()
            {

                var uri = 'http://www.anrdoezrs.net/click-3476948-10736967?url=http://www.liligo.co.uk/air/SearchFlights.jsp?roundTrip=';
				uri += '&fromLocation=' + internalQueryParameters["departure"];
				uri += '&toLocation=' + internalQueryParameters["arrival"];
				uri += '&depDay=' + internalQueryParameters["departureDay"] + '&depMonth=' + _get1DigitValueForLiligo(internalQueryParameters["departureMonth"]) + '&depYear=' + internalQueryParameters["departureYear"];
				uri += '&retDay=' + internalQueryParameters["returnDay"] + '&retMonth=' + _get1DigitValueForLiligo(internalQueryParameters["returnMonth"]) + '&retYear=' + internalQueryParameters["returnYear"];
				uri += '&adults=' + internalQueryParameters["adults"] + '&children=' + internalQueryParameters["children"] + '&infants=' + internalQueryParameters["children"] + '&class=EC&includeNearbyAirports=on&dtime=anytime&rtime=anytime&depDayInterval=3&retDayInterval=3&searchDomain=liligo.co.uk&utm_medium=affiliationUK&utm_source=CJ&utm_campaign=engines&utm_term=468x60&utm_content=flight';
				return uri;
}

	function scrollto(){document.getElementsByTagName('body')[0].style.overflowX='hidden';}

function searchKelkooInNewWindow(){
document.getElementById('background_').style.backgroundPosition='0px 0';
document.getElementById('first_column').innerHTML='';
if(screen.width<1152){
document.getElementById('first_column').innerHTML='<iframe id="kelkoolFrame" name="kelkoolFrame" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:662px;float:right;height:100%;display:inline;margin:0;padding:0;" scrolling="no"></iframe>';
}
else{
document.getElementById('first_column').innerHTML='<iframe id="kelkoolFrame" name="kelkoolFrame" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:862px;float:right;height:100%;display:inline;margin:0;padding:0;" scrolling="no"></iframe>';
}


document.getElementById('first_column').style.width='66%';
document.getElementById('second_column').style.width='34%';
document.getElementById('Layer2').style.marginTop='0px';


var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='12px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='312px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='612px';
}

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='3250px';


document.KelkooRv.submit();
}
			
			

			function searchTravelFusion()
			{
				try
				{
					var tfform = null;
					
					if (IS_MOZILLA)
					{
						tfform = document.getElementById('tfIFrame').contentWindow.document.getElementById('TFForm');
					}
					else if (IS_IE)
					{
						tfform = document.frames['tfIFrame'].document.getElementById('TFForm');
					}
					tfform['from'].value = internalQueryParameters["departure"];
					tfform['to'].value = internalQueryParameters["arrival"];
					tfform['journeyType'].value = "return";
					
					tfform['outwardDay'].value = _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
					tfform['outwardMonth'].value = _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + "-" + internalQueryParameters["departureYear"];
					tfform['returnDay'].value = _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]);
					tfform['returnMonth'].value = _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + "-" + internalQueryParameters["returnYear"];
					
					try
					{
						tfform.submit();
						tfform["TFSearch"].click();
					}
					catch(e)
					{
						alert(e.message);
					}
			}
			catch(e)
			{
				alert(e.message);
			}
			}
			
			function searchDohop()
			{
				var uri = _searchDohopInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchDohopInNewWindow()
			{
document.getElementById('background_').style.backgroundPosition='-4020px 0';
				var uri = _searchDohopInternal();

document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';

document.getElementById('first_column').innerHTML='<iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="float:right;width:800px;height:1450px;display:inline;margin:0;padding:0;position:relative;top:0px;right:0;" scrolling="yes"></iframe>';
document.getElementById('kelkoolFramev').src=uri;



document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='hidden';
var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}



searchDohopInNewWindowb();


/*				window.open(uri, "dohopSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
*/
			}


							function searchDohopInNewWindowb()
							{
if(screen.width<=1152){
document.getElementById('first_column').style.width='85%';
document.getElementById('second_column').style.width='15%';
}
else{
document.getElementById('first_column').style.width='67%';
document.getElementById('second_column').style.width='33%';
}
document.getElementById('Layer2').style.marginTop='-220px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1500px';
setTimeout('scrollto()',5500);
			}
			
			function _searchDohopInternal()
			{
				var uri = 'http://www.dohop.com/g/';
				
				var departureCode = _getCodeForDohop(internalQueryParameters["departure"]); 
				var arrivalCode = _getCodeForDohop(internalQueryParameters["arrival"]); 
				
				uri += '#a1=' + departureCode;
				uri += '&a2=' + arrivalCode;
				uri += '&d1=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + _get2DigitValueForYear(internalQueryParameters["departureYear"]);
				
				return uri;
			}
			
			function searchMobissimo()
			{
				var uri = _searchMobissimoInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchMobissimoInNewWindow()
			{
				var uri = _searchMobissimoInternal();
				window.open(uri, "mobissimoSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchMobissimoInternal()
			{
				var departureCountryName = internalQueryParameters["departureCountryName"];
				var arrivalCountryName = internalQueryParameters["arrivalCountryName"];
				var departureCityName = internalQueryParameters["departureCityName"];
				var arrivalCityName = internalQueryParameters["arrivalCityName"];
								
				var uri = 'http://www.bookingbuddy.co.uk/r/?r=i4398148&host=&argschk=1&search_mode=air&af=1274193&st=oneway&nt=1';
			    uri += '&dc=' + departureCityName + '%2C+' + departureCountryName + '+%28' + internalQueryParameters["departure"] + '%29';
				uri += '&ac=' + arrivalCityName + '%2C+' + arrivalCountryName + '+%28' + internalQueryParameters["arrival"] + '%29';
				uri += '&departure_date=' + internalQueryParameters["departureDay"] + '%2F' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '%2F' + internalQueryParameters["departureYear"] + '&dt=anytime';
				uri += '&return_date=' + internalQueryParameters["returnDay"] + '%2F' +  _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + '%2F' + internalQueryParameters["returnYear"] + '&rt=anytime&sc=economy_coach';
				return uri;
			}
			
			function searchSkyscanner()
			{
				var uri = _searchSkyscannerInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchSkyscannerInNewWindow()
			{
				var uri = _searchSkyscannerInternal();
				window.open(uri, "skyscannerSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchSkyscannerInternal()
			{
				var uri = 'http://www.jdoqocy.com/click-1915490-10644875?url=http://www.skyscanner.net/flights';
				
				var departureCode = (internalQueryParameters["departure"]); 
				var arrivalCode = _getCodeForDohop(internalQueryParameters["arrival"]); 
								
				uri += '/' + departureCode;
				uri += '/' + arrivalCode;
				uri += '/' + _get2DigitValueForYear(internalQueryParameters["departureYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '/?associateid=AFF_NTW_00014_00001';
				return uri;
			}
			
			function searchWego()
			{
				var uri = _searchWegoInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
					function searchWegoInNewWindow()
			{
document.getElementById('background_').style.backgroundPosition='-7035px 0';
				var uri = _searchWegoInternal();

document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';

document.getElementById('first_column').innerHTML='<iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="float:right;width:787px;height:1250px;display:inline;margin:0;padding:0;position:relative;top:-68px;right:0;" scrolling="yes"></iframe>';
document.getElementById('kelkoolFramev').src=uri;



document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='hidden';
var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}



searchWegoInNewWindowb();


/*				window.open(uri, "dohopSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
*/
			}


							function searchWegoInNewWindowb()
							{
if(screen.width<=1152){
document.getElementById('first_column').style.width='90%';
document.getElementById('second_column').style.width='10%';
}
else{
document.getElementById('first_column').style.width='68%';
document.getElementById('second_column').style.width='32%';
}
document.getElementById('Layer2').style.marginTop='-290px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1300px';
setTimeout('scrollto()',5500);
			}

			
			function _searchWegoInternal()
			{
				var departureCountryName = internalQueryParameters["departureCountryName"];
				var arrivalCountryName = internalQueryParameters["arrivalCountryName"];
				var departureCityName = internalQueryParameters["departureCityName"];
				var arrivalCityName = internalQueryParameters["arrivalCityName"];
								
				var uri = 'http://affiliates.wego.com/scripts/t.php?aff_aid=dc404691&aff_bid=&aff_desturl=http://whitelabel.wego.com/flights/progress.html?roundTrip=false';
				uri += '%26origin%3D' + departureCityName + '%252C%2B' + departureCountryName + '%2B%2528' + internalQueryParameters["departure"] + '%2529%26from%3D' + internalQueryParameters["departure"];
				uri += '%26destination%3D' + arrivalCityName + '%252C%2B' + arrivalCountryName + '%2B%2528' + internalQueryParameters["arrival"] + '%2529%26to%3D' + internalQueryParameters["arrival"];
				uri += '%26outboundDate%3D' + internalQueryParameters["departureDay"] + '%252F' + internalQueryParameters["departureMonth"] + '%252F' + internalQueryParameters["departureYear"] + '%26outboundTime%3DAnytime';
				uri += '%26inboundDate%3D' + internalQueryParameters["returnDay"] + '%252F' + internalQueryParameters["returnMonth"] + '%252F' + internalQueryParameters["returnYear"] + '%26inboundTime%3DAnytime';
				uri += '%26adults%3D' + internalQueryParameters["adults"] + '%26children%3D' + internalQueryParameters["children"] + '%26cabinClass%3DEconomy%26dateformat%3D%2525d%252F%2525m%252F%2525Y%26dateformat_js%3Ddd%252Fmm%252Fyy%26wgz%3D65cc7'
				return uri;
			}
			
			function searchMomondo()
			{
				var uri = _searchMomondoInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchMomondoInNewWindow()
			{
document.getElementById('background_').style.backgroundPosition='-1005px 0';
				var uri = _searchMomondoInternal();

document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
document.getElementById('first_column').innerHTML='<iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:1024px;float:right;height:1600px;display:inline;margin:0;padding:0;position:relative;top:-400px;" scrolling="yes"></iframe>';
document.getElementById('kelkoolFramev').src=uri;

document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='visible';

var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}


searchMomondoInNewWindowb();
			}

							function searchMomondoInNewWindowb(){
if(screen.width=='1024'){
document.getElementById('first_column').style.width='100%';
document.getElementById('second_column').style.width='0%';
document.getElementById('kelkoolFramev').style.left='-11px';
}
else{
document.getElementById('first_column').style.width='75%';
document.getElementById('second_column').style.width='25%';
}
document.getElementById('Layer2').style.marginTop='-320px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1185px';
setTimeout('scrollto()',5500);
			}

			
			function _searchMomondoInternal()
			{
				var uri = 'http://cheapflightsfinder.en.momondo.com/Compare_Flights.aspx?Search=true';
				uri += '&O=' + internalQueryParameters["departure"];
				uri += '&D=' + internalQueryParameters["arrival"];
				uri += '&DD=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '-' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '-' + internalQueryParameters["departureYear"];
				uri += '&RT=false';
				return uri;
			}
			
			function searchCheapflights()
			{
				var uri = _searchCheapflightsInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
function br_detect(){
			if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
			var oprversion=new Number(RegExp.$1)
			 if (oprversion>=7)
			{var bvdt = 'opera';}
			}
			else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
			var ieversion=new Number(RegExp.$1)
			 if (ieversion>=8)
			{var bvdt = 'ie8';}
			 else if (ieversion>=7)
			{var bvdt = 'ie7';}
			 else if (ieversion>=6)
			{var bvdt = 'ie6';}
			}
			else if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
			var ffversion=new Number(RegExp.$1)
			 if (ffversion>=3)
			  {var bvdt = 'firefox';}
			else if (ffversion>=1)
			  {var bvdt = 'ofirefox';}
			}
			else if (/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
			var chromeversion=new Number(RegExp.$1)
			 if (chromeversion>=1)
			  {var bvdt = 'chrome';}
			}
			else if (/Safari[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
			var safariversion=new Number(RegExp.$1)
			 if (safariversion>=1)
			  {var bvdt = 'safari';}
			}
			  return bvdt;
}

	function searchCheapflightsInNewWindow(o)
			{
document.getElementById('background_').style.backgroundPosition='-8040px 0';
				var uri = _searchCheapflightsInternal();
if(uri=='nonukdep'){
document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
document.getElementById('first_column').innerHTML='<table style="width:100%;margin:0;border:0;border-collapse:collapse;text-align:center;vertical-align:top;position:relative;left:0px;"><tr><td style="width:100%;text-align:center;vertical-align:top;margin:0;padding:0;"><div style="width:400px;display:inline;font-size:13px;font-family:helvetica,arial,verdana,sans-serif;color:#333333;font-weight:bolder;position:relative;top:1px;right:5px;padding:0;margin:0;float:right;">Cheapflights.co.uk only searches for deals departing from the UK - Please select another site from the tabs above</div></td></tr></table>';

var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}


document.getElementById('first_column').style.width='60%';
document.getElementById('second_column').style.width='40%';
document.getElementById('Layer2').style.marginTop='-320px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1185px';
}
else{
if(o!='.'){
if(screen.width>1280){
var separator='right:-80px;';
}
else{var separator='';}
document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
document.getElementById('first_column').innerHTML='<table style="width:100%;margin:0;border:0;border-collapse:collapse;text-align:center;vertical-align:top;position:relative;left:-101px;padding-bottom:0;"><tr><td style="width:100%;text-align:center;vertical-align:top;margin:0;padding:0;"><iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:984px;height:3200px;display:inline;position:relative;top:-220px;'+separator+'margin:0;padding:0;" scrolling="yes"></iframe></td></tr></table>';
document.getElementById('kelkoolFramev').src=uri;

if(screen.width=='1280'){
document.getElementById('kelkoolFramev').style.right='-91px';
document.getElementById('Layer2').style.marginTop='-320px';
}

document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='visible';

var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='none';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='none';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='none';
document.getElementById('ad_md3').style.top='602px';
}

document.getElementById('first_column').style.width='100%';
document.getElementById('second_column').style.width='0%';

var br_tkv=br_detect();
if(br_tkv!='firefox'){
document.getElementById('br_tk').style.top='0px';
}
searchCheapflightsInNewWindowb();


}
if(o=='.'){				window.open(uri, "CheapflightsSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");}
}
			}

							function searchCheapflightsInNewWindowb(){

document.getElementById('first_column').style.width='100%';
document.getElementById('second_column').style.width='0%';
document.getElementById('Layer2').style.marginTop='-320px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1185px';
setTimeout('scrollto()',5500);
}
			
			function _searchCheapflightsInternal()
			{
				var uri = 'http://clk.tradedoubler.com/click?p=81241&a=1209556&url=http://www.cheapflights.co.uk/workers/syndication/redirect.aspx?affId=1209556&prgId=81241&adId=0';
				uri += '&cf-to=' + internalQueryParameters["arrival"];
				uri += '&cf-from=' + internalQueryParameters["departure"];
				uri += '&cf-affiliatenetwork=TradeDoubler&cf-url=Home'; 
var dep=internalQueryParameters["departure"];
if((dep=='ABB') || (dep=='ABZ') || (dep=='ADV') || (dep=='ADX') || (dep=='AYH') || (dep=='BBP') || (dep=='BBS') || (dep=='BEB') || (dep=='BEQ') || (dep=='BEX') || (dep=='BFS') || (dep=='BHD') || (dep=='BHX') || (dep=='BLK') || (dep=='BOH') || (dep=='BOL') || (dep=='BQH') || (dep=='BRR') || (dep=='BRS') || (dep=='BUT') || (dep=='BWF') || (dep=='BZZ') || (dep=='CAX') || (dep=='CBG') || (dep=='CEG') || (dep=='COL') || (dep=='CRN') || (dep=='CSA') || (dep=='CVT') || (dep=='CWL') || (dep=='FAB') || (dep=='FZO') || (dep=='GCI') || (dep=='GLA') || (dep=='GLO') || (dep=='HAW') || (dep=='HUY') || (dep=='IOM') || (dep=='JER') || (dep=='KOI') || (dep=='LBA') || (dep=='LCY') || (dep=='LGW') || (dep=='LHR') || (dep=='LON') || (dep=='LPL') || (dep=='LSI') || (dep=='LTN') || (dep=='NCL') || (dep=='NQY') || (dep=='NWI') || (dep=='MAN') || (dep=='MHZ') || (dep=='MME') || (dep=='MSE') || (dep=='ODH') || (dep=='ORM') || (dep=='PIK') || (dep=='PLH') || (dep=='PSY') || (dep=='QCY') || (dep=='QLA') || (dep=='QUG') || (dep=='RCS') || (dep=='SCS') || (dep=='SOU') || (dep=='STN') || (dep=='SWS') || (dep=='SYY') || (dep=='UHF') || (dep=='DGX') || (dep=='DND') || (dep=='DOC') || (dep=='DSA') || (dep=='EDI') || (dep=='EMA') || (dep=='ENK') || (dep=='ESH') || (dep=='EXT')) {
return uri;
}
				else{return 'nonukdep';}
			}
			
			function searchLastminute()
			{
				var uri = _searchLastminuteInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
function increase_width(){
var total_width=document.getElementById('wait_lastminute').style.width;
var total_widthvv=total_width.substr(0,3);
var total_widthvvv=parseInt(total_widthvv);
if(total_widthvvv<320){
document.getElementById('pre_wait_lm').style.display='block';
var p_w=(total_widthvvv+1-0);
document.getElementById('wait_lastminute').style.width=p_w+'px';
setTimeout("increase_width()",260);
}
else{$("#pre_wait_lm").fadeOut("slow");}
}

		
	function searchLastminuteInNewWindow(o)
			{
document.getElementById('background_').style.backgroundPosition='-6030px 0';
				var uri = _searchLastminuteInternal();
if(o!='.'){
document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
document.getElementById('first_column').innerHTML='<table style="width:100%;margin:0;border:0;border-collapse:collapse;text-align:center;vertical-align:top;position:relative;left:-101px;"><tr><td style="width:100%;text-align:center;vertical-align:top;margin:0;padding:0;"><div style="width:100%;margin:0 auto;padding:0;position:relative;text-align:center;" id="pre_wait_lm"><div id="wait_lastminute" style="background:#6799b7;color:#fcfcfc;z-index:1850;padding:0;height:16px;width:101px;margin:0 auto;margin-top:8px;border:1px solid #e1e1e1;border-bottom:1px solid #d3d3d3;border-right:1px solid #d3d3d3;font-family:helvetica,arial,verdana,sans-serif;font-weight:bold;font-size:11px;text-align:left;padding-left:4px;padding-top:2px;">Loading<span id="inside">...</span></div></div><iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:800px;height:1600px;display:inline;position:relative;top:-217px;margin:0;padding:0;" scrolling="yes"></iframe><a href=\'javascript:searchLastminuteInNewWindow(".");\' style="text-decoration:none!important;border:0!important;"><img src="http://www.cheapflightsfinder.com/imagesNEW/NEW_window_Lastminute.gif" style="width:200px;margin:0;border:0!important;display:inline;padding:0;position:absolute;top:165px;" id="br_tk"></a></td></tr></table>';
document.getElementById('kelkoolFramev').src=uri;
increase_width();

document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='visible';

var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}


var br_tkv=br_detect();
if(br_tkv!='firefox'){
document.getElementById('br_tk').style.top='0px';
}
searchLastminuteInNewWindowb();


}
if(o=='.'){				window.open(uri, "LastminuteSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");}
			}

							function searchLastminuteInNewWindowb(){

document.getElementById('first_column').style.width='100%';
document.getElementById('second_column').style.width='0%';
document.getElementById('Layer2').style.marginTop='-320px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1185px';
setTimeout('scrollto()',5500);
}
	
			
			function _searchLastminuteInternal()
			{
				var uri = 'http://www.anrdoezrs.net/click-1915490-10424274?url=http://www.lastminute.com/site/travel/flights/interstitial_page.html?skin=engb.lastminute.com&DPCAT=flights&TRANS=ViewTransportationSearchBox%2CdoSearchForTransportation&DPCLS=X&DPSAC=LMZ&DPDCC=GBP&DPCID=0&DPFIT=&DPSRT=FA&DPHSI=0&DPHEI=9&DPFSI=0&DPFEI=9&DPSFT=&DPLOC=en_GB&DPPID=0&DPTRT=&DPTTT=O&DPDES=&DPXIN=T&DPXCH=T&DPXTR=F&DPXCP=T&DPXAL=F&DPXMG=F&mondial_auto=true&failureURL=http%3A%2F%2Fwww.lastminute.com%2Fsite%2Ftravel%2Fflights%2Fflights-search-error.html&successURL=%2Ftravel%2Fflights%2Ftransport-results.html&intcmp=home1_flights&DPAIR=NONE&isEurostarSearch=False&DP1WF=1&date_in_day=0&date_in_month=0&DPIDT=0';
				uri += '&DPDAP=' + internalQueryParameters["departure"];
				uri += '&DPAAP=' + internalQueryParameters["arrival"];
				uri += '&date_out_day=' + internalQueryParameters["departureDay"];
				uri += '&date_out_month=' + _get1DigitValueForFlexible(internalQueryParameters["departureMonth"]);
				uri += '&DPODT=0001&DPNOA=' + internalQueryParameters["adults"] + '&DPNOS=0&DPNOC=' + internalQueryParameters["children"] + '&DPNOI=' + internalQueryParameters["infants"];
				return uri;
			}
			
			function searchEbookers()
			{
				var uri = _searchEbookersInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchEbookersInNewWindow()
			{
				var uri = _searchEbookersInternal();
				window.open(uri, "ebookersSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchEbookersInternal()
			{
				var uri = 'http://clkgb.tradedoubler.com/click?p=288&a=1209556&g=962061&url=http://www.ebookers.com/shop/airsearch?type=air&search=Search&ar.type=oneWay&ar.ow.cabin=C';
				uri += '&ar.ow.leaveSlice.dest.key=' + internalQueryParameters["arrival"];
				uri += '&ar.ow.leaveSlice.time=Anytime';
				uri += '&ar.ow.leaveSlice.date=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '%2F' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '%2F' + _get2DigitValueForTravelFusion(internalQueryParameters["departureYear"]);
				uri += '&ar.ow.leaveSlice.orig.key=' + internalQueryParameters["departure"];
				return uri;
			}
			
			function searchExpedia()
			{
				var uri = _searchExpediaInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
		
			function searchExpediaInNewWindow(o)
			{
document.getElementById('background_').style.backgroundPosition='-5025px 0';
				var uri = _searchExpediaInternal();
if(o!='.'){
document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
document.getElementById('first_column').innerHTML='<table style="width:100%;margin:0;border:0;border-collapse:collapse;text-align:center;vertical-align:top;position:relative;left:-101px;"><tr><td style="width:100%;text-align:center;vertical-align:top;margin:0;padding:0;"><iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:800px;height:1600px;display:inline;position:relative;top:-101px;margin:0;padding:0;" scrolling="yes"></iframe><a href=\'javascript:searchExpediaInNewWindow(".");\' style="text-decoration:none!important;border:0!important;"><img src="http://www.cheapflightsfinder.com/imagesNEW/NEW_window_Expedia.gif" style="width:200px;margin:0;border:0!important;display:inline;padding:0;position:absolute;top:165px;" id="br_tk"></a></td></tr></table>';
document.getElementById('kelkoolFramev').src=uri;

document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='visible';

var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}


var br_tkv=br_detect();

if(br_tkv!='firefox'){
document.getElementById('br_tk').style.top='0px';
}
searchExpediaInNewWindowb();


}
if(o=='.'){				window.open(uri, "ExpediaSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");}
			}

							function searchExpediaInNewWindowb(){

document.getElementById('first_column').style.width='100%';
document.getElementById('second_column').style.width='0%';
document.getElementById('Layer2').style.marginTop='-320px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1185px';
setTimeout('scrollto()',5500);
			}

			
			function _searchExpediaInternal()
			{
				var uri = 'http://clkgb.tradedoubler.com/click?p=21874&a=1747856&g=17466108&url=http://www.expedia.co.uk/pub/agent.dll?qscr=fexp&flag=q';
				uri += '&city1=' + internalQueryParameters["departure"];
				uri += '&citd1=' + internalQueryParameters["arrival"];
				uri += '&date1=' + internalQueryParameters["departureDay"] + '/' + _get1DigitValueForFlexible(internalQueryParameters["departureMonth"]) + '/' + internalQueryParameters["departureYear"] + '&time1=362';
				uri += '&date2=' + internalQueryParameters["returnDay"] + '/' + _get1DigitValueForFlexible(internalQueryParameters["returnMonth"]) + '/' + internalQueryParameters["returnYear"] + '&time2=362';
				uri += '&cAdu=' + internalQueryParameters["adults"] + '&cSen=&cChi=' + internalQueryParameters["children"] + '&cInf=' + internalQueryParameters["infants"] + '&infs=2&tktt=3&trpt=1&ecrc=&eccn=&qryt=8&rdct=1&affcid=expe.uk.001.000.1747856.17466108&eapid=737-3';
				return uri;
			}
			
			function searchOpodo()
			{
				var uri = _searchOpodoInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchOpodoInNewWindow()
			{
				var uri = _searchOpodoInternal();
				window.open(uri, "opodoSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchOpodoInternal()
			{
				var uri = 'http://www.opodo.co.uk/opodo/StrutsServlet/AeroSearchFlights?CMP=uk-awin-104251&awc=2729_1275361782_51d3977bd079f0a051b9f2a09388a741';
				uri += '&departureAirportCode=' + internalQueryParameters["departure"];
				uri += '&arrivalAirportCode=' + internalQueryParameters["arrival"] + '&reset=true&tripType=O';
				uri += '&returnDay=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
				uri += '&returnMonth=20' + _get2DigitValueForYear(internalQueryParameters["departureYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '&returnTime=ANY';
				uri += '&departureDay=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
				uri += '&departureMonth=20' + _get2DigitValueForYear(internalQueryParameters["departureYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '&departureTime=ANY&cabinType=E&airlineFromSelectBox=true&popupAirlineCode=&popupAirlineName=&airlineName=&searchLowCost=true';
				uri += '&numberOfAdults=' + internalQueryParameters["adults"] + '&numberOfChildren=' + internalQueryParameters["children"] + '&numberOfInfants=' + internalQueryParameters["infants"];
				return uri;
			}
			
			function searchNetflights()
			{
				var uri = _searchNetflightsInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
	function searchNetflightsInNewWindow(o)
			{
document.getElementById('background_').style.backgroundPosition='-9045px 0';
				var uri = _searchNetflightsInternal();
if(o!='.'){
document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
if(o=='c'){var ts='1';}
else{var ts='2';}
document.getElementById('first_column').innerHTML='<table style="width:100%;margin:0;border:0;border-collapse:collapse;text-align:center;vertical-align:top;position:relative;left:-101px;"><tr><td style="width:100%;text-align:center;vertical-align:top;margin:0;padding:0;"><iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:1000px;height:1600px;display:inline;position:relative;top:-192px;margin:0;padding:0;" scrolling="yes"></iframe><a href=\'javascript:searchNetflightsInNewWindow(".");\' style="text-decoration:none!important;border:0!important;"><img src="http://www.cheapflightsfinder.com/imagesNEW/NEW_window_Netflights.gif" style="width:200px;margin:0;border:0!important;display:inline;padding:0;position:absolute;top:165px;" id="br_tk"></a><inpu type="hidden" id="ie_hd" value="'+ts+'"></td></tr></table>';
document.getElementById('kelkoolFramev').src=uri;
document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='visible';
var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}


var br_tkv=br_detect();
if(br_tkv!='firefox'){
document.getElementById('br_tk').style.top='0px';
}

searchNetflightsInNewWindowb();


}
if(o=='.'){				window.open(uri, "NetflightsSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");}
			}

							function searchNetflightsInNewWindowb(){
document.getElementById('first_column').style.width='100%';
document.getElementById('second_column').style.width='0%';
document.getElementById('Layer2').style.marginTop='-320px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1185px';


var br_tkv=br_detect();
if((br_tkv=='ie8') || (br_tkv=='ie7') || (br_tkv=='ie6')){
var pre_ie=document.getElementById('ie_hd').value;
if(pre_ie!='1'){
setTimeout('searchNetflightsInNewWindow("c")',4000);
setTimeout('scrollto()',5500);
}
else{
setTimeout('scrollto()',5500);
}
}

}
			function _searchNetflightsInternal()
			{
				var uri = 'http://clkuk.tradedoubler.com/click?p=190953&a=1747856&g=18698536&url=http://www.netflights.com/flights/flight-results.aspx?';
				uri += 'from=' + internalQueryParameters["departure"];
				uri += '&to=' + internalQueryParameters["arrival"];
				uri += '&itf=False&sof=True&nf=True&chf=True&pf=True&caf=True&depdate=';
				uri +=_get2DigitValueForTravelFusion(internalQueryParameters["departureDay"])+'/';
				uri +=_get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"])+'/';
				uri +=internalQueryParameters["departureYear"];
				uri +='&adults='+internalQueryParameters["adults"];
				uri +='&cabin=Economy';
				return uri;
			}
			function searchTravelgroveInNewWindow()
			{
				var uri = _searchTravelgroveInternal();
				window.open(uri, "travelgroveSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchTravelgroveInternal()
			{
				var uri = 'http://www.travelgrove.com/cgi-bin/flightsearch.cgi?idReferral=3957&search_type=0&phpscript=flight';
				uri += '&inp_dep_arp_cd_1=' + internalQueryParameters["departure"];
				uri += '&inp_arr_arp_cd_1=' + internalQueryParameters["arrival"];
				uri += '&leave_day=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '&leave_month=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '&leave_year=' + internalQueryParameters["departureYear"];
				uri +='&inp_adult_pax_cnt=' + internalQueryParameters["adults"] + '&inp_child_pax_cnt=' + internalQueryParameters["children"] + '&inp_senior_pax_cnt=0&search22.x=52&search22.y=23';
				return uri;
			}

			function searchTripadvisorInNewWindow()
			{
				var uri = _searchTripadvisorInternal();
				window.open(uri, "tripadvisorSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
		
			function _searchTripadvisorInternal()
			{
				var uri = 'http://www.tripadvisor.co.uk/CheapFlights?geo=293916&travelers=1&cos=0&nonstop=no';
				uri += '&airport0=' + internalQueryParameters["departure"];
				uri += '&nearby0=no&airport1=' + internalQueryParameters["arrival"];
				uri += '&nearby1=no&date0=' + internalQueryParameters["departureYear"] + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
				uri += '&time0=anytime';
				return uri;
			}
			

			function searchEasyvoyageInNewWindow()
			{
document.getElementById('background_').style.backgroundPosition='-3015px 0';
				var uri = _searchEasyvoyageInternal();

document.getElementById('k_main').style.position='relative';
document.getElementById('first_div').style.zIndex='1600';
document.getElementById('second_div').style.zIndex='1601';
document.getElementById('first_column').innerHTML='';
document.getElementById('first_column').innerHTML='<iframe id="kelkoolFramev" name="kelkoolFramev" frameborder="0" onload="searchResultsLoaded(\'kelkoo\')" style="width:1024px;float:right;height:1630px;display:inline;margin:0;padding:0;position:relative;top:-200px;" scrolling="yes"></iframe>';
document.getElementById('kelkoolFramev').src=uri;



document.getElementById('kelkoolFramev').style.overflowX='hidden';
document.getElementById('kelkoolFramev').style.overflowY='hidden';

var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='2px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='302px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='602px';
}


searchEasyvoyageInNewWindowb();
			}


							function searchEasyvoyageInNewWindowb()
							{
document.getElementById('first_column').style.width='75%';
document.getElementById('second_column').style.width='25%';
document.getElementById('Layer2').style.marginTop='-220px';

						document.getElementById('k_main').style.left='0px';
						document.getElementById('k_main').style.top='0px';
						document.getElementById('k_main').style.height='1665px';
setTimeout('scrollto()',5500);
			}


			function _searchEasyvoyageInternal()
			{
				var uri = 'http://www.easyvols.org/clients-tpl-en/mev/results.jsp?clientId=4&type=0';
				uri += '&departAllerIata=' + internalQueryParameters["departure"];
				uri += '&arriveeAllerIata=' + _getCodeForEasyvoyage(internalQueryParameters["arrival"]); ;
				uri += '&jourAller=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '&moisAller=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '%2F' + internalQueryParameters["departureYear"];
				uri +='&paxAdultes=1&paxEnfants=0&paxBebes=0&classe=1 ';
				return uri;
			}
	
			function _getCodeForEasyvoyage(code)
			{
				// special check for London-All
				var newcode = code;
				
				if (code == "CDG")
				{
					newcode = "PAR"
				}
				
				return newcode;
			}

			function searchGlobaltravel()
			{
				var uri = _searchGlobaltravelInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchGlobaltravelInNewWindow()
			{
				var uri = _searchGlobaltravelInternal();
				window.open(uri, "globaltravelSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchGlobaltravelInternal()
			{
				var uri = 'http://www.globaltravelmarket.co.uk/flights-engine/?action=search&client=gtmCorporateSite';
				uri += '&passengers=' + internalQueryParameters["adults"];
				uri += '&departureDate=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + internalQueryParameters["departureYear"];
				uri += '&returnDate=' + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + internalQueryParameters["returnYear"];
				uri += '&departure=' + internalQueryParameters["departure"];
				uri += '&destination=' + internalQueryParameters["arrival"] + '&cabin=e&trip=1&popup=true&departureTime=0&returnTime=0';
				return uri;
			}
			
			function searchPriceline()
			{
				var uri = _searchPricelineInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchPricelineInNewWindow()
			{
				var uri = _searchPricelineInternal();
				window.open(uri, "pricelineSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchPricelineInternal()
			{
				var departureCountryName = internalQueryParameters["departureCountryName"];
				var arrivalCountryName = internalQueryParameters["arrivalCountryName"];
				var departureCityName = internalQueryParameters["departureCityName"];
				var arrivalCityName = internalQueryParameters["arrivalCityName"];
				
				var uri = 'http://ww3.priceline.co.uk/site/travel/flights/transport-results.html?skin=engb_priceline&mondial_auto=true&DPSRT=FA&DPNOC=' + internalQueryParameters["children"] + '&DPNOA=' + internalQueryParameters["adults"] + '&DPNOI=' + internalQueryParameters["infants"] + '&DPLOC=en_GB&DPNOS=0&DPHSI=0&date_in_month=0&DPXCP=F&DPFSI=0&DPCID=0&DPXAL=F&DPTRT=flights&DPSFT=&DPXTR=F&DPTTT=O&DPXCH=F&DPXMG=F&DPHEI=2&failureURL=http%3A%2F%2Fww3.priceline.co.uk%2Fsite%2Ftravel%2Fflights%2Fflights-search-error.html';
				uri += '&DPDAP=' + internalQueryParameters["departure"] + '&DPXIN=F&DPCLS=X&DPPID=4000';
				uri += '&date_out_month=' + _get1DigitValueForFlexible(internalQueryParameters["returnMonth"]) + '&DPFEI=9&TRANS=ViewTransportationSearchBox%2CdoSearchForTransportation&DPSAC=TPR';
				uri += '&date_out_day=' + internalQueryParameters["departureDay"] + '&DPDCC=GBP&DPIDT=0&DP1WF=1&DPFIT=&DPODT=0001';
				uri += '&DPAAP=' + arrivalCityName + '+%28' + internalQueryParameters["arrival"] + '%29%2C+TH&DPAIR=NONE&date_in_day=0';
				return uri;
			}
			
			function searchTravelocity()
			{
				var uri = _searchTravelocityInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchTravelocityInNewWindow()
			{
				var uri = _searchTravelocityInternal();
				window.open(uri, "travelocitySearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchTravelocityInternal()
			{
				var uri = 'http://www.travelocity.co.uk/site/travel/flights/transport-results.html?skin=engb.travelocity.co.uk&mondial_auto=true&DPSRT=FA&DPNOC=' + internalQueryParameters["children"] + '&DPNOA=' + internalQueryParameters["adults"] + '&DPNOI=' + internalQueryParameters["infants"] + '&DPLOC=en_GB&DPNOS=0&DPHSI=0&date_in_month=0&DPXCP=T&DPFSI=0&DPCID=0&DPXAL=F&DPTRT=flights&DPSFT=&DPXTR=F&DPTTT=O&DPXCH=F&DPXMG=F&DPHEI=2&failureURL=http%3A%2F%2Fwww.travelocity.co.uk%2Fsite%2Ftravel%2Fflights%2Fflights-search-error.html';
				uri += '&DPDAP=' + internalQueryParameters["departure"] + '&DPXIN=F&DPCLS=X&DPPID=8000';
				uri += '&date_out_month=' + _get1DigitValueForFlexible(internalQueryParameters["departureMonth"]) + '&DPFEI=9&TRANS=ViewTransportationSearchBox%2CdoSearchForTransportation&DPSAC=T1F';
				uri += '&date_out_day=' + internalQueryParameters["departureDay"] + '&DPDCC=GBP&DPIDT=0&DP1WF=1&DPFIT=&DPODT=0001';
				uri += '&DPAAP=' + internalQueryParameters["arrival"] + '&DPAIR=NONE&date_in_day=0';
				return uri;
			}
			
			function searchThomascook()
			{
				var uri = _searchThomascookInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchThomascookInNewWindow()
			{
				var uri = _searchThomascookInternal();
				window.open(uri, "thomascookSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchThomascookInternal()
			{
				var uri = 'http://www.jdoqocy.com/click-3476948-10644875?url=http://www.skyscanner.net/redir?url=www%2Ethomascook%2Ecom&w=a272&t=p';
				uri += '&fromport=' + internalQueryParameters["departure"];
				uri += '&toport=' + internalQueryParameters["arrival"] + '&langid=en';
				uri += '&departuredate=' + _get2DigitValueForYear(internalQueryParameters["departureYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
				uri += '&returndate=' + _get2DigitValueForYear(internalQueryParameters["returnYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '&src=alsoflies&cat=trava&wl=23472076&rtn=false&aid=';
				uri += '&adults=' + internalQueryParameters["adults"] + '&children=' + internalQueryParameters["children"] + '&infants=' + internalQueryParameters["infants"] + '&window=1?associateid=AFF_NTW_00014_00001';
				return uri;
			}
			
			function searchTerminala()
			{
				var uri = _searchTerminalaInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchTerminalaInNewWindow()
			{
				var uri = _searchTerminalaInternal();
				window.open(uri, "terminalaSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchTerminalaInternal()
			{
				var uri = 'http://www.jdoqocy.com/click-3476948-10644875?url=http://www.skyscanner.net/redir?url=www%2Eterminala%2Ecom&w=a942&t=p';
				uri += '&fromport=' + internalQueryParameters["departure"];
				uri += '&toport=' + internalQueryParameters["arrival"] + '&langid=en';
				uri += '&departuredate=' + _get2DigitValueForYear(internalQueryParameters["departureYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
				uri += '&returndate=' + _get2DigitValueForYear(internalQueryParameters["returnYear"]) + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '&src=alsoflies&cat=trava&wl=23472076&rtn=false&aid=';
				uri += '&adults=' + internalQueryParameters["adults"] + '&children=' + internalQueryParameters["children"] + '&infants=' + internalQueryParameters["infants"] + '&window=1?associateid=AFF_NTW_00014_00001';
				return uri;
			}
			
			function searchFlightsdirect()
			{
				var uri = _searchFlightsdirectInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchFlightsdirectInNewWindow()
			{
				var uri = _searchFlightsdirectInternal();
				window.open(uri, "flightsdirectSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchFlightsdirectInternal()
			{
				var uri = 'http://www.flightsdirect.com/buildyourown/results/results_xsl.aspx?rating=0&r3c_ages=2,%202,%202&_stage=search&currentSearchMethodFlag=predictiveSearchDiv&duration= a number of&rooms=1&car_hire_selected=no&search_type=Flight';
				uri += '&seats_adult=' + internalQueryParameters["adults"] + '&r1a=1&r2c=0';
				uri += '&rtnDate=' + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '/' + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + '/' + internalQueryParameters["returnYear"];
				uri += '&seats_infant=' + internalQueryParameters["infants"] + '&r2i_ages=0&r3i=0&optSearchType=Flight&freetext=' + internalQueryParameters["arrival"] + '&r1i=0&requestType=airports&r2i=0&lstCountry=-&flexibility=3&oneway=true&r1c_ages=2,%202,%202&r3a=1&r3i_ages=0&locationto=' + internalQueryParameters["arrival"] + '&r2a=1&r2c_ages=2,%202,%202&r3c=0';
				uri += '&startdate=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '/' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '/' + internalQueryParameters["departureYear"];
				uri += '&seats_child=' + internalQueryParameters["children"] + '&r1c=0&r1i_ages=0';
				uri += '&airportfrom=' + internalQueryParameters["departure"] + '&cityname=' + internalQueryParameters["departureCityName"] + '&airportto=' + internalQueryParameters["arrival"];
				uri += '&startdate_d=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '&startdate_m=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '&startdate_y=' + internalQueryParameters["departureYear"];
				uri += '&enddate_d=' + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '&enddate_m=' + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + '&enddate_y=' + internalQueryParameters["returnYear"];
				return uri;
			}
			
			function searchTravelmarket()
			{
				var uri = _searchTravelmarketInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchTravelmarketInNewWindow()
			{
				var uri = _searchTravelmarketInternal();
				window.open(uri, "travelmarketSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchTravelmarketInternal()
			{
				var uri = 'http://www.travelmarket.co.uk/tse_v2.cfm?choice=searchResult';
				uri += '&departureDate=' + internalQueryParameters["departureYear"] + '-' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '-' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]);
				uri += '&returnDate=' + internalQueryParameters["returnYear"] + '-' + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + '-' + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '&departureDateShown=';
				uri += '&returnDateShown=' + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '-' + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + '-' + internalQueryParameters["returnYear"];
				uri += '&destination=' + internalQueryParameters["arrival"] + '&destinationNameTmp=&destinationIdTmp=';
				uri += '&departure=' + internalQueryParameters["departure"] + '&departureNameTmp=&departureIdTmp=&currency=GBP';
				uri += '&departureName=' + internalQueryParameters["departureCityName"] + '+%28' + internalQueryParameters["departure"] + '%29%2C+' + internalQueryParameters["departureCountryName"];
				uri += '&destinationName=' + internalQueryParameters["arrivalCityName"] + '+%28' + internalQueryParameters["arrival"] + '%29%2C+' + internalQueryParameters["arrivalCountryName"] + '&roundtrip=0';
				return uri;
			}
			
			function searchFarecast()
			{
				var uri = _searchFarecastInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchFarecastInNewWindow()
			{
				var uri = _searchFarecastInternal();
				window.open(uri, "farecastSearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchFarecastInternal()
			{
				var uri = 'http://farecast.live.com/flightSearch.do?tg=T10';
				uri += '&dm1=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '%2F' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '%2F' + internalQueryParameters["departureYear"];
				uri += '&e1=' + internalQueryParameters["arrival"];
				uri += '&p=' + internalQueryParameters["adults"];
				uri += '&o1=' + internalQueryParameters["departure"] + '&b=COACH';
				return uri;
			}
			
			function searchFly()
			{
				var uri = _searchFlyInternal();
				
				try
				{
					var tsmIFrame = document.getElementById("tsmIFrame");
					tsmIFrame.src = uri;
				}
				catch(e){}
			}
			
			function searchFlyInNewWindow()
			{
				var uri = _searchFlyInternal();
				window.open(uri, "flySearchResults", "status=1,resizable=yes,width=900,top=200,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,scrollbars=yes");
			}
			
			function _searchFlyInternal()
			{
				var uri = 'http://uk.fly.com/Search.aspx?IgnoreSession=True&NonStop=False&Travellers=' + internalQueryParameters["adults"] + '&IsRoundTrip=False&OriginNearby=False';
				uri += '&Origin=' + internalQueryParameters["departure"];
				uri += '&DestinationNearby=False&Destination=' + internalQueryParameters["arrival"];
				uri += '&DepartTime=Anytime&DepartDate=' + _get2DigitValueForTravelFusion(internalQueryParameters["departureMonth"]) + '/' + _get2DigitValueForTravelFusion(internalQueryParameters["departureDay"]) + '/' + internalQueryParameters["departureYear"];
				uri += '&ReturnTime=Anytime&ReturnDate=' + _get2DigitValueForTravelFusion(internalQueryParameters["returnMonth"]) + '/' + _get2DigitValueForTravelFusion(internalQueryParameters["returnDay"]) + '/' + internalQueryParameters["returnYear"] + '&utm_source=cheapflightsfinderuk&utm_medium=cpc&utm_campaign=flyuk';
				return uri;
			}
			
			function _get1DigitValueForFlexible(month)
			{
				if (month == "01" || month == 01) 
					return "1";
				else if (month == "02" || month == 02) 
					return "2";
				else if (month == "03" || month == 03) 
					return "3";
				else if (month == "04" || month == 04) 
					return "4";
				else if (month == "05" || month == 05) 
					return "5";
				else if (month == "06" || month == 06) 
					return "06";
				else if (month == "07" || month == 07) 
					return "7";
				else if (month == "08" || month == 08) 
					return "8";
				else if (month == "09" || month == 09) 
					return "9";
				else if (month == "10" || month == 10) 
					return "10";
				else if (month == "11" || month == 11) 
					return "11";
				else if (month == "12" || month == 12) 
					return "12";
				
				return month;
			}
			
			function _get1DigitValueForLiligo(month)
			{
				if (month == "01" || month == 01) 
					return "12";
				else if (month == "02" || month == 02) 
					return "1";
				else if (month == "03" || month == 03) 
					return "2";
				else if (month == "04" || month == 04) 
					return "3";
				else if (month == "05" || month == 05) 
					return "4";
				else if (month == "06" || month == 06) 
					return "5";
				else if (month == "07" || month == 07) 
					return "6";
				else if (month == "08" || month == 08) 
					return "7";
				else if (month == "09" || month == 09) 
					return "8";
				else if (month == "10" || month == 10) 
					return "9";
				else if (month == "11" || month == 11) 
					return "10";
				else if (month == "12" || month == 12) 
					return "11";
				
				return month;
			}
			
			function _get2DigitValueForTravelFusion(day)
			{
				if (day == "1" || day == 1) 
					return "01";
				else if (day == "2" || day == 2) 
					return "02";
				else if (day == "3" || day == 3) 
					return "03";
				else if (day == "4" || day == 4) 
					return "04";
				else if (day == "5" || day == 5) 
					return "05";
				else if (day == "6" || day == 6) 
					return "06";
				else if (day == "7" || day == 7) 
					return "07";
				else if (day == "8" || day == 8) 
					return "08";
				else if (day == "9" || day == 9) 
					return "09";
				
				return day;
			}
			
			function _get2DigitValueForYear(year)
			{
				if (year == "2008" || year == 2008)
					return "08";
				else if (year == "2009" || year == 2009)
					return "09";
				else if (year == "2010" || year == 2010)
					return "10";
				else if (year == "2011" || year == 2011)
					return "11";
				else if (year == "2012" || year == 2012)
					return "12";
				else if (year == "2013" || year == 2013)
					return "13";
				else if (year == "2014" || year == 2014)
					return "14";
				else if (year == "2015" || year == 2015)
					return "15";
				else if (year == "2016" || year == 2016)
					return "16";
				else if (year == "2017" || year == 2017)
					return "17";
				else if (year == "2018" || year == 2018)
					return "18";
				
				return year;					
			}
			
			function _getCodeForDohop(code)
			{
				// special check for London-All
				var newcode = code;
				
				if (code == "LON")
				{
					newcode = "LHR,STN,LTN,LGW,LCY"
				}
				
				return newcode;
			}
			
			function showSearchForm()
			{
				window.location="http://www.cheap-flights-finder.com";
			}
			
			function searchResultsLoaded(frameSrc)
			{
				if (frameSrc=='kayak')
				{
					kayakSearchResultsLoaded = true;
				}
					
				if (frameSrc=='kelkoo')
				{
					kelkooSearchResultsLoaded = true;
				}
				
				if (frameSrc=='tf')
				{
					travelFusionSearchResultsLoaded = true;
				}
				
				if (frameSrc=='tsm')
				{
					tsmSearchResultsLoaded = true;
				}
				
				if (frameSrc=='mob')
				{
					mobSearchResultsLoaded = true;
				}

				if (frameSrc=='sky')
				{
					skySearchResultsLoaded = true;
				}
				
				if (frameSrc=='wego')
				{
					wegoSearchResultsLoaded = true;
				}
				
				if (frameSrc=='momondo')
				{
					momondoSearchResultsLoaded = true;
				}
				
				if (frameSrc=='cheapflights')
				{
					cheapflightsSearchResultsLoaded = true;
				}
				
				if (frameSrc=='lastminute')
				{
					lastminuteSearchResultsLoaded = true;
				}
				
				if (frameSrc=='ebookers')
				{
					ebookersSearchResultsLoaded = true;
				}
				
				if (frameSrc=='expedia')
				{
					expediaSearchResultsLoaded = true;
				}
				
				if (frameSrc=='opodo')
				{
					opodoSearchResultsLoaded = true;
				}
				
				if (frameSrc=='netflights')
				{
					netflightsSearchResultsLoaded = true;
				}
				
				if (frameSrc=='globaltravel')
				{
					globaltravelSearchResultsLoaded = true;
				}
				
				if (frameSrc=='priceline')
				{
					pricelineSearchResultsLoaded = true;
				}
				
				if (frameSrc=='travelocity')
				{
					travelocitySearchResultsLoaded = true;
				}
					
				var condition = false;
				if (IS_MOZILLA)
				{
					condition = kayakSearchResultsLoaded && tsmSearchResultsLoaded && mobSearchResultsLoaded && skySearchResultsLoaded && wegoSearchResultsLoaded && momondoSearchResultsLoaded && cheapflightsSearchResultsLoaded && lastminuteSearchResultsLoaded && ebookersSearchResultsLoaded && expediaSearchResultsLoaded && opodoSearchResultsLoaded && netflightsSearchResultsLoaded && globaltravelSearchResultsLoaded && pricelineSearchResultsLoaded && travelocitySearchResultsLoaded;
				}
				else if (IS_IE)
				{
					condition = kayakSearchResultsLoaded && tsmSearchResultsLoaded && mobSearchResultsLoaded && skySearchResultsLoaded && wegoSearchResultsLoaded && momondoSearchResultsLoaded && cheapflightsSearchResultsLoaded && lastminuteSearchResultsLoaded && ebookersSearchResultsLoaded && expediaSearchResultsLoaded && opodoSearchResultsLoaded && netflightsSearchResultsLoaded && globaltravelSearchResultsLoaded && pricelineSearchResultsLoaded && travelocitySearchResultsLoaded;
				}
				
				if (condition)
				{
					showSearchResults();
				}
				
			}
			
			function showSearchResults()
			{
				// hide the progress bar div
				var progressBarDiv= document.getElementById("progressBarDiv");
				progressBarDiv.style.display = 'none';
			
				// show the search results divs
				var kelkooDiv = document.getElementById("kelkooDiv");
				kelkooDiv.style.display = '';
			
				var kayakDiv = document.getElementById("kayakDiv");
				kayakDiv.style.display = '';
				
				var tsmDiv = document.getElementById("tsmDiv");
				tsmDiv.style.display = '';
				
				var mobDiv = document.getElementById("mobDiv");
				mobDiv.style.display = '';
				
				var skyDiv = document.getElementById("skyDiv");
				skyDiv.style.display = '';
				
				var wegoDiv = document.getElementById("wegoDiv");
				wegoDiv.style.display = '';
				
				var momondoDiv = document.getElementById("momondoDiv");
				momondoDiv.style.display = '';
				
				var cheapflightsDiv = document.getElementById("cheapflightsDiv");
				cheapflightsDiv.style.display = '';
				
				var lastminuteDiv = document.getElementById("lastminuteDiv");
				lastminuteDiv.style.display = '';
				
				var ebookersDiv = document.getElementById("ebookersDiv");
				ebookersDiv.style.display = '';
				
				var expediaDiv = document.getElementById("expediaDiv");
				expediaDiv.style.display = '';
				
				var opodoDiv = document.getElementById("opodoDiv");
				opodoDiv.style.display = '';
				
				var netflightsDiv = document.getElementById("netflightsDiv");
				netflightsDiv.style.display = '';
				
				var globaltravelDiv = document.getElementById("globaltravelDiv");
				globaltravelDiv.style.display = '';
				
				var pricelineDiv = document.getElementById("pricelineDiv");
				pricelineDiv.style.display = '';
				
				var travelocityDiv = document.getElementById("travelocityDiv");
				travelocityDiv.style.display = '';
				
			}
			
			function updateArrivalDate(cal)
			{
				var day = cal.date.getDate();
				var month = cal.date.getMonth();
				var year = cal.date.getYear();				
								

			}
			
			function updateDepartureDate(cal)
			{
				var day = cal.date.getDate();
				var month = cal.date.getMonth();
				var year = cal.date.getYear();
				
				setDepartureDateMainForm(year, month, day-1);	
				
				// set the arrival date to be 14 days after departure date
				var newdate = cal.date;
				newdate.setTime(newdate.getTime() + 7*24*60*60*1000);
				

				
                year  = newdate.getYear().toString();
                month = newdate.getMonth().toString();
                day   = newdate.getDate().toString();
                
                if ( year.length != 4 )
                {
                    year  = '20' + year.substring(1, 3);
                }
                
                month = parseInt(month) + 1; 
                

			}
			
			function processInternalQueryParameters()
			{
				var query = window.location.href.substring((location.href.indexOf('?')+1), location.href.length);
				
				var querysplit = query.split('&');
				
				for(var i = 0; i < querysplit.length; i++)
				{
					var namevalue = querysplit[i].split('=');
					namevalue[1] = namevalue[1].replace(/\+/g, ' ');
					internalQueryParameters[namevalue[0]] = unescape(namevalue[1]);
				}
				var ismd1=document.getElementById('ad_md1');
var ismd2=document.getElementById('ad_md2');
var ismd3=document.getElementById('ad_md3');
if(ismd1){
document.getElementById('ad_md1').style.display='block';
document.getElementById('ad_md1').style.top='12px';
}
if(ismd2){
document.getElementById('ad_md2').style.display='block';
document.getElementById('ad_md2').style.top='312px';
}
if(ismd3){
document.getElementById('ad_md3').style.display='block';
document.getElementById('ad_md3').style.top='612px';
}
				_submitCommonSearch();
			}
			
			function wait(delay)
			{
				window.setTimeout(showSearchResults, delay);		
			}
			
			