function onewayTrip(){
    var fsp = document.flightsearchpod;
    fsp.returnDay.disabled = true;
    fsp.returnMonth.disabled = true;
    fsp.returnTime.disabled = true;
    tripType = "O";
    document.getElementById('returncalendarlink').style.display='none';
}

function returnTrip(){
    var fsp = document.flightsearchpod;
    fsp.returnDay.disabled = false;
    fsp.returnMonth.disabled = false;
    fsp.returnTime.disabled = false;
    tripType = "R";
    document.getElementById('returncalendarlink').style.display='';

}
var Maximum = 10;
function setOptions(chosen) {
    frm = document.flightsearchpod;
    var selbox = frm.numChildren;
    selbox.options.length = 0;
    var selbox2 = frm.numInfants;
    selbox2.options.length = 0;
    var box1 = frm.numAdults.options[frm.numAdults.selectedIndex].value;
    for(q=0;q<=box1;q++){
         selbox2.options[selbox2.options.length] = new Option(q,q);
    }
    for(i=0 ; i < Maximum ; i++){
        if (chosen == i) {
            selbox.options[selbox.options.length] = new Option(0,0);
            for(z=1;z <(Maximum-i) ; z++){
              selbox.options[selbox.options.length] = new Option(z,z);
            }
        }
    }
}

var today = new Date();
var dayz = today.getDate();
function zero(){
    var fsp = document.flightsearchpod;
    fsp.reset();
    fsp.departureDate.selectedIndex = dayz; 
    fsp.returnDay.selectedIndex = dayz; 
    calcDay('flightsearchpod','departureDate','departureMonth','PDayOfWeek');
    calcDay('flightsearchpod','returnDay','returnMonth','DDayOfWeek');
    fsp.departureAirport.focus();
}
var second_field_name="";
var field_name="";
var form_name="";
var myDoc=document;
popUpWindowWithReturn = new Function("field_value", "form_value", "page", "title", "height", "width", '\
                        field_name = field_value;\
                        form_name = form_value;\
                        options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + width + ",height=" + height;\
                        popup = open(page, title, options );\
                        if(navigator.appName == "Netscape"){\
                        popup.focus();\
                        }\
                        ');
popUpWindowWithReturnFor2Fields = new Function("field_value", "second_field_value", "form_value", "page", "title", "height", "width", '\
                        second_field_name = second_field_value;\
                        field_name = field_value;\
                        form_name = form_value;\
                        options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + width + ",height=" + height;\
                        popup = open(page, title, options );\
                        if(navigator.appName == "Netscape"){\
                        popup.focus();\
                        }\
                        ');
