//On mouseover change the background color and menu tip function cOn(td,col){ if ((td.style.backgroundColor != '#dddddd') && (td.style.backgroundColor != 'rgb(221, 221, 221)')) { td.style.backgroundColor=col; } } //On Mouseover change the background color back function cOut(td,col){ if ((td.style.backgroundColor != '#dddddd') && (td.style.backgroundColor != 'rgb(221, 221, 221)')) { td.style.backgroundColor=col; } } function highlightRow(frmObjID, tblObjID, col) { frmObj = document.getElementById(frmObjID); //form tblObj = document.getElementById(tblObjID); //table row clicked curItem = frmObj.curListItem.value; curObj = document.getElementById(curItem); if (tblObj.id != frmObj.curListItem.value) { tblObj.style.backgroundColor=col; curObj.style.backgroundColor="#ffffff"; } } else { tblObj.style.backgroundColor=col; } frmObj.curListItem.value = tblObjID; } function right(e) { var msg = "Sorry, the images on this website are not be used elsewhere!"; if (navigator.appName == 'Netscape' && e.which == 3) { alert(msg); return false; } if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) { alert(msg); return false; } else return true; } function trap() { if(document.images) { for(i=0;i function countDown(strYear,strMonth,strDay) { // define variables var daystogo = 0; //Set to 0 var one_day=1000*60*60*24; //Set 1 day in milliseconds today = new Date(); //Todays Date var nextBVF = new Date(strYear,strMonth - 1,strDay); //Month is 0-11 in JavaScript - 20/6/2004 //Calculate difference btw the two dates, and convert to days daystogo = (Math.ceil((nextBVF.getTime()-today.getTime())/(one_day)) - 1); if (daystogo > 0) { countdown = '   Countdown until BVF!
         ' + daystogo + ' days to go!'; } else { if (daystogo = 0) { countdown = "Showtime!!"; } else { countdown = 'You\'ve missed the Show!
