
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


<!--  The Below code is for the imprint tracking system, specific for backpacker-->



/********************************************************
 * Copyright Nexsys Development Ltd 2002 - 2004         *
 * Version 1.7                                          *
 * http://www.nexsysdev.com                             *
 ********************************************************/
 
var NI_SE = "", NI_SC = "", NI_ST = "", NI_SV = "", NI_IW = 0;

function ni_TrackHit(server, siteCode, description, section, service, trigger, amount, adCampaign, title, url, layer, basketAdd, basketRemove, parameters)
{ 
   NI_SE = server; NI_SC = siteCode; NI_ST = section; NI_SV = service;
   
   function CB()
   {
      var cb="", key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";            
      for (i=0;i<5;i++) cb += key.charAt(Math.floor(Math.random()*52));      
      return cb;
   }

   function A(B,C)
   {
      if (typeof(C) != "undefined" && C != "") return "&"+B+"="+escape(C);
      else return "";
   }
   
   if (typeof(NI_PAGE) != "undefined")
   {
     if (url.indexOf("?") > 0) url += "&ni_page=" + NI_PAGE;
     else url += "?ni_page=" + NI_PAGE;
   }
	
   var p = "http"+(document.URL.indexOf('https:')==0?'s':''); 	
   var t = new Date();	
   var u = p+"://"+server+"/Hit.aspx?tv=1&sc="+siteCode;
   u+=A("lo",description);
   u+=A("du",url);
   u+=A("st",section);
   u+=A("sv",service);
   u+=A("ac",adCampaign);
   u+=A("tr",trigger);
   u+=A("ta",amount);
   u+=A("ti",title);
   u+=A("tz",t.getTimezoneOffset());
   u+=A("ch",t.getHours());
   u+=A("cb",CB());	
   u+=A("ru",window.document.referrer);
   u+=A("js","1");
   u+=A("ul",navigator.appName=="Netscape" ? navigator.language : navigator.userLanguage);
   u+=A("ba", basketAdd);
   u+=A("br", basketRemove);
   u+=A("pm", parameters);
	
   if (typeof(screen)=="object")
   {
      u+=A("sr",screen.width+"x"+screen.height);	
   }
	
	if (layer == 1)
	{
	  if (NI_IW == 0) { document.write('<div style="position:absolute;width:1px;height:1px;overflow:hidden"><IMG name="ni_tag" id="ni_tag" border="0" width="1" height="1" src="'+u+'"></div>'); NI_IW = 1; }
	  else { u+=A("ir","1"); document.images.ni_tag.src = u; }
 	}
 	else
 	{
 	  document.write('<IMG name="ni_tag" id="ni_tag" border="0" width="1" height="1" src="'+u+'">'); NI_IW = 2;
 	}
}

/* The following function may be used any number of times in a page to load a file and track a hit 
 * against that file.  This is useful when the file being loaded is not html, 
 * or is not under your control, so can't have an imprint tracking code inserted into it.
 *
 * E.g. <a href="javascript:ni_LoadUrl('Catalogue.pdf', 'Catalogue')">Download catalogue</a>
 *
 * If you consider clicking on the link to be the completion of a transaction, use the 'Sale' trigger
 * E.g. <a href="javascript:ni_LoadUrl('Catalogue.pdf', 'Catalogue', 'Sale')">Download catalogue</a>
 */
function ni_LoadUrl(url, title, trigger)
{  
  ni_TrackHit(NI_SE, NI_SC, "", NI_ST, NI_SV, trigger, "", "", title, url, NI_IW, "", "", "");
  document.location.href = url;
}		
		


<!-- Start: Nexsys Imprint Code (Copyright Nexsys Development Ltd 2002-2004) -->
ni_TrackHit("imprint1.nexsysdev.net", 79504, "", "", "", "", "", "", document.title, document.URL, 1, "", "", "");
<!-- End: Nexsys Imprint Code -->


<!-- www.hitslink.com/ web tools statistics hit counter code -->

var pageName ;

if(location.search.length > 0)
	{	
	pageName = location.search;
	pageName = pageName.substring(1, pageName.length); 

	}
  else
	{
	pageName = location.pathname;
	} ;