function airlineToTextInput(defaultAirlineCode) {
    var fsp = document.flightsearchpod;
    var airline_selected_code = fsp.popupAirlineCode.value;
    var airline_selected_name = fsp.popupAirlineName.value;
    if (defaultAirlineCode == null) {
        defaultAirlineCode = airline_selected_code;
    }
    var newHtml =       "<input type=\"hidden\" name=\"airlineCode\"          value=\"" + defaultAirlineCode + "\">";
    newHtml = newHtml + "<input type=\"hidden\" name=\"popupAirlineCode\"     value=\"" + airline_selected_code + "\">";
    newHtml = newHtml + "<input type=\"hidden\" name=\"popupAirlineName\"     value=\"" + airline_selected_name + "\">";
    newHtml = newHtml + "<input type=\"hidden\" name=\"airlineFromSelectBox\" value=\"false\">";
    newHtml = newHtml + "<input type=\"text\"   name=\"popupDisplayAirline\"  value=\"" + airline_selected_name + "\" class=\"formText0\">";
    var airSelectDiv = myDoc.getElementById("AirlineFilterDisplay");
    airSelectDiv.innerHTML=newHtml;
    fsp.popupDisplayAirline.disabled=true;
}
function synchronizeForm(){
    var fsp = document.flightsearchpod;
    fsp.departureAirport.focus();
    if (fsp.numAdults.options[fsp.numAdults.selectedIndex].value == '1' &&
        fsp.numChildren.options[fsp.numChildren.selectedIndex].value =='0' &&
        fsp.numInfants.options[fsp.numInfants.selectedIndex].value == 0) {
        setOptions(fsp.numAdults.options[fsp.numAdults.selectedIndex].value);
    }
    if (fsp.tripType[1].checked){
        fsp.tripType[1].checked=true;
    } else {
        fsp.tripType[0].checked = true;
    }
    calcDay("flightsearchpod","departureDay","departureMonth","PDayOfWeek");
    calcDay("flightsearchpod","returnDay","returnMonth","DDayOfWeek");
    var airlineCode=fsp.airlineCode.options[fsp.airlineCode.selectedIndex].value;
    if (airlineCode.length > 0){
        fsp.airlineName.value=fsp.airlineCode.options[fsp.airlineCode.selectedIndex].text;
    }
}
function checkEmail(){
  if(document.newsletter.sEmail.value=="") {
      document.newsletter.sEmail.focus();
      return false;
  } else {
      document.newsletter.submit(); 
  }
}
function swapDate(item,doIt){
    if(doIt==true){
        for (x=0;x<7;x++){
            if(days2[x].indexOf(item.innerHTML) !=-1){
                item.innerHTML=days2[x];
            }
        }
    }else{
        item.innerHTML=item.innerHTML.substr(0,3);
    }
}
function copyDestinationName() {
    var destinationList = document.getElementById('destination');
    var destElement = document.getElementById('destinationInput');
    var toCopy = destinationList.options[destinationList.selectedIndex];
    destElement.value = toCopy.innerHTML;
}
function findPosition( oLink , left , top) {
var which;
 which = oLink.id;
  if( oLink.offsetParent ) {
    for( var posX = 0, posY = 15; oLink.offsetParent; oLink = oLink.offsetParent ) {
      posX += oLink.offsetLeft;
	  posY += oLink.offsetTop;
  }
	left = left-=0; posX = posX -=0; iSleft = posX //+= posX;	 
	top = top-=0; 	posY = posY -=0; iStop = posY// += posY;	 
		document.getElementById('opodoCal').style.left = iSleft + "px";
		document.getElementById('opodoCal').style.top = iStop +"px";
		document.getElementById('opodoCal2').style.left = iSleft + "px";
		document.getElementById('opodoCal2').style.top = iStop +"px";

	 }
}
function findPositionAcourding( oLink , left , top) {
var which;
 which = oLink.id;
  if( oLink.offsetParent ) {
    for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
      posX += oLink.offsetLeft;
	  posY += oLink.offsetTop;
  }
	left = left-=0; posX = posX -=0; iSleft = left += posX;	 
	top = top-=0; 	posY = posY -=0; iStop = top += posY;	 
		document.getElementById('opodoCal').style.left = iSleft + "px";
		document.getElementById('opodoCal').style.top = iStop +"px";
		document.getElementById('opodoCal2').style.left = iSleft + "px";
		document.getElementById('opodoCal2').style.top = iStop +"px";

	 }
}
var now = new Date(),ymdd,ddd,dow,top,left,cl,calDate;
var mDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
function Calendar(ym,d,ddow,top,left,pod){
	var calStr = '<table width="175" border="0" cellspacing="0" cellpadding="0" class="bdr1 bdrBurgundy whiteBG"><tr>';
	if(isNaN(ym)){
		ymdd = document.getElementById(ym);
		ddd = document.getElementById(d);
		if(document.getElementById(ddow)){dow = document.getElementById(ddow);}
		ym = document.getElementById(ym).options[document.getElementById(ym).selectedIndex].value;
		d = document.getElementById(d).value;
	}
	calDate = new Date();
	calDate.setDate(1);
	calDate.setYear(ym.substring(0,4));
	calDate.setMonth(parseInt(ym.substring(4,6)-1));
	var fontStr='style="font-family: verdana,arial,sans-serif; font-size: 11px; line-height: 150%;"';
	leapYear(calDate.getFullYear())
	calStr +="<tr>";
	//alert(calDate.getMonth());
	var borderL='style="border:0px;background:#FFF;"';
	if(calDate.getMonth()==0){
	calStr += (calDate>firstDate)?'<td class="center" colspan="2" width="45"><a href="javascript:Calendar(\''+(calDate.getFullYear()-1)+''+12+'\','+calDate.getDate()+',\''+dow.id+'\','+top+','+left+',\''+pod+'\')"><img src="'+imgpath+'arrow_onwhiteleft.gif" alt='+prevMonth+' width="11" height="11" border="0"></td>':'<td colspan="2" class="e" width="45">&nbsp;</td>';
	}else{
	calStr += (calDate>firstDate)?'<td class="center" colspan="2" width="45"><a href="javascript:Calendar(\''+calDate.getFullYear()+''+(((calDate.getMonth())<10)?0+''+(calDate.getMonth()):(calDate.getMonth()))+'\','+calDate.getDate()+',\''+dow.id+'\','+top+','+left+',\''+pod+'\')"><img src="'+imgpath+'arrow_onwhiteleft.gif" alt='+prevMonth+' width="11" height="11" border="0"></td>':'<td colspan="2" class="e" width="45">&nbsp;</td>';
	}
	if(now.getMonth()!=0){now.setMonth(now.getMonth()-1);}else{now.setMonth(11);now.setFullYear(now.getFullYear()-1);}
	calStr +='<td valign="top" colspan="3" class="emp text center b">'+mNames[calDate.getMonth()]+'<br>'+calDate.getFullYear()+'</td>'
	if(calDate.getMonth()!=11){calDate.setMonth(calDate.getMonth()+1);}else{calDate.setMonth(0);calDate.setFullYear(calDate.getFullYear()+1);}
	calStr += (calDate<lastDate)?'<td colspan="2" class="center"><a href="javascript:Calendar(\''+calDate.getFullYear()+''+(((calDate.getMonth()+1)<10)?0+''+(calDate.getMonth()+1):(calDate.getMonth()+1))+'\','+calDate.getDate()+',\''+dow.id+'\','+top+','+left+',\''+pod+'\')"><img src="'+imgpath+'arrow_onwhite.gif" alt='+nextMonth+' width="11" height="11" border="0"></a></td></tr><tr>':'<td colspan="2" class="whiteBG e" width="45">&nbsp;</td></tr><tr>';
	if(calDate.getMonth()!=0){calDate.setMonth(calDate.getMonth()-1);}else{calDate.setMonth(11);calDate.setFullYear(calDate.getFullYear()-1);}
	for(var x=0;x<daysLong.length-1;x++){
		calStr += (x==0)?'<td  '+fontStr+borderL+' class="center whiteBG">'+daysLong[x+1].substr(0,1)+'</td>':'<td '+fontStr+' class="center whiteBG">'+daysLong[x+1].substr(0,1)+'</td>'
	}
	calStr+='</tr>';
	var cnt = 0,clDate = (calDate.getDay()==0)?6:calDate.getDay()-1;
	for(var x=0;x<clDate;x++){
		calStr +=(cnt==0)?'<tr><td '+fontStr+borderL+' class="fsmall e" width="24">&nbsp;</td>':'<td '+fontStr+' class="fsmall e">&nbsp;</td>';
		cnt++;
	}
	for(var x=0;x<mDays[calDate.getMonth()];x++){if(cnt > 4){
			calStr+=(cnt==0)?'<tr><td '+fontStr+' line-height: 150%;" width="24" '+borderL+' class="center">':'<td '+fontStr+' width="24" class="mmushroomBG center">';
		}else{calStr+=(cnt==0)?'<tr><td '+fontStr+' width="24" '+borderL+' class="center">':'<td '+fontStr+' width="24" class="center">';}
		calDate.setDate(x+1);
		if(calDate>=firstDate && calDate.getTime()< lastDate.getTime()+getDayAsMilli(1)){
			calStr +='<a style="color:#900" href="javascript:setDay('+calDate.getFullYear()+''+(((calDate.getMonth()+1)<10)?0+''+(calDate.getMonth()+1):(calDate.getMonth()+1))+',\''+(((x+1)<10)?0+''+(x+1):(x+1))+'\')">'+(x+1)+'</a></td>';
		}else{
			calStr +="<span style='text-decoration: line-through;'>"+(x+1)+"</span></td>"
		}
		cnt++;
		if(cnt == 7){calStr +='</tr>';cnt=0;}
	}
	if(cnt<7 && cnt!=0){calStr+='<td class="e" valign="top" colspan="'+(7-cnt)+'">&nbsp;</td></tr>'}
	calStr +='<tr>';
	calStr+='<td '+fontStr+' colspan="7" valign="bottom" align="right" class="b2 r5"><a href="#" onclick="closeit(); return false;" style="color:#900">'+calClose+'</a></td>';
	calStr+='</tr></table>';
	cl = document.getElementById("opodoCal");
	c2 = document.getElementById("opodoCal2");
if(top == null && left == null){
		findPosition(document.getElementById(ddow),left,top);
}else if(pod == 'true'){
		findPositionAcourding(document.getElementById(ddow),left,top,pod);
}else{
	cl.style.top=''+top+"px";
	cl.style.left=left+"px";
	c2.style.top=''+top+"px";
	c2.style.left=left+"px";
}
	cl.style.display='';
	cl.innerHTML=calStr;
var calStr2 = '<iframe width="175" height="'+cl.offsetHeight+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" border="0" src=""></iframe>';
	c2.style.display='';
	c2.innerHTML=calStr2;
}
function setTch(){
	touched=true;
	}
