<!-- Hide from old browsers
//-----------------------------------------------------
//		Cookie Scripts
//-----------------------------------------------------
	var cookStatus = "";
	var sCookieValue = "";
	var bCookies = true;
	var bMustBeSat = true;
	var hasGotaCopy = false;
	//cookie vars
	var dbNrPass = 0;
	var bdLocation="";
	var bdAgent = "";
	var dbDate = "";
	var bdSunday = "";
	var dbOccasion = "";
	var pdContName = "";
	var pdContEmail = "";
	var pdContWorkNr = "";
	var pdContHomeNr = "";
	var pdContCellNr = "";
	var pdContFaxNr = "";
	var pdAddr1 = "";
	var pdAddr2 = "";
	var pdAddr3 = "";
	var pdAddr4 = "";
	var pdAddr5 = "";
	var pdAddrPC = "";
	var ccCardNr="";
	var cc3Digits="";
	var ccName = "";
	var ccBank = "";
	var ccBudget="";
	var ccExpDate="";
	var ccIDNr="";
	var ccType="";
	var ccAgree="";
	var ccAccept ="";
	var ccAmount = "";
	 //This is the browser detection routine that sets-up the DOM.
	var ns4 = (document.layers) ? true:false 
	var ie4 = (document.all) ? true:false 
	var ng5 = (document.getElementById) ? true:false 
	var isIE=document.all?true:false;
	var isDOM=document.getElementById?true:false;
	var isNS4=document.layers?true:false;
	//var pdPassName = new Array();
	//var pdPassID = new Array();
	//var pdPassWeight = new Array();
//----------------------------------------------------
//			Miscellaneous
//----------------------------------------------------
	function blockError(){return true;}
	window.onerror = blockError;
	function autotab(original,destination){
		if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
			{destination.focus();}
	}
	function replaceString(aSearch, aFind, aReplace) {
			   result = aSearch;
			    if (result != null && result.length > 0) {
			        var a = 0;
			        var b = 0;
			        while (true) {
			            a = result.indexOf(aFind, b);
			            if (a != -1) {
			                result = result.substring(0, a) + aReplace + result.substring(a + aFind.length);
			                b = a + aReplace.length;}
			            else
			            break;
			        }
			    }
			    return result;
			}
//----------------------------------------------------
//			Hide & Show
//----------------------------------------------------
	
//The code to HIDE a set of layers. 
//Set nr of layers in form at start
var Gnrlayers = 0;
function hideSec() { 
	var intNrLayers = 0;
	if (Gnrlayers == "" || Gnrlayers ==0) {intNrLayers = 2;}
	else {intNrLayers = eval(Gnrlayers) + 1;}
	for (var i = 1; i < intNrLayers; i++) {
		if (ng5) document.getElementById('sec' + i).style.visibility = "hidden"; 
		else if (ns4) document.layers["sec" + i].visibility = "hide"; 
		else if (ie4) document.all["sec" + i].style.visibility = "hidden"; 
	}

}
// The code to DISPLAY a single layer and HIDE all other layers. 
// Note the "HIDE" function is called first, and it also does NOT have a number assigned to it. 
//This "hides" all layers globally (of the particular suffix set). 
function showSec(n) { 
	hideSec(); 
	if (ng5) document.getElementById('sec' + n).style.visibility = "visible"; 
	else if (ns4) document.layers["sec" + n].visibility = "show"; 
	else if (ie4) document.all["sec" + n].style.visibility = "visible"; 
}
 function sendform(inUrl) {
    if (document.images)
   	 	location.replace(escape(inUrl));
    else
    	location.href = escape(inUrl);
    return false;
}