See you next year
'; } } // display result if (document.getElementById) { document.getElementById("cDown").innerHTML = countdown; } else { document.cDown.innerHTML = countdown; } } function validateEmail(new_email) { var at_counter = 0; var alpha_counter = 0; var dot_counter = 0; for (i=0; i= 65 && a <= 90) || (a >= 97 && a <= 122) || (a >= 48) && (a <= 57)) { //Increment alpha counter alpha_counter++; } if (a == 46) { //Increment dot counter dot_counter++; } if (a == 64) { //Increment @ counter at_counter++; } } if ((alpha_counter >= 3) && (at_counter == 1) && (dot_counter >= 1)) { //Returns true to submit return true; } return false; } function checkEmail() { frmObj = document.getElementById('frmMain'); //Define variables var err_msg = ''; //Check name field if (frmObj.name.value == '') { err_msg = "Please enter your name!"; } //Check email field if (err_msg.length == 0) { if (frmObj.custemail.value == '') { err_msg = "Please enter your email address!"; } } //Check comment field if (err_msg.length == 0) { if (frmObj.comment.value == '') { err_msg = "Please enter your enquiry!"; } } //If error message has been generated then alert user. if (err_msg.length != 0) { alert(err_msg); return false; } //Return true if all fields have been completed return true; } function submitEmail() { frmObj = document.getElementById('frmMain'); if (checkEmail()) { frmObj.action = 'mailer.php'; frmObj.submit(); } } function urlJump (destURL) { window.location = destURL; } function submitLogin() { var err = ""; pleaseWait(1); frmObj = document.getElementById('frmMain'); if (err.length == 0) { if ((frmObj.userEmail.value == "") || (frmObj.userEmail.value == "username")) { err = "Please enter your email address!"; } } if (err.length == 0) { if ((frmObj.userPWD.value == "") || (frmObj.userPWD.value == "password")) { err = "Please enter your password!"; } } if (err.length != 0) { alert(err); } else { frmObj = document.getElementById('frmMain'); var urlString = "userEmail=" + frmObj.userEmail.value + "&userPWD=" + frmObj.userPWD.value; xmlHttpPost('process_visitorLogin.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateLogin(self.xmlHttpReq.responseText);'); } } function updateLogin(strResponse) { if (strResponse == 0) { frmObj.action = "bvf.php?pid=visitor&err=" + strResponse; } else { frmObj.action = "bvf.php?pid=ticket_tracker&err=" + strResponse; } frmObj.submit(); } function remindMe() { var err = ""; frmObj = document.getElementById('frmMain'); if (err.length == 0) { if (frmObj.userEmail.value == "") { err = "Please enter the email address you used when you created your account!"; } } if (err.length != 0) { alert(err); } else { frmObj.action = "visitorReminder.php"; frmObj.submit(); } } function user_warn (warnID) { if (warnID == 1) { warning_msg = "You are not permitted to modify or delete images that other members have uploaded!"; } if (warnID == 2) { warning_msg = "Changing the email address for this person means there login will change!"; } alert (warning_msg); } function popUp(img_url, img_caption, win_width, win_height) { if (img_url != '') { if (win_width == '') { var win_width = 600; var win_height = 500; } if (window.screen) { var ah = screen.availHeight - 30; var aw = screen.availWidth - 10; var xc = (aw - win_width) / 2; var yc = (ah - win_height) / 2; } image_popup=window.open("","","width=" + win_width + ", height=" + win_height + ", left=" + xc + ", screenX=" + xc + ", top=" + yc + ", screenY=" + yc + ", menubar=no, status=no, toolbar=no, resizable=yes, scrollbars = yes"); image_popup.document.write(""); image_popup.document.write("No Ideas Image Viewer"); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write(""); image_popup.document.write("
" + img_caption + "
"); image_popup.document.write(""); } else { alert("There is no image available!"); } } function frmAddImage (showID) { frmImage.action = "noideas.php?cid=nim_images_add&showID=" + showID + "&rid=0"; frmImage.submit(); } function frmModImage (showID, modImageID) { frmImage.action = "noideas.php?cid=nim_images_modify&showID=" + showID + "&imgID=" + modImageID + "&rid=0"; frmImage.submit(); } function frmDelImageSubmit (showID, delImageID) { result = confirm('Are you sure you want to delete image #' + delImageID + ' from the list'); if (result == true) { frmImage.action = "nim_images_delete.php?showID=" + showID + "&imgID=" + delImageID; frmImage.submit(); } } function frmChangeShow (showID) { frmImage.action = "noideas.php?cid=nim_images&showID=" + showID + "&rid=0"; frmImage.submit(); } function frmAddImageSubmit (showID) { $err_msg = ''; if ($err_msg.length == 0) { if (frmImage.newImageComment.value == '') { $err_msg = "Please enter your comments for this image!"; } } if ($err_msg.length == 0) { if (frmImage.imagefile.value == '') { $err_msg = "Please select an image!"; } } if ($err_msg.length != 0) { alert($err_msg); } else { frmImage.action = "nim_images_add.php?showID=" + showID; frmImage.submit(); } } function frmModImageSubmit (showID, modImageID) { $err_msg = ''; if ($err_msg.length == 0) { if (frmImage.modShowSelect.value == 'none') { $err_msg = "Please choose a show for your image!"; } } if ($err_msg.length == 0) { if (frmImage.modImageComment.value == 'none') { $err_msg = "Please enter your comments for this image!"; } } if ($err_msg.length != 0) { alert($err_msg); } else { frmImage.action = "nim_images_modify.php?showID=" + showID + "&imgID=" + modImageID; frmImage.submit(); } } function submitWizardType(bType) { pleaseWait(1); var urlString = "retPage=wizard&bType=" + bType; xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } function submitWizard1() { err = ''; pleaseWait(1); frmObj = document.getElementById('frmMain'); if (err.length == 0) { if (frmObj.bookingUserFirstName.value == '') { err = 'Please enter your first name!'; } } if (err.length == 0) { if (frmObj.bookingUserLastName.value == '') { err = 'Please enter your last name!'; } } if (err.length == 0) { if (frmObj.bookingEmail.value == '') { err = 'Please enter your email address!'; } } if (err.length == 0) { if (frmObj.bookingEmail.value != frmObj.bookingConfEmail.value) { err = 'Please check the email addresses you entered as they don\'t match'; } if ((frmObj.bookingEmail.value == frmObj.bookingConfEmail.value) && (frmObj.bookingEmail.value != '')) { if (!validateEmail(frmObj.bookingEmail.value)) { err = 'Please check the email address you entered as it appears to be invalid!'; } } } if (err.length == 0) { if (frmObj.bookingTel.value == '') { err = 'Please enter your contact telephone number!'; } } if (err.length == 0) { if (frmObj.bookingAddress.value == '') { err = 'Please enter the first line of your address!'; } } if (err.length == 0) { if (frmObj.bookingCity.value == '') { err = 'Please enter a City!'; } } if (err.length == 0) { if (frmObj.bookingCounty.value == '') { err = 'Please enter your County!'; } } if (err.length == 0) { if (frmObj.bookingPCode.value == '') { err = 'Please enter your Postcode!'; } } if (err.length == 0) { if (frmObj.bookingVehReg.value == '') { err = 'Please enter your vehicle registration!'; } } if (err.length == 0) { err = validateDate(frmObj.bookingBDay.value); } if (err.length > 0) { pleaseWait(0); alert(err); } else { var urlString = "retPage=wizard1" + "&selTitle=" + frmObj.selTitle.value + "&bookingUserFirstName=" + frmObj.bookingUserFirstName.value + "&bookingUserLastName=" + frmObj.bookingUserLastName.value + "&bookingEmail=" + frmObj.bookingEmail.value + "&bookingTel=" + frmObj.bookingTel.value + "&bookingBDay=" + frmObj.bookingBDay.value + "&bookingHouse=" + frmObj.bookingHouse.value + "&bookingAddress=" + frmObj.bookingAddress.value + "&bookingCity=" + frmObj.bookingCity.value + "&bookingCounty=" + frmObj.bookingCounty.value + "&bookingPCode=" + frmObj.bookingPCode.value + "&selCountry=" + frmObj.selCountry.value + "&bookingVehReg=" + frmObj.bookingVehReg.value; xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } } function submitWizard2() { err = ''; pleaseWait(1); frmObj = document.getElementById('frmMain'); if (err.length == 0) { if (!isInt(frmObj.bookingAdultsTotal.value)) { err = 'Please enter a numeric value for the number of adults attending!'; } } if (err.length == 0) { if (frmObj.bookingAdultsTotal.value == '') { err = 'Please enter the number of adults attending!'; } } if (err.length == 0) { if (frmObj.bookingAdultsTotal.value < 1) { err = 'You must have at least one adult attending!'; } } if (err.length == 0) { if (!isInt(frmObj.bookingChildrenTotal.value)) { err = 'Please enter a numeric value for the number of children attending!'; } } if (err.length == 0) { if (frmObj.bookingChildrenTotal.value == '') { err = 'Please enter the number of children attending!'; } } if (err.length == 0) { if (!isInt(frmObj.bookingCampingUnitsTotal.value)) { err = 'Please enter a numeric value for the number of camping units!'; } } if (err.length == 0) { if (frmObj.bookingCampingUnitsTotal.value == '') { err = 'Please enter the number of camping units!'; } } if (err.length == 0) { if (frmObj.bookingCampingUnitsTotal.value < 1) { err = 'You must have at least 1 camping unit!'; } } if (err.length > 0) { pleaseWait(0); alert(err); } else { var urlString = "retPage=wizard2" + "&selNights=" + frmObj.selNights.value + "&bookingAdultsTotal=" + frmObj.bookingAdultsTotal.value + "&bookingChildrenTotal=" + frmObj.bookingChildrenTotal.value + "&bookingCampingUnitsTotal=" + frmObj.bookingCampingUnitsTotal.value + "&bookingTotal=" + frmObj.bookingTotal.value; xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } } function submitWizard3(step) { err = ""; urlString = "retPage=wizard" + step; pleaseWait(1); urlString += "&bookingTotalAdults=" + document.getElementById('bookingTotalAdults').value; for (i=1; i <= document.getElementById('bookingTotalAdults').value; i++) { if (err.length == 0) { if (document.getElementById('bookingAdult' + i).value == '') { err = 'Please enter a name for Adult ' + i + '!'; break; } urlString += "&bookingAdult" + i + "=" + document.getElementById('bookingAdult' + i).value; } } urlString += "&bookingTotalChildren=" + document.getElementById('bookingTotalChildren').value; for (i=1; i <= document.getElementById('bookingTotalChildren').value; i++) { if (err.length == 0) { if (document.getElementById('bookingChild' + i).value == '') { err = 'Please enter a name for Child ' + i + '!'; break; } urlString += "&bookingChild" + i + "=" + document.getElementById('bookingChild' + i).value; } } if (err.length > 0) { pleaseWait(0); alert(err); } else { xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } } function submitWizard4() { err = ""; clubWebLink = "N"; pleaseWait(1); frmObj = document.getElementById('frmMain'); if (frmObj.bookingClubName) { if (err.length == 0) { if (frmObj.bookingClubName.value == "") { err = 'Please enter the name of your club!'; } } if (err.length == 0) { if (frmObj.bookingClubWebsite.value == "") { result = confirm("By not adding your website details you'll be missing out on advertising your club to potential members!\n\nClick OK to continue or CANCEL to add your website details."); if (result == 0) { pleaseWait(0); return false; } } } if (err.length == 0) { if (frmObj.bookingClubWebLink.checked == false && frmObj.bookingClubWebsite.value != "") { result = confirm("To allow BVF to show your website link on our website you need to have ticked the box\n\nClick OK to continue or CANCEL to tick the allow website link."); if (result == 0) { pleaseWait(0); return false; } } else { clubWebLink = "Y"; } } var urlString = "retPage=wizard5" + "&bookingClubName=" + frmObj.bookingClubName.value + "&bookingClubWebsite=" + frmObj.bookingClubWebsite.value + "&bookingClubWebLink=" + clubWebLink; } else { if (err.length == 0) { if (frmObj.selClubID.value == -1) { err = "Please select a club name from the list!"; } } var urlString = "retPage=wizard5" + "&bookingSelClubID=" + frmObj.selClubID.value; } if (err.length > 0) { pleaseWait(0); alert(err); } else { xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } } function submitWizardBack(step) { var urlString = "retPage=wizard" + step; xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } function submitToPayPal(url) { err = ""; frmObj = document.getElementById('frmMain'); if (frmObj.agreeTerms.checked == false) { err = 'To purchase tickets for the British Volkswagen Festival\nyou must agree to abide by the BVF Rules & Regulations.\n\nPlease tick the box to proceed.'; } if (err.length == 0) { frmObj.action = url; frmObj.submit(); } else { alert(err); document.getElementById('agreeTermsDiv').className = "message"; } } function kickStartWizard(showYear,startNew) { pleaseWait(1); frmObj = document.getElementById('frmMain'); var urlString = "retPage=whichWizard"; if (startNew == 'Y') { urlString += "&startNew=yes"; } if (frmObj.wizardPrev.value != -1) { result = confirm('You have already created a booking for BVF ' + showYear + '!\n\nTo open, edit and/or pay for this booking click OK\n\nor CANCEL to continue creating a new booking.'); if (result) { urlString = "retPage=wizardEdit&rID=" + frmObj.wizardPrev.value; } else { urlString += "&startNew=yes"; } } urlString += "&step=" + frmObj.wizardStep.value + "&err=" + frmObj.wizardErr.value; xmlHttpPost('process_Wizard.php', urlString,'','pleaseWait(0); alert(\'There was a problem connecting to the server!\');','pleaseWait(0); updateWizard(self.xmlHttpReq.responseText);'); } function updateWizard(strResponse) { document.getElementById('wizardContent').innerHTML = strResponse; } function updateTotal(field) { err = ''; fieldVal = 1; units = -1; frmObj = document.getElementById('frmMain'); adults = parseInt(frmObj.bookingAdultsTotal.value); children = parseInt(frmObj.bookingChildrenTotal.value); if (eval(frmObj.bookingCampingUnitsTotal) != null && eval(frmObj.bookingCampingUnitsTotal) != undefined) { units = parseInt(frmObj.bookingCampingUnitsTotal.value); } nights = parseInt(frmObj.selNights.value); if (field.id == 'bookingChildrenTotal') { fieldVal = 0; } if (units != -1) { if ((adults < 1) || (units < 1)) { field.value = fieldVal; err = "You must have at least 1 adult attending and 1 camping unit!"; } } else { if (adults < 1) { field.value = fieldVal; err = "You must have at least 1 adult attending!"; } } if ((!isInt(adults)) || (!isInt(children)) || (!isInt(units))) { field.value = fieldVal; err = "Please enter a numeric value"; } total = (frmObj.awpVal.value * adults) + ((frmObj.cpuVal.value * units) * nights); frmObj.bookingTotal.value = "£ " + total.toFixed(2); if (err.length > 0) { alert(err); } } function validateDate(frmDate) { var regExPattern = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/; var err = ''; if ((!frmDate.match(regExPattern)) && (frmDate != '')) { err = 'Date is incorrect or invalid. Please enter your date in dd/mm/yyyy format!'; } return err; } function isInt(val) { var checkVal = parseInt(val); if (isNaN(checkVal)) { return false; } return true; } function openPrintIt(bookingID) { bookingWin = window.open("bvf_printable_form.php?bID=" + bookingID,"","menubar=no, status=no, toolbar=no, resizable=no, scrollbars=yes, width=700, height=550"); } function enableButtons() { frmObj = document.getElementById('frmMain'); if (frmObj.butOpen) { frmObj.butOpen.disabled = false; } } function f_clientWidth() { return f_filterResults ( window.innerWidth ? window.innerWidth : 0, document.documentElement ? document.documentElement.clientWidth : 0, document.body ? document.body.clientWidth : 0 ); } function f_clientHeight() { return f_filterResults ( window.innerHeight ? window.innerHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.body ? document.body.clientHeight : 0 ); } function f_scrollLeft() { return f_filterResults ( window.pageXOffset ? window.pageXOffset : 0, document.documentElement ? document.documentElement.scrollLeft : 0, document.body ? document.body.scrollLeft : 0 ); } function f_scrollTop() { return f_filterResults ( window.pageYOffset ? window.pageYOffset : 0, document.documentElement ? document.documentElement.scrollTop : 0, document.body ? document.body.scrollTop : 0 ); } function f_filterResults(n_win, n_docel, n_body) { var n_result = n_win ? n_win : 0; if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel; return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; } function pleaseWait(intState) { if (intState == 1) { var intTop = (f_clientHeight() - 200)/2; var intLeft = (f_clientWidth() - 200) /2; document.getElementById('pleaseWait').style.top = intTop + 'px'; document.getElementById('pleaseWait').style.left = intLeft + 'px'; document.getElementById('pleaseWait').className = 'showObj'; } else { setTimeout("document.getElementById('pleaseWait').className = 'hiddenObj'",500); } }