// JScript source code
/**
 * SWFObject v1.4.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){return q.substring(q.indexOf("=",_2d)+1,_2e);}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2f=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2f.length;i++){
for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=null;}}}};
if(typeof window.onunload=="function"){
var oldunload=window.onunload;
window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){
Array.prototype.push=function(_32){
this[this.length]=_32;
return this.length;};}

var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for backwards compatibility
var SWFObject = deconcept.SWFObject;

// JQUERY - FOR ALL PAGES
$(document).ready(function() {
	$("a.zoom").fancybox();
		
	$("a.videoplayer").fancybox({
		'frameWidth': 680,
	    'frameHeight': 546,
	    'padding':0
	});
	
	$("a.emailsignup").fancybox({
		'frameWidth': 450,
	    'frameHeight': 300,
	    'padding':0
	});
	
	$("a.justgiving").fancybox({
		'frameWidth': 150,
	    'frameHeight': 230,
	    'padding':0
	});
	
	$("a.exhibitorform").fancybox({
		'frameWidth': 450,
	    'frameHeight': 300,
	    'padding':0
	});
	
	$("a.awardapply").fancybox({
		'frameWidth': 450,
	    'frameHeight': 360,
	    'padding':0
	});
	
	$("a.applysponsor").fancybox({
		'frameWidth': 450,
	    'frameHeight': 360,
	    'padding':0
	});
});

// JS Functions
function addLoadEvent(func) {	
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;		
	} 
	else {
		window.onload = function() {
		oldonload();
		func();
		}
	}
}

function emailCloak() {		
	if (document.getElementById) {
		var alltags = document.all? document.all : document.getElementsByTagName("*");
		for (i=0; i < alltags.length; i++) {
			if (alltags[i].className == "emailCloak") {
			var oldText = alltags[i].firstChild;
			var emailAddress = alltags[i].firstChild.nodeValue;
			var user = emailAddress.substring(0, emailAddress.indexOf("("));
			var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length);
			var newText = user+"@"+website;
			var a = document.createElement("a");
			a.href = "mailto:"+newText;
			var address = document.createTextNode(newText);
			a.appendChild(address);
			alltags[i].replaceChild(a,oldText);
			}
		}
	}	
}
addLoadEvent(emailCloak);

// JScript source code
// Date Validation
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to 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){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    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 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){
		//alert("The date format should be : dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){		
		return false;
	}
	else{
		return true;
	}
}

function checkPostCode (toCheck) {

  // Permitted letters depend upon their position in the postcode.
  var alpha1 = "[abcdefghijklmnoprstuwyz]";                       // Character 1
  var alpha2 = "[abcdefghklmnopqrstuvwxy]";                       // Character 2
  var alpha3 = "[abcdefghjkstuw]";                                // Character 3
  var alpha4 = "[abehmnprvwxy]";                                  // Character 4
  var alpha5 = "[abdefghjlnpqrstuwxyz]";                          // Character 5
  
  // Array holds the regular expressions for the valid postcodes
  var pcexp = new Array ();

  // Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA
  pcexp.push (new RegExp ("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1,2})(\\s*)([0-9]{1}" + alpha5 + "{2})$","i"));
  
  // Expression for postcodes: ANA NAA
  pcexp.push (new RegExp ("^(" + alpha1 + "{1}[0-9]{1}" + alpha3 + "{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$","i"));

  // Expression for postcodes: AANA  NAA
  pcexp.push (new RegExp ("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1}" + alpha4 +"{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$","i"));
  
  // Exception for the special postcode GIR 0AA
  pcexp.push (/^(GIR)(\s*)(0AA)$/i);
  
  // Standard BFPO numbers
  pcexp.push (/^(bfpo)(\s*)([0-9]{1,4})$/i);
  
  // c/o BFPO numbers
  pcexp.push (/^(bfpo)(\s*)(c\/o\s*[0-9]{1,3})$/i);
  
  // Overseas Territories
  pcexp.push (/^([A-Z]{4})(\s*)(1ZZ)$/i);

  // Load up the string to check
  var postCode = toCheck;

  // Assume we're not going to find a valid postcode
  var valid = false;
  
  // Check the string against the types of post codes
  for ( var i=0; i<pcexp.length; i++) {
    if (pcexp[i].test(postCode)) {
    
      // The post code is valid - split the post code into component parts
      pcexp[i].exec(postCode);
      
      // Copy it back into the original string, converting it to uppercase and
      // inserting a space between the inward and outward codes
      postCode = RegExp.$1.toUpperCase() + " " + RegExp.$3.toUpperCase();
      
      // If it is a BFPO c/o type postcode, tidy up the "c/o" part
      postCode = postCode.replace (/C\/O\s*/,"c/o ");
      
      // Load new postcode back into the form element
      valid = true;
      
      // Remember that we have found that the code is valid and break from loop
      break;
    }
  }
  
  // Return with either the reformatted valid postcode or the original invalid 
  // postcode
  if (valid) {return postCode;} else return false;
}