var data,nhp,ntz,rf,sr;document.cookie='__support_check=1';nhp='http';
rf=document.referrer;sr=document.location.search;
if(top.document.location==document.referrer
|| (document.referrer == '' && top.document.location != ''))
{rf=top.document.referrer;sr=top.document.location.search}
ntz=new Date();if(location.href.substr(0,6).toLowerCase()=='https:')
nhp='https';data='&an='+escape(navigator.appName)+ 
'&sr='+escape(sr)+'&ck='+document.cookie.length+
'&rf='+escape(rf)+ '&sl='+escape(navigator.systemLanguage)+
'&av='+escape(navigator.appVersion)+ '&l='+escape(navigator.language)+
'&pf='+escape(navigator.platform)+ '&pg='+pageName   ;
if(navigator.appVersion.substring(0,1)>'3') {data=data+'&cd='+
screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
'&tz='+ntz.getTimezoneOffset()+'&je='+ navigator.javaEnabled()};
document.write('<img border=0 hspace=0 '+
 'vspace=0 width=1 height=1 src="'+nhp+'://counter.hitslink.com/'+
 'statistics.asp?v=1&s=26&acct=backpacker'+data+'">');


document.write('<noscript><img border=0 hspace=0 vspace=0 width=1 height=1 alt="" src="http://counter.hitslink.com/stats-ns.asp?acct=backpacker&amp;v=1&amp;s=26"></noscript>');

<!-- End www.hitslink.com/ statistics web tools hit counter code -->

<!--

/*
==========================================================================
Author:			Campbell Preece
Purpose:		Validation routines for Survey and FormReceiver client pages
Version:		1.0
Dated:			20 April 2004
Edited:			Duncan Jones 8/11/05, changed to make specific for extra drivers, code copied from britz common4
==========================================================================
*/
function kt_set_values(element_name,element_value){ //Called from server-validation process upon post back to preserve state
	if(document.readyState=='complete'){
		if(document.forms.length>0){
			var m_oForm = document.forms[0];
			var col = eval("m_oForm." + element_name);
		}else{
			var col = eval(element_name);
		}
		//Now set the values...
		if(typeof(col)=="undefined"){return;} //someone might have entered the querystring reffing a kt_ element that doesn't exist
		if(typeof(col.length)=="undefined"){
			var type = col.type.toLowerCase();
			//INPUTS (incl. single Checkboxes and Radios):
			if(type=="text"){
				col.value = element_value;
				return;
			}
			if(type=="textarea"){
				col.innerText = element_value;
				return;
			}
			if(type=="checkbox"||type=="radio"){
				col.checked = element_value;
				return;
			}
		}
		if(typeof(col.length)=="number"){
		
			for (var i=0; i<col.length; i++){
				var tagname = col[i].tagName.toLowerCase();
				//Not all elements have types: eg, option
				var type = typeof(col[i].type)=='undefined' ? '' : col[i].type.toLowerCase();

				//CHECK - might have multiple values transported in one string (comma sep):
				if(type=="checkbox"){	
					var v = element_value.toString().split(",");
					for (var j=0; j<v.length; j++){
						if(col[i].value==v[j]){
							col[i].checked = true;
						}
					}
				}
				//RADIO:
				if(type=="radio"){	
					if(col[i].value==element_value){
						col[i].checked = true;
					}
				}
				//SELECT
				if(tagname=="option"){
					if(col[i].value==element_value){
						col[i].selected = true;
					}
				}
			}
		}
	}else{
		setTimeout("kt_set_values(\"" + element_name + "\",\"" + element_value + "\")",50)
	}
}
//---------------------------------------------------------------
function kt_getElements(){

	var objMaxDriver = document.getElementById('kt_ExtraDrivers');
	var maxDriver= objMaxDriver.options[objMaxDriver.options.selectedIndex].value; 
	
	var vTypes = new Array("input","select","textarea");
	var v = new Array();
	var j = 0;
	var parent = null;
	
	if(document.forms.length>0){
		parent = document.forms[0];
	}else{
		parent = document;
	}
		
	for(var t=0; t<vTypes.length; t++){
		var oCol = parent.getElementsByTagName(vTypes[t]);
		for(var i=0; i<oCol.length; i++){
			//add the appropriate elements into the array
			var oObj = oCol[i];
			if (oObj.name.indexOf("kt_")>-1){
				
				// Get numer of extra drivers
				// loop through fields and only add extra driver fields that are identified as been less than
				// total number of extra drivers
				
				var attr = oObj.getAttribute('extraDriver');
				if 	(attr != null)
				{
						//see if this extra driver value is less than the max number of specified drivers
						if (attr<=maxDriver)
						{
						// yep add to collection
						//alert('Made It' + attr + oObj.name)
							v[j] = oObj;
							j++;
						}
				}
				else
				{
				// element dosen't have extraDriver attribute but is still a kt_ 
				// so add to collection
				//alert("Didn't make It" + attr)
					v[j] = oObj;
					j++;						
				}	
									
			
			}
		}
	}
	return v;
}