function swapDate(item,doIt){
 if(doIt){
	item.innerHTML=item.title;
}
else{if(String(document.location.href).indexOf(".de")!=-1){item.innerHTML=item.innerHTML.substr(0,2)}else{item.innerHTML=item.innerHTML.substr(0,3)}}
}
var touched = false;
function calcDay(tch){
var inDateVal = document.getElementById(ind).options[document.getElementById(ind).selectedIndex].value;
	var inMonthVal = document.getElementById(inmy).options[document.getElementById(inmy).selectedIndex].value;
	var outDateVal = document.getElementById(outd).options[document.getElementById(outd).selectedIndex].value;
	var outMonthVal = document.getElementById(outmy).options[document.getElementById(outmy).selectedIndex].value;
	if(!isNaN(tch)){touched = true;}
	var lDay = new Date();
	var rDay = new Date();
	lDay.setDate(1);
	lDay.setMonth(parseInt(inMonthVal.substring(4,6)-1));
	lDay.setFullYear(inMonthVal.substring(0,4));
	leapYear(lDay.getFullYear());
	(mDays[lDay.getMonth()]<=inDateVal)?lDay.setDate(mDays[lDay.getMonth()]):lDay.setDate(inDateVal);
	rDay.setDate(1);
	rDay.setMonth(parseInt(outMonthVal.substring(4,6)-1));
	rDay.setFullYear(outMonthVal.substring(0,4));
	leapYear(rDay.getFullYear());
	(mDays[rDay.getMonth()]<=outDateVal)?rDay.setDate(mDays[rDay.getMonth()]):rDay.setDate(outDateVal);
	var minRDay = new Date(serverTime.getTime()+parseInt(getDayAsMilli(offSet)));
	if(touched == false && minRDay.getTime()>rDay.getTime()){
		rDay.setDate(minRDay.getDate());
		rDay.setFullYear(minRDay.getFullYear());
		rDay.setMonth(minRDay.getMonth());
	}
		if(serverTime.getTime()>rDay.getTime()){
			if(serverTime.getDate()<rDay.getDate()){
				rDay.setTime(serverTime.getTime()+parseInt(getDayAsMilli(first)));
			}else{
				if(serverTime.getMonth()!=11){
					rDay.setMonth(serverTime.getMonth()+1)
				}else{
					rDay.setMonth(0);rDay.setFullYear(rDay.getFullYear()+1)
				}
		}
	}
	if(serverTime.getTime()>lDay.getTime()){
		if(serverTime.getDate()<lDay.getDate()){
			lDay.setTime(serverTime.getTime()+parseInt(getDayAsMilli(first)));
		}else{
			if(serverTime.getMonth()!=11){
				lDay.setMonth(serverTime.getMonth()+1)
			}else{
				lDay.setMonth(0);lDay.setFullYear(lDay.getFullYear()+1)
			}
		}
	}
	if(touched == false && lDay.getTime()>=rDay.getTime()){
		rDay.setTime(lDay.getTime()+parseInt(getDayAsMilli(offSet)));
	}
	if(rDay.getTime()>parseInt(serverTime.getTime()+parseInt(getDayAsMilli(last)))){
		rDay.setTime(serverTime.getTime()+parseInt(getDayAsMilli(last)));
	}
	if(lDay.getTime()>parseInt(serverTime.getTime()+parseInt(getDayAsMilli(last)))){
		lDay.setTime(serverTime.getTime()+parseInt(getDayAsMilli(last-1)));
	}

	setDDValue(document.getElementById(inmy),String(lDay.getFullYear()+''+(((lDay.getMonth()+1)<10)?0+''+(lDay.getMonth()+1):(lDay.getMonth()+1))));
	setDDValue(document.getElementById(ind),lDay.getDate());
	setDDValue(document.getElementById(outmy),String(rDay.getFullYear()+''+(((rDay.getMonth()+1)<10)?0+''+(rDay.getMonth()+1):(rDay.getMonth()+1))));
	setDDValue(document.getElementById(outd),rDay.getDate());
	setDates(ind,inmy,idow);
	setDates(outd,outmy,odow);
}
function setDDValue(oDropDown, sValue){
 for(var i=0; i<oDropDown.options.length; ++i){
  if(oDropDown.options[i].value == sValue){oDropDown.selectedIndex = i;break;}
 }
}
function closeit(){cl.style.display='none';c2.style.display='none';}
function leapYear(cyear){
	var isLeapYear = (((cyear % 4 == 0) && (cyear % 100 != 0)) || (cyear % 400 == 0));
	mDays[1] = (isLeapYear)?29:28;
}
// this animate function reloads the animated gif on the search holding pages
function animate() {
	if (!document.getElementById("moveingpic")) return true;
	var animatePic = document.getElementById("moveingpic");
	animatePic.setAttribute("src","http://www.opodo.co.uk/en/opodo/images/holding/hld_ani.gif");
}