function isValidEmail(sEmail) {
    var sQtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
    var sDtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';
    var sAtom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+';
    var sQuotedPair = '\\x5c[\\x00-\\x7f]';
    var sDomainLiteral = '\\x5b(' + sDtext + '|' + sQuotedPair + ')*\\x5d';
    var sQuotedString = '\\x22(' + sQtext + '|' + sQuotedPair + ')*\\x22';
    var sDomain_ref = sAtom;
    var sSubDomain = '(' + sDomain_ref + '|' + sDomainLiteral + ')';
    var sWord = '(' + sAtom + '|' + sQuotedString + ')';
    var sDomain = sSubDomain + '(\\x2e' + sSubDomain + ')*';
    var sLocalPart = sWord + '(\\x2e' + sWord + ')*';
    var sAddrSpec = sLocalPart + '\\x40' + sDomain; // complete RFC822 email address spec
    var sValidEmail = '^' + sAddrSpec + '$'; // as whole string
 
    var reValidEmail = new RegExp(sValidEmail);
 
    if (reValidEmail.test(sEmail)) {
        return true;
    } 
    return false;
}


function checkquicklogin(){
	var ftxt = '';
	
	if (document.quicklogin.Username.value==''){
		ftxt += '\n- Please enter your Username.';
	}
	
	if (document.quicklogin.Password.value==''){
		ftxt += '\n- Please enter your Password.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

/* Directory */
function checkdirectoryform(){
    if (document.directoryform.SectorID.value==''&&document.directoryform.Company.value==''&&document.directoryform.Keywords.value==''){
        alert('Please select a Sector or Enter your Keywords.');
        return false;
    }
    else {
        return true;
    }
}

function closeExtended(){
    document.getElementById("sextended").style.display='none';
}

function openExtended(){
    document.getElementById("sextended").style.display='block';
}

function PrintMemberInfo() 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,scrollbars=yes,width=750,height=600,left=100,top=25";    
   var winprint=window.open('PrintPage.asp?ID=searchpanel','Print',sOption);  
   winprint.focus(); 
}

function checkdirectorylogin(){
    var ftxt = '';
    
    if (document.memberlogin.Username.value==''||document.memberlogin.Username.value=='Username'){
        ftxt += '\n- Please enter your Username.';
    }
    
    if (document.memberlogin.Password.value==''||document.memberlogin.Password.value=='Password'){
        ftxt += '\n- Please enter your Password.';
    }
    
    if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}

/* Email Signup */
function checkemailsignup(){
    var ftxt = '';
    
    if (isValidEmail(document.emailsignup.Email.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.emailsignup.FirstName.value==''){
        ftxt += '\n- Please enter your First Name.';
    }
    
    if (document.emailsignup.LastName.value==''){
        ftxt += '\n- Please enter your Last Name.';
    }
    
    /*
    if (document.emailsignup.Company.value==''){
        ftxt += '\n- Please enter your Company Name.';
    }    
    
    if (document.emailsignup.Postcode.value==''){
        ftxt += '\n- Please enter your Postcode.';
    }
    
    if (document.emailsignup.GenderID.value==''){
        ftxt += '\n- Please select your Gender.';
    }
    */
    
    if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

/* Events Basket - Checkout */
function checkbookevents(){
    if (confirm('Are you sure you want to book the selected events?')){
        location.href='events_checkout.asp';
    }
}

function checkremoveevent(submitstring){
    if (confirm('Are you sure you want to remove this event?')){
        location.href=submitstring;
    }
}

/* Diary */
function checkcancelevent(submitstring){
    if (confirm('Are you sure you want to cancel your attendance to this event?')){
        location.href=submitstring;
    }
}

/* Members Area */
function checkmainlogin(){
    var ftxt = '';
    
    if (document.loginform.Username.value==''){
        ftxt += '\n- Please enter your Username.';
    }
    
    if (document.loginform.Password.value==''){
        ftxt += '\n- Please enter your Password.';
    }
    
    if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function checkregisterform(){
    var ftxt = '';
    
    if (document.registerform.FirstName.value==''||document.registerform.FirstName.value.length<2){
        ftxt += '\n- Please enter your First Name.';
    }
    
    if (document.registerform.LastName.value==''||document.registerform.LastName.value.length<2){
        ftxt += '\n- Please enter your Last Name.';
    }
    
    if (document.registerform.JobTitle.value==''||document.registerform.JobTitle.value.length<2){
        ftxt += '\n- Please enter your Job Title.';
    }
    
    if (document.registerform.Company.value==''||document.registerform.Company.value.length<2){
        ftxt += '\n- Please enter your Company.';
    }
    
    if (isValidEmail(document.registerform.EmailAddress.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.registerform.TelephoneNumber.value==''||document.registerform.TelephoneNumber.value.length<2){
        ftxt += '\n- Please enter your Telephone Number.';
    }
    
    if (document.registerform.GenderID.value==''){
        ftxt += '\n- Please select your Gender.';
    }
    
    if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function checkforgottenform(){
    if (isValidEmail(document.forgottenform.EmailAddress.value)==false){
        alert('Please enter your Email Address.');
        return false;
    }
    else { 
        return true;
    }
}

/* Member Area */
function confirmlogout(){
    if (confirm('Are you sure you want to logout?')){
        location.href='member_area.asp?Logout=True';
    }
}

function checkvoucherform(){
    var vcount = document.voucherform.VoucherCount.value;
    
    var bsel = false;
    if (vcount>1){        
        for (var i=0;i<vcount;i++){
            if (document.voucherform.VoucherID[i].checked==true){
                bsel = true;
            }
        }
    }
    else {
        if (document.voucherform.VoucherID.checked==true){
            bsel = true;
        }
    }
    
    if (bsel==false){
        alert('Please select a Voucher Pack to purchase.');
        return false;
    }
    else {
        if (confirm('Are you sure you wish to purchase the selected voucher pack?')){
            return true;
        }        
        else {
            return false;
        }
    }
}

function checkupdateform(){ 
    var ftxt = '';
    
    if (document.updateform.FirstName.value==''){
        ftxt += '\n- Please enter your First Name.';
    }
    
    if (document.updateform.LastName.value==''){
        ftxt += '\n- Please enter your Last Name.';
    }
    
    if (document.updateform.JobTitle.value==''){
        ftxt += '\n- Please enter your Job Title.';
    }
    
    if (document.updateform.Company.value==''){
        ftxt += '\n- Please enter your Company.';
    }
    
    if (isValidEmail(document.updateform.EmailAddress.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.updateform.TelephoneNumber.value==''){
        ftxt += '\n- Please enter your Telephone Number.';
    }
    
    if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

/* Membership */
function checksuccessupdateform(){
    var ftxt = '';
    
    if (document.updateform.FirstName.value==''){
        ftxt += '\n- Please enter your First Name.';
    }
    
    if (document.updateform.LastName.value==''){
        ftxt += '\n- Please enter your LastName.';
    }
    
    if (document.updateform.JobTitle.value==''){
        ftxt += '\n- Please enter a Job Title.';
    }
    
    var bcategory = false;
    for (var i=0;i<document.updateform.SectionCount.value;i++){
        if (document.updateform.SectorID[i].checked==true){
            bcategory = true;
        }
    }
    if (bcategory==false){
        ftxt += '\n- Please select at least one Occupational Category.';
    }
    
    if (document.updateform.Address1.value==''){
        ftxt += '\n- Please enter your Business Address 1.';
    }
    
    if (document.updateform.City.value==''){
        ftxt += '\n- Please enter your City.';
    }
    
    if (document.updateform.County.value==''){
        ftxt += '\n- Please enter your County.';
    }
    
    if (document.updateform.PostCode.value==''){
        ftxt += '\n- Please enter your Postcode.';
    }
    
    if (isValidEmail(document.updateform.EmailAddress.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.updateform.TelephoneNumber.value==''){
        ftxt += '\n- Please enter your Direct Line/Mobile Number.';
    }
    
    /*
    if (document.updateform.DirQualifications.value==''){
        ftxt += '\n- Please enter your Professional Qualifications.';
    }
    
    if (document.updateform.DirSpecialistIn.value==''){
        ftxt += '\n- Please enter your Specialist Experience.';
    }
    
    if (document.updateform.DirCareerOutlook.value==''){
        ftxt += '\n- Please enter your Career Outlook.';
    }   
     
    if (document.updateform.DirCompanyInformation.value==''){
        ftxt += '\n- Please enter your Company Information.';
    }
    */
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

function confirmMembershipUpgrade(submitstring,vouchertotal){
    if (confirm('Are you sure you want to upgrade your membership? This will cost you a total of ' + vouchertotal + ' SucceSS vouchers.')){
        location.href=submitstring;
    }
}

function confirmDirectoryUpgrade(submitstring,vouchertotal){
    if (confirm('Are you sure you want to upgrade your directory type? This will cost you a total of ' + vouchertotal + ' SucceSS vouchers.')){
        location.href=submitstring;
    }
}

function confirmDownloadDelete(submitstring){
    if (confirm('Are you sure you want to delete this download?')){
        location.href=submitstring;
    }
}

function confirmLinkDelete(submitstring){
    if (confirm('Are you sure you want to delete this link?')){
        location.href=submitstring;
    }
}

function textCounter(field,cntfield,maxlimit) {
    if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
    cntfield.value = maxlimit - field.value.length;
}

function confirmDeleteLogo(submitstring){
    if (confirm('Are you sure you want to delete this logo from your profile?')){
        location.href=submitstring;
    }
}

function confirmDeletePhoto(submitstring){
    if (confirm('Are you sure you want to delete this photo from your profile?')){
        location.href=submitstring;
    }
}

/* Question Form */
function checkquestionform(){
    var ftxt = '';
    var usermode = document.postquestion.UserForm.value;

    if (usermode=='False'){
        if (document.postquestion.Name.value==''){
            ftxt += '\n- Please enter your Name.';
        }
        
        if (isValidEmail(document.postquestion.Email.value)==false){
            ftxt += '\n- Please enter your Email Address.';
        }
    }
        
    if (document.postquestion.Question.value==''){
        ftxt += '\n- Please enter a Question / Requirement.';
    }
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

/* Upgrade Form */
function checkupgradeform(){
    if (confirm('Are you sure your details are correct and that you wish to upgrade your membership?')){
        return true;
    }
    else {
        return false;
    }
}

/* Event Checkout */
function checkbookonline(){
    return true;
}

/* Highlight Nav */
function highlightNav(theId){
    var thecounter = document.getElementById("EventCount").value;
    
    for (var i=0;i<thecounter;i++){
        //alert(i);
        document.getElementById("leftnav" + i).setAttribute("class", "notcurrent");;
    }
        
    var thesel = document.getElementById(theId);
    
    //thesel.style.className='current';   
    //thesel.style.background='#CCFFCC';
    thesel.setAttribute("class", "current");    
}

/* Exhibitor Interest Form */
function checkexhibitorform(){
    var ftxt = '';
    
    if (document.exhibitorform.Name.value==''){
        ftxt += '\n- Please enter your Name.';
    }
    
    if (isValidEmail(document.exhibitorform.Email.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.exhibitorform.Company.value==''){
        ftxt += '\n- Please enter your Company Name.';
    }
    
    if (document.exhibitorform.Telephone.value==''){
        ftxt += '\n- Please enter your Telephone Number.';
    }
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

/* Awards Apply */
function checkawardapplyform(){
    var ftxt = '';
    
    if (document.awardapplyform.Name.value==''){
        ftxt += '\n- Please enter your Name.';
    }
    
    if (isValidEmail(document.awardapplyform.Email.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.awardapplyform.Company.value==''){
        ftxt += '\n- Please enter your Company Name.';
    }
    
    if (document.awardapplyform.Telephone.value==''){
        ftxt += '\n- Please enter your Telephone Number.';
    }
    
    /*
    if (document.awardapplyform.WhySwitchedOn.value==''){
        ftxt += '\n- Please why you are switched-on.';
    }
    */
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

/* Awards Sponsor */
function checksponsorapplyform(){
    var ftxt = '';
    
    if (document.awardapplyform.Name.value==''){
        ftxt += '\n- Please enter your Name.';
    }
    
    if (isValidEmail(document.awardapplyform.Email.value)==false){
        ftxt += '\n- Please enter your Email Address.';
    }
    
    if (document.awardapplyform.Company.value==''){
        ftxt += '\n- Please enter your Company Name.';
    }
    
    if (document.awardapplyform.Telephone.value==''){
        ftxt += '\n- Please enter your Telephone Number.';
    }
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

/* Award Places */
var counter = 0;
function displayAwardPlaces(theVal){
    var bookingcost = document.awardbooking.BookingCost.value;
        
    // Fields
    var personfields = document.getElementById("personfields");    
    var bookingtotal = document.getElementById("bookingtotal");
    
    if (theVal>0){   
	    var newFields = document.getElementById('readroot').cloneNode(true);
	    newFields.id = '';
	    newFields.style.display = 'block';
	    var newField = newFields.childNodes;
        
        for (var loopi=0;loopi<theVal-1;loopi++){
            if ((theVal-1)>counter){            
                counter++;
                
	            var newFields = document.getElementById('readroot').cloneNode(true);
                newFields.id = '';
                newFields.style.display = 'block';
    	        
    	        /*
    	        var newField = newFields.childNodes;
                for (var i=0;i<newField.length;i++) {
	                var theName = newField[i].name
	                if (theName)
		                newField[i].name = theName + counter;
                }
                */    	        
    	        
	            var insertHere = document.getElementById('writeroot');
                insertHere.parentNode.insertBefore(newFields,insertHere);        
            }
            else {
                var removecount = (counter-(theVal-1))
                if (removecount>0){
                    //alert(removecount);
                    for (var irem=0;irem<removecount;irem++){  
                        //alert('Remove Item ' + irem);
                        //this.parentNode.parentNode.removeChild(this.parentNode);
                    }
                    counter-=removecount;
                }
            }    
        }
        
        // Work out total    
        bookingtotal.innerHTML = '£'+ (parseInt(bookingcost)*theVal).toFixed(2) +' Total Booking Cost';
    }
    else {
        personfields.style.display='none';
        bookingtotal.innerHTML = '£' + parseInt(bookingcost).toFixed(2) + ' Total Booking Cost';
    }
}

function checkawardbooking(){
    var ftxt = '';
    
    //ftxt += counter;
    for (var i=1;i<(counter+1);i++){
        if (document.awardbooking.AdditionalName[i].value==''||document.awardbooking.AdditionalName[i].value=='Persons Name'){
            ftxt += '\n- Please enter a Name for Person ' + i;
        }
    }
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

function checkinnerlogin(){
    var ftxt = '';
    
    if (document.innerlogin.Username.value==''){
        ftxt += '\n- Please enter your Username.';
    }
    
    if (document.innerlogin.Password.value==''){
        ftxt += '\n- Please enter your Password.';
    }
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

/* Event Booking */
var counter = 0;
function displayEventPlaces(theVal){
    // Fields
    var personfields = document.getElementById("personfields");    
   
    if (theVal>0){   
	    var newFields = document.getElementById('readroot').cloneNode(true);
	    newFields.id = '';
	    newFields.style.display = 'block';
	    var newField = newFields.childNodes;
        
        for (var loopi=0;loopi<theVal-1;loopi++){
            if ((theVal-1)>counter){            
                counter++;
                
	            var newFields = document.getElementById('readroot').cloneNode(true);
                newFields.id = '';
                newFields.style.display = 'block';
    	        
    	        /*
    	        var newField = newFields.childNodes;
                for (var i=0;i<newField.length;i++) {
	                var theName = newField[i].name
	                if (theName)
		                newField[i].name = theName + counter;
                }
                */    	        
    	        
	            var insertHere = document.getElementById('writeroot');
                insertHere.parentNode.insertBefore(newFields,insertHere);        
            }
            else {
                var removecount = (counter-(theVal-1))
                if (removecount>0){
                    //alert(removecount);
                    for (var irem=0;irem<removecount;irem++){  
                        //alert('Remove Item ' + irem);
                        //this.parentNode.parentNode.removeChild(this.parentNode);
                    }
                    counter-=removecount;
                }
            }    
        }
    }
    else {
        personfields.style.display='none';       
    }
}

function checkeventbooking(){
    var ftxt = '';
    
    //ftxt += counter;
    for (var i=1;i<(counter+1);i++){
        if (document.eventbooking.AdditionalName[i].value==''||document.eventbooking.AdditionalName[i].value=='Persons Name'){
            ftxt += '\n- Please enter a Name for Person ' + i;
        }
    }
    
    if (ftxt !== '') {
        alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
        return false;
    }
    else {
        return true;
    }
}

/* Ask the Network Form */
function askthenetworkform(){
    if (document.postquestion.Question.value==''){
        alert('Please enter your Question');
        return false;
    }
    else {
        return true;
    }
}