<!--
	// This function will look at all the <A> links and move the content of the TITLE attribute
	// into a SPAN within the <A> tag allowing for styled tooltips - also allows for valid SEO
	window.onload = function() {
		//var links = document.links || document.getElementsByTagName("a");
		var links = document.getElementsByClassName("class_popup-window");
		var n = links.length;
		for (var i = 0; i < n; i++) {
			if (links[i].title && links[i].title != "") {
				// add the title to anchor innerhtml
				links[i].innerHTML += "<span class=\"class_styled-tooltip\">" + links[i].title + "<\/span>"; 
				links[i].title = ""; // remove the title
			}
		}
	}
	
	function validateRequest() {
		// This validates the request form
		var ruvalid = "";
		var error_count = 0;
		var doc = window.document.requestForm;
		// These are all the possible error messages that can be found	
		var msgNoName = "You cannot leave the Full Name field blank, please enter your name.\n";
		var msgNoEmail = "You cannot leave the Email Address field blank, please enter your email.\n";
		var msgValidEmail = "Your email address must be a valid one.\n";
		var msgIllegalEmail = "Your email address cannot have illegal characters in it.\n";
		var msgValidWeb = "If you enter a website, the URL must be a valid one.\n";
		var msgNoSubject = "You cannot leave the Subject field blank, please enter your subject.\n";
		var msgIllegalSubject = "Your subject cannot have special characters in it.\n";
		var msgNoMessage = "You cannot leave the Message field blank, please enter your message.\n";
		var msgIllegalMessage = "Your message cannot have special characters in it.\n";
		var msgNoValid = "You must enter the captch text.\n";
		// This checks if the username is blank or not
		if ( doc.clientFullname.value == "") {
			// The name field is blank
			ruvalid += msgNoName;
			error_count++;
		}
		if ( doc.clientEmail.value == "") {
			// The email address field is blank
			ruvalid += msgNoEmail;
			error_count++;
		} else {
			// The email address field is not blank so check if it is valid
			var emailString = doc.clientEmail.value;
			var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/;
			var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;
			if (!emailFilter.test(emailString)) {
        		ruvalid += msgValidEmail;
				error_count++;
			}
    		if (emailString.match(illegalChars)) {
        		ruvalid += msgIllegalEmail;
				error_count++;
			}
		}
		if ( doc.clientWebsite.value == "") {
			// The website url field is not blank so check if it is valid
			var websiteString = doc.clientWebsite.value;
			if ( (websiteString.indexOf("http") != -1) || (websiteString.indexOf(":") != -1) || (websiteString.indexOf("//") != -1) ) {
				ruvalid += msgValidWeb;
				error_count++;
			}
		}
		if ( doc.clientSubject.value == "") {
			// The email address field is blank
			ruvalid += msgNoSubject;
			error_count++;
		} else {
			// The email address field is not blank so check if it is valid
			var subjectString = doc.clientSubject.value;
			var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;
    		if (subjectString.match(illegalChars)) {
        		ruvalid += msgIllegalSubject;
				error_count++;
			}
		}
		if ( doc.clientMessage.value == "") {
			// The comments field is blank
			ruvalid += msgNoMessage;
			error_count++;
		} else {
			// The comments field is not blank so check if it is valid
			var illegalChars= /[\(\)\<\>\/\[\:\]]/
			var messageString = doc.clientMessage.value;
			if (messageString.match(illegalChars)) {
				ruvalid += msgIllegalMessage;
				error_count++;
			}
		}
		if ( doc.clientCaptcha.value == "") {
			// The captch field is blank
			ruvalid += msgNoValid;
			error_count++;
		}
		if( ruvalid != "" )	{
			if (error_count > 1) {
				var error_counter = "are " + error_count + " errors";
			} else {
				var error_counter = "is " + error_count + " error";
			}	
			var msgBadForm = "There " + error_counter + " with your submission\n" + "----------------------------------------------------------------\n";
			alert( msgBadForm + ruvalid);
		    return false;
		} else {
		   	return true;
		}
	}

//-->