function resetAni(){	
	setTimeout('document.images["moveingpic"].src = "/gen/opodo/images/pres/hld_ani.gif"', 200); 
}

function popUp(url,w,h,name,resizable,scrollbar,menu,tool,status,directories,x,y){

	this.strUrl = url;
	//x and y for window screen position not required at the moment
	this.intX = x;
	this.intY = y;

	this.strName = "win_"+name;
	this.strResizable = (resizable=="yes" || resizable==1) ? "resizable=yes" : "";
	this.strScroll = (scrollbar=="yes" || scrollbar==1) ? "scrollbars=yes" : "";
	this.strMenu = (menu=="yes" || menu==1) ? "menubar=yes" : "";
	this.strTool = (tool=="yes" || tool==1) ? "toolbar=yes" : "";
	this.strStatus = (status=="yes" || status==1) ? "status=yes" : "";
	this.strDirectories = (directories=="yes" || directories==1) ? "directories=yes" : "";
	this.intW = (!isNaN(w)) ? "width="+w: "";
	this.intH = (!isNaN(h)) ? "height="+h: "";
	
	this.arrOptions = new Array(this.strResizable,this.strScroll,this.strMenu,this.strTool,this.strStatus,this.strDirectories,this.intW,this.intH);
	this.strOptions = "";
	
	//build the options
	for(var i=0;i<this.arrOptions.length;i++){
		if(this.arrOptions[i].length>0){
			this.strOptions+=this.arrOptions[i]+",";
		}
	}
	//remove any trailing ","
	if(this.strOptions.length>0){
		this.strOptions=this.strOptions.substring(0,this.strOptions.length-1);
	}
	
	this.win=window.open(this.strUrl,this.strName,this.strOptions);
	this.win.focus();
}