//--------------------------------------------------------------
function kt_getElement(oObj){
	//loop thru the collection of attributes and return kt ones for the specified element
	if(oObj){
		var v = new Array();
		var vAttributeNames = kt_getAttributeNames();
		var kt = new kt_element(oObj)
		for (i=0; i<vAttributeNames.length; i++){
			var attr = oObj.getAttribute(vAttributeNames[i]);
			//create a new kt object for this element...
			if(!attr){attr='';}
			eval("kt." + vAttributeNames[i] + "=\"" + attr + "\"");
		}
		return kt;
	}else{
		return null;
	}
}
//===============================================================
function kt_getAttributeNames(){
	//An array of ALL the custom kt_ attributes - order not important - can add more
	return new Array("kt_udt_report_fieldname","kt_udt_mandatory","kt_udt_report_fieldvalues","kt_udt_report_fieldname","kt_udt_regexp")
}
//--------------------------------------------------------------
function kt_getTypeFromObj(type){
	switch(type){
		case "text":return "text";
		case "textarea":return "textarea";
		case "select-one":return "";
		case "hidden":return "hidden";
	}
	return "";
}
//--------------------------------------------------------------
function kt_element(oObj){
	var vAttributeNames = kt_getAttributeNames();
	//Setup our custome attributes AND some standard element-specific ones...
	for (var p=0; p<vAttributeNames.length; p++){
		eval("this." + vAttributeNames[p] + "=null");
	}
	this.value = oObj.value;
	this.type = kt_getTypeFromObj(oObj.type);
	this.name = oObj.name;
	this.id = oObj.id;
	this.checked = oObj.checked;
	this.tagName = oObj.tagName.toLowerCase();
	this.obj = oObj;
}
//--------------------------------------------------------------
function formatRegExp(s,regexp){
	//carats must be moved before the slash...
	var i = regexp.indexOf("^");
	var special_chr = "";
	if(i!=-1){
		regexp = regexp.substring((i+1),regexp.length);
		special_chr = "^"
	}
	
	regexp = special_chr + "" + regexp + "";
	re = new RegExp(regexp,"g");
	return re;
}
//--------------------------------------------------------------
function kt_getGroup(kt_element_name){
	//Receives a kt element name and returns an array of kt elements that match the name
	var v = new Array();
	var j = 0;
	var kts = kt_getElements();
	for(var i=0; i<kts.length; i++){
		if(kts[i].name==kt_element_name){
			v[j] = kts[i]; //at the very least, itself will be added to the array
			j++;
		}
	}
	return v;
}
//--------------------------------------------------------------
function kt_eval_group_mandatory(kt_group){
	var checked = 0;
	var mandatory = 0;
	var kt_udt_report_fieldname = kt_group[0].kt_udt_report_fieldname;

	//Get a value as to whether or not an anwser is given
	for(var k=0; k<kt_group.length; k++){
		var y = kt_group[k].checked==true ? 1 : 0;
		checked += y;
		var z = kt_group[k].kt_udt_mandatory==1 ? 1 : 0;
		mandatory += z;
	}
	if(mandatory>0&&checked==0){	
		alert("Please make a selection for " + "" + "\"" + kt_udt_report_fieldname + "\"")
		return false;
	}else{
		return true;
	}
}
//--------------------------------------------------------------
function kt_validate(){
	//Loop thru all the kt elements and ensure that they are completed
	var oObjs = kt_getElements();
	
	for(var i=0; i<oObjs.length; i++){
		var kt = kt_getElement(oObjs[i]);				
		if(kt.kt_udt_mandatory==1){
			//First check to see if its part of a group of like-named elements
			var kt_group = kt_getGroup(kt.name);

			if(kt_group.length>1){
				var success = kt_eval_group_mandatory(kt_group);
				if(!success){
					return false;
				}
			}else{
				if(kt.kt_udt_regexp){
					//Now evaluate the regular expression tied to it...
					var s = new String(kt.value);
					re = formatRegExp(s,kt.kt_udt_regexp);
					var r = s.match(re);
					if(!r){
						alert("Incorrect entry for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}
				}
				//Might be a textbox with Manditory set...
				if (kt.type=='text'){
					if(kt.value==''){
						alert("Please enter a value for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}				
				}
				
				
				//Might be a single Checkbox forcing to agree...
				if (kt.type=='checkbox'){
					if(!kt.checked){
						alert("Please check the box for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}
				}
				//might be a select list...
				if(kt.tagName=="select"){
					if(kt.value==''){
						alert("Please select a value for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}
				}

			}
		}

	}


	document.Form1.action = "../home/sendemail_backpacker_prereg.asp";
	document.Form1.submit();
	return true;
}

//--------------------------------------------------------------
function kt_validate_AU(){
	//Loop thru all the kt elements and ensure that they are completed
	var oObjs = kt_getElements();
	
	for(var i=0; i<oObjs.length; i++){
		var kt = kt_getElement(oObjs[i]);				
		if(kt.kt_udt_mandatory==1){
			//First check to see if its part of a group of like-named elements
			var kt_group = kt_getGroup(kt.name);

			if(kt_group.length>1){
				var success = kt_eval_group_mandatory(kt_group);
				if(!success){
					return false;
				}
			}else{
				if(kt.kt_udt_regexp){
					//Now evaluate the regular expression tied to it...
					var s = new String(kt.value);
					re = formatRegExp(s,kt.kt_udt_regexp);
					var r = s.match(re);
					if(!r){
						alert("Incorrect entry for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}
				}
				//Might be a textbox with Manditory set...
				if (kt.type=='text'){
					if(kt.value==''){
						alert("Please enter a value for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}				
				}
				
				
				//Might be a single Checkbox forcing to agree...
				if (kt.type=='checkbox'){
					if(!kt.checked){
						alert("Please check the box for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}
				}
				//might be a select list...
				if(kt.tagName=="select"){
					if(kt.value==''){
						alert("Please select a value for " + "" + "\"" + kt.kt_udt_report_fieldname + "\"")
						oObjs[i].focus();
						return false;
					}
				}

			}
		}

	}


	document.Form1.action = "../home/sendemail_backpacker_prereg_AU.asp";
	document.Form1.submit();
	return true;
}

//--------------------------------------------------------------

function jsShowExtraDrivers(){

	var obj = document.getElementById('kt_ExtraDrivers');
	var value= obj.options[obj.options.selectedIndex].value;  
 	jsHideAllDriverLayers()
 	jsShowDriverLayers(value);
}

function jsShowDriverLayers(number){	
var i = 0
	for (i=1; i<=number; i=i+1) 
	{
	jsShowLayer('driver' + i);
	} 
}

function jsHideAllDriverLayers(){	
var i = 0
	for (i=1; i<=7; i=i+1) 
	{
	jsHideLayer('driver' + i);
	} 
}


function jsShowLayer(id){	
	var obj = document.getElementById(id);
	obj.style.display = 'block';
	return false;
}

function jsHideLayer(id){
	var obj = document.getElementById(id);
	obj.style.display = 'none';
	return false;
}



//-->


