nv_home_off=new Image(); nv_home_off.src="images/nv_home.gif" nv_home_on=new Image(); nv_home_on.src="images/nv_home_over.gif" nv_myjoiners_off=new Image(); nv_myjoiners_off.src="images/nv_myjoiners.gif" nv_myjoiners_on=new Image(); nv_myjoiners_on.src="images/nv_myjoiners_over.gif" nv_gigs_off=new Image(); nv_gigs_off.src="images/nv_gigs.gif" nv_gigs_on=new Image(); nv_gigs_on.src="images/nv_gigs_over.gif" nv_gallery_off=new Image(); nv_gallery_off.src="images/nv_gallery.gif" nv_gallery_on=new Image(); nv_gallery_on.src="images/nv_gallery_over.gif" nv_forum_off=new Image(); nv_forum_off.src="images/nv_forum.gif" nv_forum_on=new Image(); nv_forum_on.src="images/nv_forum_over.gif" nv_directory_off=new Image(); nv_directory_off.src="images/nv_directory.gif" nv_directory_on=new Image(); nv_directory_on.src="images/nv_directory_over.gif" nv_info_off=new Image(); nv_info_off.src="images/nv_info.gif" nv_info_on=new Image(); nv_info_on.src="images/nv_info_over.gif" nv_contact_off=new Image(); nv_contact_off.src="images/nv_contact.gif" nv_contact_on=new Image(); nv_contact_on.src="images/nv_contact_over.gif" nv_login_off=new Image(); nv_login_off.src="images/nv_login.gif" nv_login_on=new Image(); nv_login_on.src="images/nv_login_over.gif" nv_logout_off=new Image(); nv_logout_off.src="images/nv_logout.gif" nv_logout_on=new Image(); nv_logout_on.src="images/nv_logout_over.gif" function displayExternalMedia(path, print) { var imgwin = window.open("media_viewer.asp?type=external&path="+path+"&print="+print, "", "resizable=1,scrollbars=1,top=0,left=0,height=400,width=400"); } function displayMediafile(id) { var imgwin = window.open("media_viewer.asp?type=internal&id=" + id, "", "resizable=1,scrollbars=1,top=0,left=0,height=400,width=400"); } function confirmCmd(cmd) { ret = false if (cmd == 'DELETE') { ret = confirm('Are you sure you want to delete this?') } return ret } function submitDetails(frm) { if (validateFrm(frm)) { frm.submit() } } function validateFrm(frm) { var ret = false var errMsg = 'Error! ' if (frm.username.value == '') { errMsg += 'Username blank. ' } else if ((frm.username.value.indexOf(' ') != -1) || (frm.username.value.indexOf('.') != -1) || (frm.username.value.indexOf('&') != -1) || (frm.username.value.indexOf(';') != -1) || (frm.username.value.indexOf(':') != -1) || (frm.username.value.indexOf('\'') != -1)) { errMsg += 'Username must not contain spaces, full stops, apostrophes, ampersands, colons or semi-colons. ' } else if (frm.password.value == '') { errMsg += 'Password blank' } else if (frm.password.value != frm.passwordconfirm.value) { errMsg += 'Passwords don\'t match.' } else if ((frm.password.value.indexOf('.') != -1) || (frm.password.value.indexOf('&') != -1) || (frm.password.value.indexOf(' ') != -1)) { errMsg += 'Password must not contain full stops, ampersands or spaces. ' } else if ((frm.email.value.indexOf('@') == -1) || (frm.email.value.indexOf('.') == -1)) { errMsg += 'That is not a valid email address. ' } else if (frm.email.value != frm.emailconfirm.value) { errMsg += 'Please ensure your email is written exactly the same in both email boxes.' } else if (!frm.terms.checked) { errMsg += 'You have not ticked the box saying that you have read and understood our terms and conditions. ' } else ret = true if (!ret) { alert(errMsg) } return ret } function deleteMedia(media_id) { document.delet.mediafile_id.value = media_id document.delet.submit() } function removeBan(band_id) { document.editor.band_id.value = band_id document.editor.submit() } function removePermission(username) { document.editor.username.value = username document.editor.permission.value = '0' document.editor.submit() } function removeSub(id) { document.editor.subcmd.value = 'REMOVE_SUB' document.editor.sub_id.value = id document.editor.submit() } function removeFeaturedGig(id) { document.editor.cmd.value = 'REMOVE_FEATUREDGIG' document.editor.id.value = id document.editor.submit() } function removeFeaturedBand(id) { document.editor.cmd.value = 'REMOVE_FEATUREDBAND' document.editor.id.value = id document.editor.submit() } function addMedia() { var frm = document.editor if (frm.add_title.value == '' || frm.add_mediaurl.value == ''){ alert('You must enter a media title and a media url to add a media link to your band page.') } else { document.editor.subcmd.value = 'ADD_SUB' document.editor.submit() } } function addSub() { document.editor.subcmd.value = 'ADD_SUB' document.editor.submit() } function removeGigAlert(id) { document.editor.cmd.value = 'REMOVE_GIGALERT' document.editor.alert_id.value = id document.editor.submit() } function removeBandAlert(id) { document.editor.cmd.value = 'REMOVE_BANDALERT' document.editor.alert_id.value = id document.editor.submit() } function removeVenueAlert(id) { document.editor.cmd.value = 'REMOVE_VENUEALERT' document.editor.alert_id.value = id document.editor.submit() } function removePromoterAlert(id) { document.editor.cmd.value = 'REMOVE_PROMOTERALERT' document.editor.alert_id.value = id document.editor.submit() } function ShowProgress(barref) { strAppVersion = navigator.appVersion; if (document.upload.file1.value != "") { if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { if( strAppVersion.indexOf("Macintosh") != -1 && strAppVersion.charAt(0) >= 3 ) { window.open(barref + '&b=NN','','width=370,height=115', true); } else { winstyle = "dialogWidth=385px; dialogHeight:140px; center:yes"; window.showModelessDialog(barref + '&b=IE',null,winstyle); } } else { window.open(barref + '&b=NN','','width=370,height=75', true); } } return true; } function validateThumb(val) { ret = false ext = val.substr(val.length - 4) if (val == '') { alert('Please enter a file name.') } else if (ext != '.jpg') { alert('File names must be jpg format.') } else ret = true return ret } function validateBand() { ret = false var frm = document.editor if (frm.title.value == '') { alert('Please enter a title.') } else ret = true return ret } /** * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/) */ // Declaring valid date character, minimum year and maximum year var dtCh= '/'; var minYear=1900; var maxYear=2100; function isInteger(s){ var i; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (((c < '0') || (c > '9'))) return false; } return true; } function stripCharsInBag(s, bag){ var i; var returnString = ''; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year){ return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function isDate(dtStr){ var ret = '' var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strDay=dtStr.substring(0,pos1) var strMonth=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=='0' && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=='0' && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=='0' && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ ret = 'The date format should be : dd/mm/yyyy' } if (strMonth.length<1 || month<1 || month>12){ ret = 'Please enter a valid month. ' } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ ret = 'Please enter a valid day. ' } if (strYear.length != 4 || year==0 || yearmaxYear){ ret = 'Please enter a valid 4 digit year between '+minYear+' and '+maxYear } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ ret = 'Please enter a valid date. The date format should be : dd/mm/yyyy' } return ret } function validateGig(frm){ var errMsg = '' var ret = false var dt=frm.gigdate var dateresult = isDate(dt.value) if (dateresult != '') { dt.focus() errMsg += dateresult } else if ((isNaN(frm.costdoor.value)) || (frm.costadv.value == '')) { errMsg += 'Please enter a valid Ticket Price (adv). ' } else if ((isNaN(frm.costdoor.value)) || (frm.costdoor.value == '')) { errMsg += 'Please enter a valid Ticket Price (on door). ' } else if ((frm.online.checked) && (isNaN(frm.onlinequota.value) || frm.onlinequota.value == '')) { errMsg += 'When online ticket selling is enabled, you must enter a value for the Online Ticket Quota. ' } else if ((isNaN(frm.agelimit.value)) || (frm.agelimit.value == '')) { errMsg += 'Please enter a valid Age Limit. ' } else if ((parseInt(frm.gigdateH.value) > 24) || (parseInt(frm.gigdateN.value > 60))) { errMsg += 'Please enter a valid door time. ' } else if (frm.ticketoutlet_id.options.selectedIndex == -1) { errMsg += 'You must select at least one ticket outlet from the list.' } else ret = true if (ret==false) { alert(errMsg) } else { var sel = frm.band_id for (i=0; i=0; i--) { if (sel.options[i].selected) { document.editor.deletelist.value += sel.options[i].value + ', ' sel.remove(i); } } } function shiftBand(direction) { var sel = document.editor.band_id if (direction == 'up') { moveOptionUp(sel) } else { moveOptionDown(sel) } } function hasOptions(obj) { if (obj!=null && obj.options!=null) { return true; } return false; } function swapOptions(obj,i,j) { var o = obj.options var i_selected = o[i].selected var j_selected = o[j].selected var tmp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected) var tmp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected) o[i] = tmp2 o[j] = tmp o[i].selected = j_selected o[j].selected = i_selected } function moveOptionDown(obj) { if (!hasOptions(obj)) { return; } for (i=obj.options.length-1; i>=0; i--) { if (obj.options[i].selected) { if (i != (obj.options.length-1) && ! obj.options[i+1].selected) { swapOptions(obj,i,i+1); obj.options[i+1].selected = true; } } } } function moveOptionUp(obj) { if (!hasOptions(obj)) { return; } for (i=0; i