function genPopUp(url,w,h,name,resizable,scrollbar,menu,tool,status,directories,x,y){
	//no requirement to hold popups in global references at the moment
	new popUp(url,w,h,name,resizable,scrollbar,menu,tool,status,directories,x,y)
	return false;
}


function hideError(){
	document.getElementById("error").style.display="none";
}
function showError(){
	document.getElementById("errorMessage").innerHTML = "<ul><li class=\"errMsg\">"+hiErr+"</li></ul>";
	document.getElementById("error").style.display="";
	window.scrollTo(0,0);
}
function showDest(num){
if(num<11){
	document.getElementById('dest').value=destArr[num-1];
	document.getElementById('hotel').value='';
	}
}
var errorBorder = "#CCCCCC";
function errorCheck(nam,err){
	var check = document.getElementById(nam);
	check.style.borderColor = errorBorder;
	var errorMsg = "";
	if(check.value==""){
		check.focus();
		check.style.borderColor="#FF0000";
		errorMsg +='<li class="mlneg9v11">'+err+'</li>\n';
		}
	if(errorMsg != ""){
		document.getElementById("errorMessage").innerHTML = "<ul>"+errorMsg+"</ul>";
		document.getElementById("error").style.display="";
		window.scrollTo(0,0);
		return false;
	}else{
		//dispHolding();
		setTimeout("dispHolding()",50);
		return true;
		}
	}