//----------------------------------------------------
//			Cookies
//----------------------------------------------------
	function HasCookiesEnabled() {
	// Find out if your user has cookies enabled
	// this is arbitrary - it just looks like a normal cookie
			cookievar1 = "AE87BC5C097ADD230B543BCD8";
			SetCookie ('lifeballooning', cookievar1, 56);
			if (GetCookie('lifeballooning') == cookievar1) {
			    	rhrn2 = new Date();
			    	rhrnt2 = rhrn2.getTime();}
			else {rhrnt2 = 0}
				if (rhrnt2 < (rhrnt1 + 300) && rhrnt2 > 0) {
				    	cookStatus = "You have cookies automatically enabled";}
				else {
				    	if (rhrnt2 == 0) {cookStatus = "You have cookies disabled";return false}
				        else {cookStatus = "You are clicking yes to cookies manually";}
			}
			return true;
		}
		function getCookieVal (offset) {
			var endstr = document.cookie.indexOf (";", offset);
			if (endstr == -1)
			endstr = document.cookie.length;
			return unescape(document.cookie.substring(offset, endstr));
		}
       function GetCookie (name) {
			var arg = name + "=";
			var alen = arg.length;
			var clen = document.cookie.length;
			var i = 0;
			while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break; 
			}
			return null;
		}  
        function SetCookie (name, value) {
			var argv = SetCookie.arguments;
			var argc = SetCookie.arguments.length;
			//alert ("writing cookie " + name + " Value = " + value);
			var expdate = new Date();
			expdate.setTime(expdate.getTime()+(1*24*60*60*1000));// 1 day
			var expires = expdate;
			var path = (argc > 3) ? argv[3] : null;
			var domain = (argc > 4) ? argv[4] : null;
			var secure = (argc > 5) ? argv[5] : false;
			document.cookie = name + "=" + escape (value) +
			((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
			((path == null) ? "" : ("; path=" + path)) +
			((domain == null) ? "" : ("; domain=" + domain)) +
			((secure == true) ? "; secure" : "");
		}
		function DeleteCookie (name) {  
			var exp = new Date();  
			exp.setTime (exp.getTime() - 1);   
			var cval = GetCookie (name);  
			document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
		}
		//------------------------------------------------------------------------------------------------------------------------------------
		//  								 MouseOver functions
		//-----------------------------------------------------------------------------------------------------------------------------------
		function MM_findObj(n, d) { //v4.01
		  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 && d.getElementById) x=d.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];}
		}
		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_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];}}
		}
	//------------------------------------------------------
	//				Booking Scripts
	//-------------------------------------------------------
		function CheckNrPeople(f) {
		bErr = false;
				if (f.selNrPeople.options[f.selNrPeople.selectedIndex].value < 4 && f.selLocation.options[ f.selLocation.selectedIndex].value == "Skeerpoort") {
					alert ("You may only select River Bear Lodge if you book for 4 people or more.");
					f.selLocation.selectedIndex=0;	
					bMustBeSat = true;
					bErr = true;
				}
				if (f.selNrPeople.options[f.selNrPeople.selectedIndex].value > 3) {bMustBeSat = false;}
				if (f.strBookDate.value=="" || f.selNrPeople.options[f.selNrPeople.selectedIndex].value < 4) {SetBookDate(f);}
		}
		function SetBookDate(f) {
			//alert ("bookdate " + f.strBookDate.value);
			var strWeekday="";
			var dtToday = new Date();
			var mm = dtToday.getMonth() + 1;
   			if (mm < 10) {mm = "0" + NewMonth;}
		    var dd = dtToday.getDate();
		    if (dd < 10) {dd = "0" + dd;}
		    var yy = dtToday.getFullYear();
			if (f.strBookDate.value=="") {
				if (bMustBeSat) {
					strWeekday="Saturday";
					f.strBookDate.value = strWeekday;
					var dtNew = new Date();
					var id = 6 - dtNew.getDay();
					if (id==0) {id=6;}			
		      		var MilliSecondsBase = 86400000;
			 		var MilliSecondsToAdd  = MilliSecondsBase * id;
					var EnteredDate = new Date();
					var NewDateAsNumber = EnteredDate.getTime() + MilliSecondsToAdd;
					var dtBook = new Date(NewDateAsNumber);
					}
				else {var dtBook = new Date();}
			}			
			else {
				var sdte = f.strBookDate.value;
				var len = sdte.length;
				var sDate =f.strBookDate.value;
				if (len > 11) {
					strWeekday = sdte.substring(0,len - 11);
					sDate = sdte.substring(len - 11,len);
					dd = sDate.substring(1,3);
					mm = sDate.substring(4,6);
					yy = sDate.substring(7,11);
				}			
				var EnteredDate = new Date(yy, mm, dd, 0, 0, 0);
				var sDay = GetDayName(EnteredDate.GetDate());
				if (EnteredDate < dtToday) {alert ("Select a date in future.");bErr = true;}
				if (bMustBeSat && sDay != "Saturday") {
					strWeekday = "Saturday";
					 f.strBookDate.value = strWeekday;
					var dtNew = new Date(sDate);
					var id = 6 - dtNew.getDay();
					if (id==0) {id=6;}
			      	var MilliSecondsBase = 86400000;
				 	var MilliSecondsToAdd  = MilliSecondsBase * id;
					var NewDateAsNumber = EnteredDate.getTime() + MilliSecondsToAdd;
					var dtBook = new Date(NewDateAsNumber);
				}
				else {var dtBook = EnteredDate;}
			}
			if (strWeekday == "") {strWeekday= GetDayName(dtBook.GetDate());}
			var NewMonth = dtBook.getMonth() + 1;
   			if (NewMonth < 10) {NewMonth = "0" + NewMonth;}
		    var NewDay = dtBook.getDate();
		    if (NewDay < 10) {NewDay = "0" + NewDay;}
		     var NewYear = dtBook.getFullYear();
		      // Display the new date in the form
		     f.strBookDate.value = strWeekday + " " + NewDay + "-" + NewMonth + "-" + NewYear;
			}
			function GetDayName(day) {
					// format day name
				switch(day) {
					case 0:
						dayString = "Sunday";
						break;
					case 1:
						dayString = "Monday";
						break;
					case 2:
						dayString = "Tuesday";
						break;
					case 3:
						dayString = "Wednesday";
						break;
					case 4:
						dayString = "Thursday";
						break;
					case 5:
						dayString = "Friday";
						break;
					case 6:
						dayString = "Saturday";
						break;
					case 7:
						dayString = "Sunday";
						break;
					}
			}
			function openCalendar(f) {
				if (f.selNrPeople.options[f.selNrPeople.selectedIndex].value < 4) {
					showCalendar(f.strBookDate,'Weekday dd-mm-yyyy','Choose date', 'Y')
				}
				else {showCalendar(f.strBookDate,'Weekday dd-mm-yyyy','Choose date', 'N')}
			}
			function GetBDFormCookie(cookPage) {
				sCookieValue = GetCookie("BookingDetail");
				if (sCookieValue != null) {
					var arrCookie = sCookieValue.split("#bd#");
					var i = 0;
					for (i=0; i < arrCookie.length; i++) {
						var arrSubs = arrCookie[i].split("=");
						if (arrSubs.length > 0) {
							if (cookPage=="BD") {
								if (arrSubs[0] == "selNrPass") {document.frmBook.selNrPeople.selectedIndex = arrSubs[1];}
								if (arrSubs[0] == "NrPass") {document.frmBook.NrPass.value = arrSubs[1];}
								if (arrSubs[0] == "selLocation") {document.frmBook.selLocation.selectedIndex = arrSubs[1];}
								if (arrSubs[0] == "Location") {document.frmBook.Location.value = arrSubs[1];}
								if (arrSubs[0] == "bookDate") {document.frmBook.strBookDate.value = arrSubs[1];}
								if (arrSubs[0] == "Occasion") {document.frmBook.strOccasion.value = arrSubs[1];}
								if (arrSubs[0] == "chkAgentTrue") {document.frmBook.chkAgent.checked = true;}
								if (arrSubs[0] == "chkSundayTrue") {document.frmBook.chkSunday.checked = true;}
							} // BD
							else {
								if (arrSubs[0] == "NrPass") {dbNrPass = arrSubs[1];}
								if (arrSubs[0] == "Location") {bdLocation=arrSubs[1];}
								if (arrSubs[0] == "chkAgentTrue") {bdAgent = "PLEASE NOTE: I'm a travel Agent";}
								if (arrSubs[0] == "bookDate") {dbDate =arrSubs[1];}
								if (arrSubs[0] == "Occasion") {dbOccasion =arrSubs[1];}
								if (arrSubs[0] == "chkSundayTrue") {bdSunday="I would really like to fly on a Sunday!";}
							}
						}
					}
				} // Cookie not null
			}
			function WriteBDFormCookie(f) {
				sCookieValue = "";
				sCookieValue = "selNrPass=" +f.selNrPeople.selectedIndex + "#bd#";
				sCookieValue = sCookieValue + "NrPass=" + f.selNrPeople.options[f.selNrPeople.selectedIndex].text + "#bd#";
				sCookieValue = sCookieValue + "selLocation=" +f.selLocation.selectedIndex + "#bd#";
				sCookieValue = sCookieValue + "Location=" + f.selLocation.options[f.selLocation.selectedIndex].text + "#bd#";
				sCookieValue = sCookieValue + "bookDate=" + f.strBookDate.value + "#bd#";
				sCookieValue = sCookieValue + "Occasion=" + f.strOccasion.value + "#bd#";
				if (f.chkSunday.checked) {sCookieValue = sCookieValue + "chkSundayTrue=True"+ "#bd#";}
				else {sCookieValue = sCookieValue + "chkSundayFalse=False"+ "#bd#";}
				if (f.chkAgent.checked) {sCookieValue = sCookieValue + "chkAgentTrue=True";}
				else {sCookieValue = sCookieValue + "chkAgentFalse=False";}
				SetCookie ("BookingDetail", sCookieValue);
				//return true;
			}
			function WritePDFormCookie(f) {
				sCookieValue = "";
				sCookieValue = "ContName=" +f.strContName.value + "#pd#";
				sCookieValue = sCookieValue + "ContEmail=" + f.strContEmail.value + "#pd#";
				sCookieValue = sCookieValue + "ContWorkNr=" +f.strContWorkNr.value + "#pd#";
				sCookieValue = sCookieValue + "ContHomeNr=" +f.strContHomeNr.value + "#pd#";
				sCookieValue = sCookieValue + "ContCellNr=" +f.strContCellNr.value + "#pd#";
				sCookieValue = sCookieValue + "ContFaxNr=" +f.strContFaxNr.value + "#pd#";
				sCookieValue = sCookieValue + "Addr1=" +f.strAddr1.value + "#pd#";
				sCookieValue = sCookieValue + "Addr2=" +f.strAddr2.value + "#pd#";
				sCookieValue = sCookieValue + "Addr3=" +f.strAddr3.value + "#pd#";
				sCookieValue = sCookieValue + "Addr4=" +f.strAddr4.value + "#pd#";
				sCookieValue = sCookieValue + "Addr5=" +f.strAddr5.value + "#pd#";
				sCookieValue = sCookieValue + "AddrPC=" + f.strAddrPC.value + "#pd#";
				var vN = "";
				var vI = "";
				var vW = "";
				var vCN = "";
				var vCI = "";
				var vCW = "";
				var sCVal = "";
				var iNP = eval(f.NrPass.value);
				if (isNaN(iNP)) {iNP = 15}
				else {iNP = iNP + 1}
				for (var i3 = 1; i3 <  iNP; i3++) {
					vN = "strPassName" + i3;
					vI = "strPassIDNr" + i3;
					vW = "strPassWeight" + i3;
					vCN = "PassName" + i3;
					vCI = "PassIDNr" + i3;
					vCW = "PassWeight" + i3;
					var vVN = eval("f." +vN + ".value");
					var vVI = eval("f." +vI + ".value");
					var vVW = eval("f." +vW + ".value");
					if (vVN !="" && vVI != ""  && vVW !="") {
						sCVal = sCVal + vCN +"=" + vVN + "#pd#";
						sCVal = sCVal + vCI +"=" + vVI + "#pd#";
						sCVal = sCVal + vCW +"=" + vVW;
						if ((i3 + 1) < iNP) {sCVal = sCVal  + "#pd#";}
					}
				}
				
				sCookieValue = sCookieValue + sCVal;
				SetCookie ("PassengerDetail", sCookieValue);
			}
			function GetPDFormCookie(cookPage) {
				sCookieValue = GetCookie("PassengerDetail");
				if (sCookieValue != null) {
					var arrCookie = sCookieValue.split("#pd#");
					var i = 0;
					for (i=0; i < arrCookie.length; i++) {
						var arrSubs = arrCookie[i].split("=");
						if (arrSubs.length > 0) {
							if (cookPage=="PD") {
								if (arrSubs[0] == "ContName") {document.frmBook.strContName.value = arrSubs[1];}
								if (arrSubs[0] == "ContEmail") {document.frmBook.strContEmail.value = arrSubs[1];}
								if (arrSubs[0] == "ContWorkNr") {document.frmBook.strContWorkNr.value = arrSubs[1];}
								if (arrSubs[0] == "ContHomeNr") {document.frmBook.strContHomeNr.value  = arrSubs[1];}
								if (arrSubs[0] == "ContCellNr") {document.frmBook.strContCellNr.value = arrSubs[1];}
								if (arrSubs[0] == "ContFaxNr") {document.frmBook.strContFaxNr.value= arrSubs[1];}
								if (arrSubs[0] == "Addr1") {document.frmBook.strAddr1.value = arrSubs[1];}
								if (arrSubs[0] == "Addr2") {document.frmBook.strAddr2.value = arrSubs[1];}
								if (arrSubs[0] == "Addr3") {document.frmBook.strAddr3.value = arrSubs[1];}
								if (arrSubs[0] == "Addr4") {document.frmBook.strAddr4.value = arrSubs[1];}
								if (arrSubs[0] == "Addr5") {document.frmBook.strAddr5.value = arrSubs[1];}
								if (arrSubs[0] == "AddrPC") {document.frmBook.strAddrPC.value = arrSubs[1];}
								if (arrSubs[0].indexOf("Pass") > -1) {
									var iNr = eval(dbNrPass) + 1;
									var vCN = "";
									var vCI = "";
									var vCW = "";
									for (var i3 = 1; i3 < iNr; i3++) {
										vCN = "PassName" + i3;
										vCI = "PassIDNr" + i3;
										vCW = "PassWeight" + i3;
										if (arrSubs[0] ==vCN) {document.frmBook['strPassName' + i3].value = arrSubs[1];}
										if (arrSubs[0] ==vCI) {document.frmBook['strPassIDNr' + i3].value = arrSubs[1];}
										if (arrSubs[0] ==vCW) {document.frmBook['strPassWeight' + i3].value = arrSubs[1];}
									}
								} // Pass
							} // PD
							else {
								if (arrSubs[0] == "ContName") {pdContName = arrSubs[1];}
								if (arrSubs[0] == "ContEmail") {pdContEmail = arrSubs[1];}
								if (arrSubs[0] == "ContWorkNr") {pdContWorkNr = arrSubs[1];}
								if (arrSubs[0] == "ContHomeNr") {pdContHomeNr  = arrSubs[1];}
								if (arrSubs[0] == "ContCellNr") {pdContCellNr = arrSubs[1];}
								if (arrSubs[0] == "ContFaxNr") {pdContFaxNr= arrSubs[1];}
								if (arrSubs[0] == "Addr1") {pdAddr1 = arrSubs[1];}
								if (arrSubs[0] == "Addr2") {pdAddr2 = arrSubs[1];}
								if (arrSubs[0] == "Addr3") {pdAddr3 = arrSubs[1];}
								if (arrSubs[0] == "Addr4") {pdAddr4 = arrSubs[1];}
								if (arrSubs[0] == "Addr5") {pdAddr5 = arrSubs[1];}
								if (arrSubs[0] == "AddrPC") {pdAddrPC = arrSubs[1];}
							}
						}
					}
				} // Cookie not null
			}
			
			function ValidateBDForm(f) {
				if (f.selNrPeople.options[f.selNrPeople.selectedIndex].value < 4 && f.selLocation.options[ f.selLocation.selectedIndex].value == "Skeerpoort") {
					alert ("You may only select River Bear Lodge if you book for 4 people or more.");
					return false;}
				if (!bCookies) {
					alert("You do not have COOKIES enabled in your browser settings.\nSee the cookies link for more detail.");
					return false;
				}
				var sdte = f.strBookDate.value;
				var len = sdte.length;
				if (len > 11) {
					strWeekday = sdte.substring(0,len - 11);
					sDate = sdte.substring(len - 11,len);
					dd = sDate.substring(1,3);
					mm = sDate.substring(4,6);
					yy = sDate.substring(7,11);
					if (bMustBeSat && strWeekday != "Saturday") {
						alert("You are only allowed to select Saturdays if you have less than 4 people in your group.");
						return false;}
				}
				else {alert("Invalid Date format, please use the calendar to select a proper date.");return false;}
				WriteBDFormCookie(f);
				document.location="Booking2.htm";
			}
		function ValidatePDForm(f) {
			var ieR = 0;
			var seR = "";
			if (f.strContName.value.length < 5) {
				ieR = ieR + 1;
				seR = seR + ieR + ") Invalid Contact Person Name.";
			}
			if (f.strContEmail.value.length < 3) {
				ieR = ieR + 1;
				seR = seR + "\n" + ieR + ") Invalid Contact Person Email Address.";
			}
			else {
				if (f.strContEmail.value.indexOf(".") < 3 || f.strContEmail.value.indexOf(".") == -1 || f.strContEmail.value.indexOf("@") < 1 || f.strContEmail.value.indexOf("@") == -1 ) {
					//alert (" EMail " + f.strContEmail.value + " . " + f.strContEmail.value.indexOf(".") + " @ " + f.strContEmail.value.indexOf("@"));
					ieR = ieR + 1;
					seR = seR + "\n" + ieR + ") Invalid Contact Person Email Address.";}
			}
			if (f.strContWorkNr.value.length < 1 && f.strContHomeNr.value.length < 1 && f.strContCellNr.value.length < 1 ) {
				ieR = ieR + 1;
				seR = seR + "\n" + ieR + ") You have to enter at least one contact number.";
			}
			if (f.strAddr1.value.length < 1 || f.strAddr3.value.length < 1 || f.strAddr4.value.length < 1 || f.strAddr5.value.length < 1 ) {
				ieR = ieR + 1;
				seR = seR + "\n" + ieR + ") You have to enter your street address (line 1), City, Province and Country please.";
			}
			var iNrPass = eval(f.NrPass.value) + 1;
			var vN ="";
			var vI ="";
			var vW ="";
			for (var i = 1; i < iNrPass; i++) {
				vN = "strPassName" + i;
				vI = "strPassIDNr" + i;
				vW = "strPassWeight" + i;
				if (eval("f." + vN +".value.length") < 1) {
					ieR = ieR + 1;
					seR = seR + "\n" + ieR + ") Passenger " + i + ": Invalid Name.";
				}
				if (eval("f." + vI +".value.length") < 6) {
					ieR = ieR + 1;
					seR = seR + "\n" + ieR + ") Passenger " + i + ": Invalid ID Number.";
				}
				if (eval("f." + vW +".value.length") < 1) {
					ieR = ieR + 1;
					seR = seR + "\n" + ieR + ") Passenger " + i + ": Invalid Weight.";
				}
			}
			if (ieR > 0) {alert ("You can not continue due to to the following error[s]:\n" +seR);return;}
			//alert ("No error ");
			WritePDFormCookie(f);
			sendform("Bookingcc.htm");
		}
		function GetCCFormCookie(cookPage) {
				var ichar = 0;
				sCookieValue = GetCookie("CardDetail");
				if (sCookieValue != null) {
					var arrCookie = sCookieValue.split("#cc#");
					var i = 0;
					for (i=0; i < arrCookie.length; i++) {
						var arrSubs = arrCookie[i].split("=");
						if (arrSubs.length > 0) {
							if (arrSubs[0] == "CardNr") {ccCardNr = arrSubs[1];}
							if (arrSubs[0] == "Name") {ccName=arrSubs[1];}
							if (arrSubs[0] == "3Digits") {cc3Digits=arrSubs[1];}
							if (arrSubs[0] == "Amount") {ccAmount=arrSubs[1];}
							if (arrSubs[0] == "Budget") {ccBudget = arrSubs[1];}
							if (arrSubs[0] == "ExpDate") {ccExpDate=arrSubs[1];}
							if (arrSubs[0] == "IDNr") {ccIDNr=arrSubs[1];}
							if (arrSubs[0] == "Type") {ccType =arrSubs[1];}
							if (arrSubs[0] == "Bank") {ccBank =arrSubs[1];}
							if (arrSubs[0] == "chkAcceptTrue") {ccAccept = "I Accept the terms and conditions stipulated on the website.";}
							else if(arrSubs[0] == "chkAcceptFalse") {ccAccept = "I DO NOT Accept the terms and conditions stipulated on the website.";}
							if (arrSubs[0] == "chkAgreeTrue") {ccAgree = "I Agree that all information entered is my own and is accurate and current.";}
							else if (arrSubs[0] == "chkAgreeFalse") {ccAgree = "PLEASE NOTE: I DON'T AGREE TO AUTHENTICITY OF THE INFORMATION  FOR THIS BOOKING.";}
						}
					}
				} // Cookie not null
			}
		function WriteCCFormCookie(f) {
				sCookieValue = "";
				sCookieValue = "CardNr=" +ccCardNr + "#cc#";
				sCookieValue = sCookieValue + "Name=" + f.strName.value + "#cc#";
				sCookieValue = sCookieValue + "3Digits=" +cc3Digits + "#cc#";
				sCookieValue = sCookieValue + "Budget=" + f.ccb1.value + f.ccb2.value + "#cc#";
				sCookieValue = sCookieValue + "Amount=" + f.ccr8.value + f.ccr7.value  + f.ccr6.value + f.ccr5.value + f.ccr4.value + f.ccr3.value  + f.ccr2.value + f.ccr1.value + ".00#cc#";
				sCookieValue = sCookieValue + "ExpDate=" + f.cce1.value + f.cce2.value  + f.cce3.value + f.cce4.value + "#cc#";
				sCookieValue = sCookieValue + "IDNr=" + ccIDNr + "#cc#";
				sCookieValue = sCookieValue + "Bank=" +  f.ccBank.value + "#cc#";
				if (f.ccOther.value!="") {sCookieValue = sCookieValue + "Type=" + f.ccOther.value + "#cc#";}
				if (f.ccVisa.value!="") {sCookieValue = sCookieValue + "Type=Visa#cc#";}
				if (f.ccMaster.value!="") {sCookieValue = sCookieValue + "Type=Master#cc#";}
				if (f.ccDiners.value!="") {sCookieValue = sCookieValue + "Type=Diners Club#cc#";}
				if (f.ccMX.value!="") {sCookieValue = sCookieValue + "Type=American Express#cc#";}
				if (f.chkAccept.checked) {sCookieValue = sCookieValue + "chkAcceptTrue=True#cc#";}
				else {sCookieValue = sCookieValue + "chkAcceptFalse=False#cc#";}
				if (f.chkAgree.checked) {sCookieValue = sCookieValue + "chkAgreeTrue=True";}
				else {sCookieValue = sCookieValue + "chkAgreeFalse=False";}
				SetCookie ("CardDetail", sCookieValue);
				//alert (sCookieValue);
			}
		function ValidateCCForm(f) {
				if (hasGotaCopy) {return true;}
				var ValidNr = "0123456789";
				var ValidStr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmopqrstuvwxyz";
				var strTest = "";
				var nrErr = 0;
				var serr = "";
				var i = 0;
				var sCCNr = "";
				strTest = f.strName.value;
				strTest=replaceString(strTest,'_','');
				if (strTest=="") {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Please enter your name.";
				}
				if (f.cc1.value != "" && f.cc2.value != "" && f.cc3.value != "" && f.cc4.value != "" && f.cc5.value != "" && f.cc6.value != "" && f.cc7.value != ""  && f.cc8.value != "") {
					if( f.cc9.value != "" && f.cc10.value != "" && f.cc11.value != "" && f.cc12.value != "" && f.cc13.value != "" && f.cc14.value != "" && f.cc15.value != "" && f.cc16.value != "") {
						sCCNr = f.cc1.value + f.cc2.value + f.cc3.value + f.cc4.value + f.cc5.value + f.cc6.value + f.cc7.value + f.cc8.value
						sCCNr = sCCNr +  f.cc9.value + f.cc10.value + f.cc11.value + f.cc12.value + f.cc13.value + f.cc14.value + f.cc15.value + f.cc16.value
						ccCardNr = sCCNr;
						for (i=0; i < sCCNr.length; i++) {
							var ch = sCCNr.substring(i, i+1);
							var a = ValidNr.indexOf(ch, 0);
							if (a == -1) {
								nrErr = nrErr +1;
								serr = serr + "\n" + nrErr + ") The " + (i + 1) + " digit of the credit card number contains an invalid character. " + ch;					
							}
						}
					}
					else {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Your credit card number is incomplete.";
					}
				}
				else {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Please enter your credit card number.";
				}
				if (f.ccd1.value !="" && f.ccd2.value !="" && f.ccd3.value != "") {
					sCCNr = f.ccd1.value + f.ccd2.value + f.ccd3.value;
					cc3Digits = sCCNr;
					for (i=0; i < sCCNr.length; i++) {
							var ch2 = sCCNr.substring(i, 1);
							var a2 = ValidStr.indexOf(ch2, 0);
							if (a2 == -1) {
								nrErr = nrErr +1;
								serr = serr + "\n" + nrErr + ") The " + (i + 1) + " digit of the 3 digits on the back of your credit card number contains an invalid character.";
							}
						}
				}
				else {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Please enter the last 3 digits at the back of your card.";
				}
				if (f.ccid1.value != "" && f.ccid2.value != "" && f.ccid3.value != "" && f.ccid4.value != "" && f.ccid5.value != "" && f.ccid6.value != "" && f.ccid7.value != ""  && f.ccid8.value != "") {
					if( f.ccid9.value != "" && f.ccid10.value != "" && f.ccid11.value != "" && f.ccid12.value != "" && f.ccid13.value != "") {
						sCCNr = f.ccid1.value + f.ccid2.value + f.ccid3.value + f.ccid4.value + f.ccid5.value + f.ccid6.value + f.ccid7.value + f.ccid8.value
						sCCNr = sCCNr +  f.ccid9.value + f.ccid10.value + f.ccid11.value + f.ccid12.value + f.ccid13.value
						if ( f.ccid14.value != "") {sCCNr = sCCNr +  f.ccid14.value }
						if ( f.ccid15.value != "") {sCCNr = sCCNr +  f.ccid15.value }
						ccIDNr = sCCNr;
						//for (i=0; i < sCCNr.length; i++) {
						//	var ch3 = sCCNr.substring(i, i+1);
						//	var a3 = ValidNr.indexOf(ch3, 0);
						//	if (a3 == -1) {
						//		nrErr = nrErr +1;
						//		serr = serr + "\n" + nrErr + ") The " + (i + 1) + " digit of your identity number contains an invalid character.";
						//	}
						//}
					}
					else {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Your identity number is incomplete.";
					}
				}
				else {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Please enter your identity number.";
				}
				if (f.ccVisa.value == "" && f.ccMaster.value == "" && f.ccMX.value == "" && f.ccDiners.value == "" && f.ccOther.value == "") { 
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") Please select the type of credit card.";		
				}
				if (!f.chkAccept.checked) {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") You will unfortuanately not be able to continue with the booking if you don't agree with the terms and conditions of this site.";
				}
				if (!f.chkAccept.checked) {
					nrErr = nrErr +1;
					serr = serr + "\n" + nrErr + ") You will unfortuanately not be able to continue with the booking if you don't select \n'I agree that all information entered above is my own and is accurate and current.'";
				}
				if (nrErr > 0) {
					alert(serr);
					return false;
				}
				return true;
			}
//-->