function blankIfNotNumeric( obj ){
	//determine if the field contains a numeric value
	var numericPattern	= /(\d)/;
	var objValue 		= obj.value;
	var checkReg 		= objValue.match( numericPattern );
	
	if( checkReg == null ){
		//no, lets blank out the field
		obj.value = "";
		obj.select();
	}

}



function generateInfantRoomAllocation(){
	var searchForm = document.forms['tripPackageHotelFlightSearchForm'];
	if (searchForm == null){
		searchForm = document.forms['ComtecForm'];
	}
	var inputName = 'roomAllocations[0].adultQuantity';
	var infantRoomAllocation = 'roomAllocations[0].infantQuantity';
	var totalTravellers=parseInt(searchForm[inputName].value);
	generateOption(searchForm[infantRoomAllocation], parseInt(searchForm[inputName].value));
}

function generateOption(elem, num){
	var prevSelectedVal = elem.value;

	elem.length = 0;
	for (var i=0; i<=num; i++){
		var option = document.createElement('option');
		option.value = i;
		option.innerHTML = i;
		if (i==prevSelectedVal){
			option.selected = "true";
		}
		elem.appendChild(option);
		if (prevSelectedVal < elem.length){
			elem.selectedIndex = prevSelectedVal;
		} else {
			elem.selectedIndex = elem.length - 1;
		}
	}
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}function URI(baseURI) {
	// This is basically adapted from DojoToolkit.org (dojo.io.encodeForm)
	this.params = {};
	this._uri = baseURI;

	// Given a form this will convert its fields into a GET URL
	this.encodeForm = function(formNode) {
		for (var i=0; i<formNode.elements.length; i++) {
			var elem = formNode.elements[i];
			
			if(elem.disabled || elem.tagName.toLowerCase() == "fieldset" || !elem.name) {
				continue;
			}

			var name = elem.name;
			var type = elem.type.toLowerCase();

			if(type == "select-multiple") {
				for(var j=0;j<elem.options.length;j++) {
					if(elem.options[j].selected) {
						this.params[name] = elem.options[j].value;
					}
				}
			} else if((type == "radio") || (type == "checkbox")) {
				if(elem.checked) {
					this.params[name] = elem.value;
				}
			} else if((type != "file")||(type != "submit")||(type != "reset")||(type != "button")) {
				this.params[name] = elem.value;
			}
		}
	}

	// This can be used to add another parmeter to the url
	this.addParameter = function(paramName, paramValue) {
		this.params[paramName] = paramValue;	
	}

	// This can be used to remove a parameter from the url
	this.removeParameter = function(paramName) {
		delete(this.params[paramName]);
	}

	this.setBaseURI = function(newBaseURI) {
		this._uri = newBaseURI;
	}

	this.getBaseURI = function() {
		return this._uri;
	}

	this.getURL = this.toString;	

	this.toString = function() {
		toReturn = this._uri;
		values = [];

		// ONLY if the url lacks ? (unlikly for o:url strings)
		index = toReturn.indexOf('?');
		if(index == -1) {
			toReturn += '?';
		} else if((index != toReturn.length) && (toReturn.charAt(toReturn.length) != '&')) {
			// Spot ...?word1=word2 (but not ...? or ...?word1=word2&)
			// If it is word1=word2 then append a & (But only in said instance)
			toReturn += '&';
		}

		for(paramIndex in this.params) {
			paramValue = this.params[paramIndex];
			values.push(paramIndex + "=" + paramValue);
		}

		toReturn += values.join('&');
		return toReturn;
	}
}var Referrer = new Object;
Referrer.All = document.referrer.toString();
if(Referrer.All != ""){
}
else{
Referrer.All = window.location.toString();

}

var arrAllDomain = Referrer.All.split("//");
var arrDomain = arrAllDomain[1].split("http://www.opodo.co.uk/");
Referrer.Domain = arrDomain[0];

var ait_arrRef = Referrer.All.split("?");
Referrer.Page = ait_arrRef[0];

Referrer.QueryString = new Object;

var ait_arrRef = Referrer.All.split("?");

var ait_strQS;


if(ait_arrRef.length > 1){
ait_strQS = ait_arrRef[1];
}
else{
ait_strQS = "";
}

var arrQS_values = ait_strQS.split("&")
for(var i=0;i<arrQS_values.length;i++){
var ait_arrPair = arrQS_values[i].split("=");
Referrer.QueryString[ait_arrPair[0]] = UNESCAPE(ait_arrPair[1]); 
}
Referrer.QueryString["FieldCount"] = arrQS_values.length;
//Referrer.Enumerate = Referrer_Enumerate;
var ait_QUOTE = String.fromCharCode(34);

var Request = new Object;

Request.All = window.location.toString();
ait_arrRef = Request.All.split("?");

Request.Page = ait_arrRef[0];
Request.QueryString = new Object;
var arrAllDomain = Request.All.split("//");
var arrDomain = arrAllDomain[1].split("http://www.opodo.co.uk/");
Request.Domain = arrDomain[0];

ait_arrRef = Request.All.split("?");
if(ait_arrRef.length > 1){
ait_strQS = ait_arrRef[1];
}
else{
ait_strQS = "";
}

var arrQS_values = ait_strQS.split("&")
for(var i=0;i<arrQS_values.length;i++){
var ait_arrPair = arrQS_values[i].split("=");
Request.QueryString[ait_arrPair[0]] = UNESCAPE(ait_arrPair[1]);  
}
Request.QueryString["FieldCount"] = arrQS_values.length;
//Request.Enumerate = Enumerate;

function UNESCAPE(U_VALUE){
U_VALUE = unescape(U_VALUE);
while(U_VALUE.indexOf("+") > -1){
U_VALUE = U_VALUE.replace("+", " ");
}
return U_VALUE;
}