// JavaScript Document
		function load(DefaultPlan, DefaultLength)
		{
			PlanChange(DefaultPlan);
			LengthChange(DefaultLength);
			BindHandlers();
		}

		function Check_Domain(oStatus) {

			var address = document.getElementById("Name").value;
			var ext = document.getElementById("DomainSelect").value;
			var domain = address + ext;
			
			if(ext == ".ipalaces.org") {
				return;
			}
			if(address.length > 0 && address.length < 3 ) {
				oStatus.isvalid = false;
				oStatus.errmsg = "Address must be atleast 3 characters";
				return;
			}

			UpdateErrorbox("checking");
			//window.showModalDialog("javascript:document.writeln('<" + "script" + ">window.close();</" + "script" + ">')");
			//setTimeout(function(){UpdateErrorbox("checking");},1);
			//window.setTimeout("UpdateErrorbox("checking");", 0, "JavaScript");

			var http = getHTTPObject(); // We create the HTTP Object
			http.open("GET", "form_callback.php?d=" + escape(domain), false);
			http.send(null);

			var results = http.responseText;
			
			if(results != '0'){
				if(results == '1'){
					oStatus.isvalid = true;
				} else {
					oStatus.isvalid = false;
					oStatus.errmsg = domain +" is already registered";
				}
			}
		}



		function getHTTPObject() { 
			var xmlhttp;
			/*@cc_on
			@if (@_jscript_version >= 5)
				try {
					xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
					try {
							xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
						} catch (E) {
							xmlhttp = false;
						}
				}
			@else xmlhttp = false;
			@end @*/
			if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
				try {
					xmlhttp = new XMLHttpRequest();
				} catch (e) {
					xmlhttp = false;
				}
			}
			return xmlhttp;
		}

		function SetTitle() {
			var planSelect = document.forms["Register"].elements["Plan"];

			planSelect.options[0].innerHTML = "PORT&nbsp;&nbsp;&nbsp;USERS&nbsp;&nbsp;&nbsp;SPACE&nbsp;&nbsp;DOMAIN&nbsp;&nbsp;PRICE";
			planSelect.options[0].disabled = 	true;
		}

		function PlanChange(DefaultPlan) {
	
			var plan = document.forms["Register"].elements["Plan"];
			var port = document.forms["Register"].elements["Port"];
			
			if (DefaultPlan) {
				for ( var i=0; i < plan.options.length; i++ ) {
					if (plan.options[i].value == DefaultPlan) {
						plan.selectedIndex = i;
					}
				}
			}
			


			if (plan.value == "Basic") { 
				port.disabled = false;
				port.value = "";
			} else {
				port.disabled = false;
				port.value = "9998" ;
			}

			var name = document.forms["Register"].elements["Name"];
			var domain = document.forms["Register"].elements["DomainSelect"];

			if (plan.value == "Unlimited") { 
				name.size = "29";
				domain.options.length = 5;
				domain.options[0] = new Option('.com','.com');
				domain.options[1] = new Option('.net','.net');
				domain.options[2] = new Option('.org','.org');
				domain.options[3] = new Option('.co.uk','.co.uk');
				domain.options[4] = new Option('.us','.us');
				domain.options[5] = new Option('.ca','.ca');
				domain.options[6] = new Option('.de','.de');
				domain.options[7] = new Option('.info','.info');
			} else {
				name.size = "22";
				domain.options.length = 1;
				domain.options[0] = new Option('.ipalaces.org','.ipalaces.org');
			}
		}
		
		function LengthChange(DefaultLength) {
			var length = document.forms["Register"].elements["Length"];
			
			
			if (DefaultLength) {
				for ( var i=0; i < length.options.length; i++ ) {
					if (length.options[i].value == DefaultLength) {
						length.selectedIndex = i;
					}
				}
			}



			var planSelect = document.forms["Register"].elements["Plan"];
			var sIndex = planSelect.selectedIndex

			
			if (length.value == "1") { 
				planSelect.options[1] = new Option('x', 'Unlimited');
				planSelect.options[2] = new Option('x', 'Professional');
				planSelect.options[3] = new Option('x', 'Advanced');
				planSelect.options[4] = new Option('x', 'Basic');
				planSelect.options[1].innerHTML = "Any&nbsp;           No-Limit              No-Limit       Any&nbsp;            $20.00/mo";
				planSelect.options[2].innerHTML = "Any&nbsp; &nbsp;&nbsp;100&nbsp; &nbsp;&nbsp;1000 MB&nbsp;&nbsp; -&nbsp;&nbsp; $10.00/mo";
				planSelect.options[3].innerHTML = "Any&nbsp; &nbsp; &nbsp;25&nbsp; &nbsp;&nbsp; 500 MB&nbsp;&nbsp; - &nbsp;&nbsp; $5.00/mo";
				planSelect.options[4].innerHTML = "999x&nbsp;&nbsp; &nbsp;10&nbsp; &nbsp;&nbsp; 100 MB&nbsp;&nbsp; - &nbsp;&nbsp; $3.00/mo";			
			} else if (length.value == "3") { 
				planSelect.options[1] = new Option('x', 'Unlimited');
				planSelect.options[2] = new Option('x', 'Professional');
				planSelect.options[3] = new Option('x', 'Advanced');
				planSelect.options[4] = new Option('x', 'Basic');
				planSelect.options[1].innerHTML = "Any&nbsp;           No-Limit              No-Limit       Any&nbsp;            $16.00/mo";
				planSelect.options[2].innerHTML = "Any&nbsp; &nbsp;&nbsp;100&nbsp; &nbsp;&nbsp;1000 MB&nbsp;&nbsp; - &nbsp;&nbsp; $8.50/mo";
				planSelect.options[3].innerHTML = "Any&nbsp; &nbsp; &nbsp;25&nbsp; &nbsp;&nbsp; 500 MB&nbsp;&nbsp; - &nbsp;&nbsp; $4.25/mo";
				planSelect.options[4].innerHTML = "999x&nbsp;&nbsp; &nbsp;10&nbsp; &nbsp;&nbsp; 100 MB&nbsp;&nbsp; - &nbsp;&nbsp; $2.55/mo";
			} else if (length.value == "6") { 
				planSelect.options[1] = new Option('x', 'Unlimited');
				planSelect.options[2] = new Option('x', 'Professional');
				planSelect.options[3] = new Option('x', 'Advanced');
				planSelect.options[4] = new Option('x', 'Basic');
				planSelect.options[1].innerHTML = "Any&nbsp;           No-Limit              No-Limit       Any&nbsp;            $15.00/mo";
				planSelect.options[2].innerHTML = "Any&nbsp; &nbsp;&nbsp;100&nbsp; &nbsp;&nbsp;1000 MB&nbsp;&nbsp; - &nbsp;&nbsp; $8.00/mo";
				planSelect.options[3].innerHTML = "Any&nbsp; &nbsp; &nbsp;25&nbsp; &nbsp;&nbsp; 500 MB&nbsp;&nbsp; - &nbsp;&nbsp; $4.00/mo";
				planSelect.options[4].innerHTML = "999x&nbsp;&nbsp; &nbsp;10&nbsp; &nbsp;&nbsp; 100 MB&nbsp;&nbsp; - &nbsp;&nbsp; $2.40/mo";
			} else if (length.value == "12") { 
				planSelect.options[1] = new Option('x', 'Unlimited');
				planSelect.options[2] = new Option('x', 'Professional');
				planSelect.options[3] = new Option('x', 'Advanced');
				planSelect.options[4] = new Option('x', 'Basic');
				planSelect.options[1].innerHTML = "Any&nbsp;           No-Limit              No-Limit       Any&nbsp;            $12.00/mo";
				planSelect.options[2].innerHTML = "Any&nbsp; &nbsp;&nbsp;100&nbsp; &nbsp;&nbsp;1000 MB&nbsp;&nbsp; - &nbsp;&nbsp; $7.50/mo";
				planSelect.options[3].innerHTML = "Any&nbsp; &nbsp; &nbsp;25&nbsp; &nbsp;&nbsp; 500 MB&nbsp;&nbsp; - &nbsp;&nbsp; $3.75/mo";
				planSelect.options[4].innerHTML = "999x&nbsp;&nbsp; &nbsp;10&nbsp; &nbsp;&nbsp; 100 MB&nbsp;&nbsp; - &nbsp;&nbsp; $2.25/mo";
			}
			planSelect.options[sIndex].selected = true;
		}
		
		
		function ContactCheck(oStatus) {
			var rx ;
			var matches;
			var contact = document.forms["Register"].elements["Contact"].value
			
			if (contact.length == null || contact.length == 0) {return;}
			
			switch (document.forms["Register"].elements["ContactSelect"].value) {
				case "MSN":
					oStatus.errmsg = "Invalid MSN email";
					rx = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.\w{2,8}$/;
					break;
				case "AIM":
					oStatus.errmsg = "Invalid AIM screenname";
					if (contact.length > 16) {oStatus.isvalid = false; return;}
					rx = /^[a-zA-Z0-9\s]*$/;
					break;
				case "YAHOO":
					oStatus.errmsg = "Invalid Yahoo screenname";
					rx = /^[\w.]*$/;
					break;
			}

				matches = rx.exec(contact);
				oStatus.isvalid = (matches != null);		
		}
		
		function jsPortCheck(oStatus)
		{
			plan = document.forms["Register"].elements["Plan"].value;
			port = document.forms["Register"].elements["Port"].value;
			
			if (plan == "Basic" && port == "9998")
			{
				oStatus.isvalid = false;
				oStatus.errmsg = "Port cannot be 9998";
			}
		} 

		function PlanCheck(oStatus)
		{
			plan = document.forms["Register"].elements["Plan"].value;
			
			if (plan == "Blank")
			{
				oStatus.isvalid = false;
				oStatus.errmsg = "Hosting Plan not selected";
			}
		} 

		function SymError()
		{
		  return true;
		}
		window.onerror = SymError;
		
		var vdAllForms = new Array();
		var vdForm = null;
		
		function ValidateForm(formName, submit)
		{

		    if (typeof(vdAllForms[formName]) == "undefined")
		        return true;
		
		    var browser = DetectBrowser();
		    if (browser != "MSIE" && browser != "Netscape" && browser != "Firefox" && browser != "Opera" && browser != "Safari")
		        return true;
		
		    vdForm = vdAllForms[formName];
		    vdForm.focus = false;
		    PrepareValues();
		    
		    var isPageValid = true;
		    var eventType = submit ? "submit" : "blur";
		    for (var key in vdForm.validators) {
		        ValidateValidator(vdForm.validators[key], eventType);
		        isPageValid = isPageValid && vdForm.validators[key].isvalid;
		    }
		    vdForm.isvalid = isPageValid;
		    
		    UpdateLabels(eventType);
		    UpdateErrorbox(eventType);
		
		    vdForm = null;
		    return isPageValid;
		}
		
		function ResetForm(formName)
		{




			var planSelect = document.forms["Register"].elements["Plan"];

			planSelect.options[0].innerHTML = "Please Select...";
			planSelect.options[0].disabled = 	false;
			
			PlanChange();
			LengthChange();
			
			var name = document.forms["Register"].elements["Name"];
			var domain = document.forms["Register"].elements["DomainSelect"];
	
			name.size = "22";
			domain.options.length = 1;
			domain.options[0] = new Option('.ipalaces.org','.ipalaces.org');

		    if (typeof(vdAllForms[formName]) == "undefined")
		        return true;
		
		    var browser = DetectBrowser();
		    if (browser != "MSIE" && browser != "Netscape" && browser != "Firefox" && browser != "Opera" && browser != "Safari")
		        return true;
		
		    vdForm = vdAllForms[formName];
		    if (typeof(vdForm.controls) == "undefined")
		        PrepareControls();
		
		    UpdateLabels("reset");
		    UpdateErrorbox("reset");
		
		    vdForm = null;

			
		    return true;
		}
		
		function BindHandlers()
		{
		    var browser = DetectBrowser();
		    for (var key in vdAllForms) {
		        if (browser == "MSIE" || browser == "Opera") {
		            document.forms[key].attachEvent('onsubmit', IeSubmitHandler);
		            document.forms[key].attachEvent('onreset', IeResetHandler);
		        } else if (browser == "Netscape" || browser == "Firefox" || browser == "Safari") {
		            document.forms[key].addEventListener('submit', GeckoSubmitHandler, false);
		            document.forms[key].addEventListener('reset', GeckoResetHandler, false);
		        }
		        
		        for (var idx = 0; idx < document.forms[key].elements.length; idx++) {
		            var element = document.forms[key].elements[idx];
		            if (element.type == "submit" && element.tagName != "BUTTON") {
		                if (browser == "MSIE" || browser == "Opera") {
		                    element.attachEvent('onclick', IeClickHandler);
		                } else if (browser == "Netscape" || browser == "Firefox" || browser == "Safari") {
		                    element.addEventListener('click', GeckoClickHandler, false);
		                }
		            }
		            else if (element.type != "button" && element.type != "image" &&
		            element.type != "submit" && element.type != "reset") {
		                if (vdAllForms[key].validationmode == "onchange") {
		                    if (browser == "MSIE" || browser == "Opera") {
		                        element.attachEvent('onblur', IeSubmitHandler);
		                    } else if (browser == "Netscape" || browser == "Firefox" || browser == "Safari") {
		                        element.addEventListener('blur', GeckoSubmitHandler, false);
		                    }
		                }
		            }
		        }
		    }
		}
		function IeSubmitHandler() 
		{
		    if (vdForm == null) {
		        var formName = GetFormName(event.srcElement);
		        var submit = event.type == "submit";
		        var valid = ValidateForm(formName, submit);
		        if (submit) {
		            if (valid) {
		                DisableButtons(formName);
		            } else {
		                event.returnValue = false;
		            }
		        }
		    }
		}
		
		function IeResetHandler() 
		{
		    if (vdForm == null) {
		        var formName = GetFormName(event.srcElement);
		        ResetForm(formName);
		    }
		}
		
		function IeClickHandler() 
		{
		    if (vdForm == null) {
		        var formName = GetFormName(event.srcElement);
		        vdAllForms[formName].submit = event.srcElement;
		    }
		}
		
		function GeckoSubmitHandler(event) 
		{
		    if (vdForm == null) {
		        var formName = GetFormName(event.target);
		        var submit = event.type == "submit";
		        var valid = ValidateForm(formName, submit);
		        if (submit) {
		            if (valid) {
		                DisableButtons(formName);
		            } else {
		                event.preventDefault();
		            }
		        }
		    }
		}
		
		function GeckoResetHandler(event) 
		{
		    if (vdForm == null) {
		        var formName = GetFormName(event.target);
		        ResetForm(formName);
		    }
		}
		
		function GeckoClickHandler(event) 
		{
		    if (vdForm == null) {
		        var formName = GetFormName(event.target);
		        vdAllForms[formName].submit = event.target;
		    }
		}
		
		function GetFormName(element)
		{
		    var result = '';
		    if (element.tagName == "INPUT" || element.tagName == "SELECT" || element.tagName == "TEXTAREA") {
		        element = element.form;
		    }
		    if (element != null) {
		        if (typeof(element.id) == "string") {
		            result = element.id;
		        } else if (element.getAttributeNode("id") != null) {
		            result = element.getAttributeNode("id").value;
		        }
		        if (result == '') {
		            if (typeof(element.name) == "string") {
		                result = element.name;
		            } else if (element.getAttributeNode("name") != null) {
		                result = element.getAttributeNode("name").value;
		            }
		        }
		    }
		    return result;
		}
		
		function DisableButtons(formName)
		{
		    if (vdAllForms[formName].disablebuttons == "none")
		        return;
		    
		    for (var idx = 0; idx < document.forms[formName].elements.length; idx++) {
		        var element = document.forms[formName].elements[idx];
		        if (element.type == "submit" || element.type == "image" ||
		        (vdAllForms[formName].disablebuttons == "all" &&
		        (element.type == "button" || element.type == "reset"))) {
		            element.disabled = true;
		        }
		    }
		}
		
		function DetectBrowser()
		{
		    var detect = navigator.userAgent.toLowerCase();
		    var browser;
		
		    if (detect.indexOf('konqueror') > -1) browser = "Konqueror";
		    else if (detect.indexOf('safari') > -1) browser = "Safari"
		    else if (detect.indexOf('omniweb') > -1) browser = "OmniWeb"
		    else if (detect.indexOf('opera') > -1) browser = "Opera"
		    else if (detect.indexOf('webtv') > -1) browser = "WebTV";
		    else if (detect.indexOf('icab') > -1) browser = "iCab"
		    else if (detect.indexOf('msie') > -1) browser = "MSIE"
		    else if (detect.indexOf('firefox') > -1) browser = "Firefox"
		    else if (detect.indexOf('netscape') > -1) browser = "Netscape"
		    else browser = "Unknown";
		    
		    return browser;
		}
		
		function GetPhpControlName(ctrlName)
		{
		    var result = new Array();
		    var posL, posR, index;
		    
		    posL = ctrlName.indexOf('[');
		    if (posL == 0) {
		        return null;
		    }
		    posR = ctrlName.indexOf(']', posL);
		    result[0] = posL > 0 && posR > 0 ? ctrlName.substring(0, posL) : ctrlName;
		    result[0] = result[0].replace('[', '_');
		    result[0] = result[0].replace('.', '_');
		    
		    while (posL > 0 && posR > 0) {
		        index = ctrlName.substring(posL + 1, posR);
		        index = Escape(index);
		        if (index.match(/^0$|^[1-9][0-9]*$/) != null) { // decimal int
		            index = parseInt(index);
		        }
		        result[result.length] = index;
		        
		        posL = ctrlName.indexOf('[', posR);
		        if (posL != posR + 1) {
		            posL = -1;
		        } else {
		            posR = ctrlName.indexOf(']', posL);
		        }
		    }
		    
		    return result;
		}
		
		function PrepareControls()
		{
		    var control;
		    var phpName;
		    var element;
		    vdForm.controls = new Array();
		
		    for (var idx = 0; idx < document.forms[vdForm.name].elements.length; idx++) {
		        element = document.forms[vdForm.name].elements[idx];
		        if (element.name && element.name != "aemonValidators" && element.className == "validate" && element.tagName != "BUTTON" &&
		        element.type != "button" && element.type != "image" && element.type != "reset") {
		            phpName = GetPhpControlName(element.name);
		            if (phpName != null) {
		                control = new Object();
		                control.phpName = phpName;
		                control.obj = element;
		                vdForm.controls[vdForm.controls.length] = control;
		            }
		        }
		    }
		}
		
		function PrepareValues()
		{
		    var values, index, ref;
		    
		    if (typeof(vdForm.controls) == "undefined")
		        PrepareControls();
		    
		    vdForm.values = new Array();
		    for (var i in vdForm.controls) {
		        values = GetElementValues(vdForm.controls[i].obj);
		        for (var v in values) {
		            ref = vdForm.values;
		            index = null;
		            for (var j in vdForm.controls[i].phpName) {
		                if (index != null)
		                    ref = ref[index];
		                index = vdForm.controls[i].phpName[j];
		                if (index === "")
		                    index = ref.length;
		                if (typeof(ref[index]) != "object") {
		                    ref[index] = new Array();
		                }
		            }
		            ref[index] = values[v];
		        }
		    }
		}
		
		function GetElementValues(element)
		{
		    var result = new Array();
		    if (element.type == "select-multiple") {
		        var options = element.getElementsByTagName("OPTION");
		        if (typeof(options.length) == "number") {
		            for (var idx = 0; idx < options.length; idx++) {
		                var value = GetOptionValue(options[idx]);
		                if (value != null) {
		                    result[result.length] = value;
		                }
		            }
		        }
		    } else if (typeof(element.value) == "string") {
		        if (element.type == "checkbox" || element.type == "radio") {
		            if (element.checked)
		                result[result.length] = Trim(element.value);
		        } else if (element.type == "submit") {
		            if (vdForm.disablebuttons == "none" &&
		            typeof(vdForm.submit) == "object" && vdForm.submit == element) {
		                vdForm.submit = null;
		                result[result.length] = Trim(element.value);
		            }
		        } else
		            result[result.length] = Trim(element.value);
		    }
		    return result;
		}
		
		function GetOptionValue(option)
		{
		    var result = null;
		    if (option.selected) {
		        if (typeof(option.value) == "string") {
		            result = Trim(option.value);
		        } else {
		            result = Trim(option.text);
		        }
		    }
		    return result;
		}
		
		function ValidateValidator(validator, eventType)
		{
		    validator.isvalid = true;
		    switch (validator.type) {
		        case "required":
		            validator.isvalid = EvaluateRequired(validator);
		            break;
		        case "checktype":
		            validator.isvalid = EvaluateChecktype(validator);
		            break;
		        case "range":
		            validator.isvalid = EvaluateRange(validator);
		            break;
		        case "compare":
		            validator.isvalid = EvaluateCompare(validator);
		            break;
		        case "regexp":
		            validator.isvalid = EvaluateRegExp(validator);
		            break;
		        case "format":
		            validator.isvalid = EvaluateFormat(validator);
		            break;
		        case "custom":
		            validator.isvalid = EvaluateCustom(validator);
		            break;
		        case "group":
		            validator.isvalid = validator.operator == "and";
		            for (var i in validator.validators) {
		                ValidateValidator(validator.validators[i], "");
		                if (validator.operator == "and") {
		                    validator.isvalid = validator.isvalid && validator.validators[i].isvalid;
		                } else {
		                    validator.isvalid = validator.isvalid || validator.validators[i].isvalid;
		                }
		            }
		            break;
		    }
		    
		    if (eventType == "submit" && !validator.isvalid && !vdForm.focus) {
		        var fcontrol = FindFocus(validator);
		        if (fcontrol) {
		            var ctrlObj = document.forms[vdForm.name].elements[fcontrol];
		            if (typeof(ctrlObj) != "undefined") {
		                if (typeof(ctrlObj.tagName) == "undefined" && typeof(ctrlObj.length) == "number") {
		                    ctrlObj = ctrlObj[0];
		                }
		                ctrlObj.focus();
		                vdForm.focus = true;
		            }
		        }
		    }
		}
		
		function FindFocus(validator)
		{
		    var fcontrol = null;
		    if (validator.type == "group") {
		        for (var i in validator.validators) {
		            if (!validator.validators[i].isvalid) {
		                fcontrol = FindFocus(validator.validators[i]);
		                if (fcontrol)
		                    break;
		            }
		        }
		    } else if (typeof(validator.fcontrol) == "string") {
		        fcontrol = validator.fcontrol;
		    }
		    
		    return fcontrol;
		}
		
		function UpdateLabels(eventType)
		{
		    if (typeof(vdForm.labels) == "undefined")
		        return;
		    var i, j;
		    for (i in vdForm.labels) {
		        var oLabel = vdForm.labels[i];
		        var label = document.getElementById(oLabel.id);
		        if (label != null) {
		            var isValid = true;
		            if (eventType != "reset") {
		                for (j in oLabel.validators) {
		                    var valName = oLabel.validators[j];
		                    var valState = GetValidatorState(valName);
		                    if (valState != -1) {
		                        isValid = isValid && valState;
		                    }
		                }
		            }
		
		            label.innerHTML = "";
		            if (isValid) {
		                label.innerHTML = oLabel.oktext;
		                label.className = oLabel.okclass;
		            } else {
		                label.innerHTML = oLabel.errtext;
		                label.className = oLabel.errclass;
		            }
		            
		            if (typeof(oLabel.cokclass) == "object") {
		                for (j in oLabel.cokclass) {
		                    if (typeof(vdForm.controls[j].obj) == "object") {
		                        vdForm.controls[j].obj.className = isValid ? oLabel.cokclass[j] : oLabel.cerrclass;
		                    }
		                }
		            }
		        }
		    }
		}


		function UpdateErrorbox(eventType)
		{
			var summary = document.getElementById("errorbox");

			if (eventType == "checking") {	
				summary.innerHTML = "<b>Checking...</b>";
			}
			else if (eventType == "reset" || vdForm.isvalid) {
				summary.innerHTML = "";
			}
			else if (eventType == "submit") {	
				pre = "<li>";
				post = "</li>";
				s = "";
				
				for (var j in vdForm.validators) {
				    var val = vdForm.validators[j];
				    s += GetValidatorErrMsg(val, pre, post);
				}
				if (s != "") {
				    s = "<ul>" + s + "</ul>";
				}

				s = "<b>Form Error:</b>" + s;
				
				summary.innerHTML = s;
			}
		}
		
		function GetValidatorErrMsg(val, pre, post)
		{
		    var result = "";
		    if (!val.isvalid) {
		        if (val.errmsg) {
		            result += pre + val.errmsg + post;
		        }
		        if (val.type == "group") {
		            for (i in val.validators) {
		                result += GetValidatorErrMsg(val.validators[i], pre, post);
		            }
		        }
		    }
		    
		    return result;
		}
		
		function GetValidatorState(valName)
		{
		    var result = -1;
		    if (valName) {
		        for (i in vdForm.validators) {
		            result = GetValStateR(valName, vdForm.validators[i], false);
		            if (result != -1) {
		                break;
		            }
		        }
		    }
		    
		    return result;
		}
		
		function GetValStateR(valName, val, parentState)
		{
		    var result = -1;
		    if (val.name == valName) {
		        result = parentState || val.isvalid;
		    } else if (val.type == "group") {
		        for (i in val.validators) {
		            result = GetValStateR(valName, val.validators[i], val.isvalid);
		            if (result != -1) {
		                break;
		            }
		        }
		    }
		    
		    return result;
		}
		
		function GetControlValue(ctrlName)
		{
		    var result = vdForm.values;
		    
		    if (typeof(ctrlName) != "object")
		        return null;
		    
		    for (var idx in ctrlName) {
		        if (typeof(result[ctrlName[idx]]) == "undefined") {
		            return null;
		        }
		        result = result[ctrlName[idx]];
		    }
		    
		    return result;
		}
		
		function Trim(str)
		{
		    var match = str.match(/^\s*(\S+(\s+\S+)*)\s*$/);
		    return (match == null) ? "" : match[1];
		}
		
		function Escape(value)
		{
		    value = value.replace(/\\/g, "\\\\");   //")
		    value = value.replace(/'/g, "\\'");     //')
		    value = value.replace(/"/g, '\\"');     //")
		    
		    return value;
		}
		
		function Convert(op, val)
		{
		    var dataType = val.validtype;
		    var num, cleanInput, m, exp;
		    if (dataType == "integer") {
		        exp = /^\s*[-+]?\d+\s*$/;
		        if (op.match(exp) == null) 
		            return null;
		        num = parseInt(op, 10);
		        return (isNaN(num) ? null : num);
		    } else if(dataType == "float") {
		        exp = new RegExp("^\\s*([-+]?)(\\d+)?(\\.\\d+)?\\s*$");
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        cleanInput = m[1] + (m[2].length > 0 ? m[2] : "0") + m[3];
		        num = parseFloat(cleanInput);
		        return (isNaN(num) ? null : num);            
		    } else if (dataType == "currency") {
		        exp = new RegExp("^\\s*([-+]?)(((\\d+)\\,)*)(\\d+)(\\.\\d{1,2})?\\s*$");
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        var intermed = m[2] + m[5];
		        cleanInput = m[1] + intermed.replace(new RegExp("(\\,)", "g"), "") + m[6];
		        num = parseFloat(cleanInput);
		        return (isNaN(num) ? null : num);            
		    } else if (dataType == "date") {
		        return ConvertDate(op, val);
		    } else if (dataType == "time") {
		        return ConvertTime(op, val);
		    } else if (dataType == "datetime") {
		        exp = /^\s*([-\d\.\/]+)\s+([\d:]+\s?(?:PM|AM)?)\s*$/i;
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        var date = ConvertDate(m[1], val);
		        var time = ConvertTime(m[2], val);
		        if (date == null || time == null)
		            return null;
		        
		        return date + time;
		        return ConvertDate(op, val);
		    } else {
		        return op.toString();
		    }
		}
		
		function ConvertDate(op, val)
		{
		    function GetFullYear(year) {
		        return (year + 2000) - ((year < 30) ? 0 : 100);
		    }
		    
		    var day, month, year, m, exp;
		    if (val.dateorder == "ymd") {
		        exp = new RegExp("^\\s*(\\d{2}(\\d{2})?)([-./])(\\d{1,2})\\3(\\d{1,2})\\s*$");
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        day = m[5];
		        month = m[4];
		        year = (m[1].length == 4) ? m[1] : GetFullYear(parseInt(m[1], 10));
		    } else {
		        exp = new RegExp("^\\s*(\\d{1,2})([-./])(\\d{1,2})\\2(\\d{2}(\\d{2})?)\\s*$");
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        if (val.dateorder == "dmy") {
		            day = m[1];
		            month = m[3];
		        } else {
		            day = m[3];
		            month = m[1];
		        }
		        year = (m[4].length == 4) ? m[4] : GetFullYear(parseInt(m[4], 10));
		    }
		    month -= 1;
		    var date = new Date(year, month, day);
		    return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null;
		}
		
		function ConvertTime(op, val)
		{
		    var hour, min, sec, suf, m, exp;
		    if (val.timeformat == "12") {
		        exp = /^\s*(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(PM|AM)\s*$/i;
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        hour = parseInt(m[1], 10);
		        min = m[2];
		        sec = m[3] ? m[3] : 0;
		        suf = m[4].toLowerCase();
		        
		        if (hour < 1 || hour > 12)
		            return null;
		        if (hour == 12) {
		            hour = (suf == 'am') ? 0 : 12;
		        } else if (suf == 'pm') {
		            hour += 12;
		        }
		    } else {
		        exp = /^\s*(\d{1,2}):(\d{2})(?::(\d{2}))?\s*$/;
		        m = op.match(exp);
		        if (m == null)
		            return null;
		        hour = m[1];
		        min = m[2];
		        sec = m[3] ? m[3] : 0;
		    }
		    
		    var date = new Date(1970, 0, 1, hour, min, sec);
		    return (typeof(date) == "object" && hour == date.getHours() && min == date.getMinutes() && sec == date.getSeconds()) ? date.valueOf() : null;
		}
		
		function Compare(operand1, operand2, operator, val)
		{
		    var op1, op2;
		    if ((op1 = Convert(operand1, val)) == null)
		        return false;    
		    if ((op2 = Convert(operand2, val)) == null)
		        return true;
		
		    if (val.validtype == "string" && !val.casesensitive) {
		        op1 = op1.toLowerCase();
		        op2 = op2.toLowerCase();
		    }    
		    switch (operator) {
		        case "ne":
		            return (op1 != op2);
		        case "g":
		            return (op1 > op2);
		        case "ge":
		            return (op1 >= op2);
		        case "l":
		            return (op1 < op2);
		        case "le":
		            return (op1 <= op2);
		        case "e":
		        default:
		            return (op1 == op2);            
		    }
		}

		function EvaluateRequired(validator)
		{
		    var value = GetControlValue(validator.control);
		    if (value == "")
		        return !validator.required;
		    
		    var len;
		    if (typeof(value) == "object") {
		        len = 0;
		        for (var i in value) {
		            if (value[i] !== '')
		                len++;
		        }
		    } else
		        len = value.length;
		    
		    var result = true;

		   if (value != "" && len < validator.minlength) {
		        result = false;
		    } else if (validator.maxlength != -1) {
		        result = (len <= validator.maxlength);
		    }

		    if (validator.negation) {
		        result = !result;
		    }
		    
		    return result;
		}
		
		function EvaluateChecktype(validator)
		{
		    var value = GetControlValue(validator.control);
		    if (value != null && typeof(value) == "object")
		        return true;
		    if (value == null || value.length == 0)
		        return !validator.required;
		    
		    var result = (Convert(value, validator) != null);
		    if (validator.negation) {
		        result = !result;
		    }
		    
		    return result;
		}
		
		function EvaluateRange(validator)
		{
		    var value = GetControlValue(validator.control);
		    if (value != null && typeof(value) == "object")
		        return true;
		    if (value == null || value.length == 0)
		        return !validator.required;
		    
		    var result = (Compare(value, validator.minvalue, "ge", validator) &&
		                  Compare(value, validator.maxvalue, "le", validator));
		    if (validator.negation) {
		        result = !result;
		    }
		    
		    return result;
		}
		
		function EvaluateCompare(validator)
		{
		    var value = GetControlValue(validator.control);
		    if (value != null && typeof(value) == "object")
		        return true;
		    if (value == null || value.length == 0)
		        return !validator.required;
		    
		    var compareTo = "";
		    if (typeof(validator.comparevalue) != "undefined") {
		        compareTo = validator.comparevalue;
		    } else if (typeof(validator.comparecontrol) != "undefined") {
		        compareTo = GetControlValue(validator.comparecontrol);
		    } else
		        return false;
		
		    if (compareTo == null)
		        return false;
		    else if (typeof(compareTo) == "object")
		        return true;
		
		    var result = Compare(value, compareTo, validator.operator, validator);
		    if (validator.negation) {
		        result = !result;
		    }
		    
		    return result;
		}
		
		function EvaluateRegExp(validator)
		{
		    var value = GetControlValue(validator.control);
		    if (value != null && typeof(value) == "object")
		        return true;
		    if (value == null || value.length == 0)
		        return !validator.required;
		    
		    var result = true;
		    var rx;
		    try {
		        eval("rx = " + validator.clientregexp + ";");
		        var matches = rx.exec(value);
		        result = (matches != null);
		        if (validator.negation) {
		            result = !result;
		        }
		    } catch(e) {
		
		        result = true;
		    }
		    
		    return result;
		}
		
		function EvaluateFormat(validator)
		{
		    var value = GetControlValue(validator.control);
		    if (value != null && typeof(value) == "object")
		        return true;
		    if (value == null || value.length == 0)
		        return !validator.required;
		    
		    var rx;
		    switch (validator.format) {
		        case 'email':
		            rx = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.\w{2,8}$/;
		            break;
		        case 'zip_us5':
		            rx = /^\d{5}$/;
		            break;
		        case 'zip_us9':
		            rx = /^\d{5}-\d{4}$/;
		            break;
		        case 'zip_us':
		            rx = /^\d{5}(-\d{4})?$/;
		            break;
		        case 'zip_canada':
		            rx = /^[a-z]\d[a-z]\s?\d[a-z]\d$/i;
		            break;
		        case 'zip_uk':
		            rx = /^[a-z](\d|\d[a-z]|\d{2}|[a-z]\d|[a-z]\d[a-z]|[a-z]\d{2})\s?\d[a-z]{2}$/i;
		            break;
		        case 'phone_us':
		            rx = /^(\+?\d{1,3})?[-\s\.]?(\(\d{3}\)|\d{3})[-\s\.]?\d{3}[-\s\.]?\d{4}(([-\s\.]|(\s?(x|ext\.?)))\d{1,5})?$/i;
		            break;
		        case 'ip4':
		            rx = /^(([3-9]\d?|[01]\d{0,2}|2\d?|2[0-4]\d|25[0-5])\.){3}([3-9]\d?|[01]\d{0,2}|2\d?|2[0-4]\d|25[0-5])$/;
		            break;
		        default:
		            rx = /^$/;
		            break;
		    }
		    var matches = rx.exec(value);
		    var result = (matches != null);
		    if (validator.negation) {
		        result = !result;
		    }
		    
		    return result;
		}
		

		function EvaluateCustom(validator)
		{
		    var value = null;
		    if (typeof(validator.control) == "object") {
		        value = GetControlValue(validator.control);
		    }
		    
		    var args = new Object();
		    args.isvalid = true;
		    args.errmsg = validator.errmsg;
		    args.value = value;
		    if (typeof(validator.clientfunction) == "string") {
		        var rx = /^[a-zA-Z_]\w*$/;
		        var m = rx.exec(validator.clientfunction);
		        var isfunc;
		        if (m != null) {
		            eval("isfunc = typeof(" + validator.clientfunction + ") == 'function';");
		            if (isfunc) {
		                eval(validator.clientfunction + "(args);");
		                args.isvalid = (args.isvalid === true);
		                if (typeof(args.errmsg) == "string") {
		                    validator.errmsg = args.errmsg;
		                }
		            }
		        }
		    }        
		    return args.isvalid;
		}
		
		var f,v,i,l,s;
		
		f=new Object();
		 f.name="Register";
		 f.disablebuttons="all";
		 f.validationmode="onsubmit";
		 f.validators=new Array();
		 f.labels=new Array();
		 f.summaries=new Array();
		 v=new Array();
		 v[0]=f;
		 i=1;
		
		
		 l=new Object();
		 l.id="ValidationControl_1";
		 l.oktext="E-mail:";
		 l.errtext="E-mail:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("Email", "Email2");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[0]="control";
		 f.labels[f.labels.length]=l;
		
										 v[i]=new Object();
										 v[i].type="required"; 
										 v[i].name="Email";
										 v[i].errmsg="E-mail required";
										 v[i].fcontrol="Email";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Email";
										 v[i].minlength=1;
										 v[i].maxlength=-1;
										 v[i].required=true;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 
										 
										 
										 
										 v[i]=new Object();
										 v[i].type="format";
										 v[i].name="Email2";
										 v[i].errmsg="Invalid E-mail";
										 v[i].fcontrol="Email";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Email";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].format="email";
										 v[i-1].validators[v[i-1].validators.length]=v[i];
		l=new Object();
		 l.id="ValidationControl_2";
		 l.oktext="Username:";
		 l.errtext="Username:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("UserID","UserID2","UserID3","UserID4");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[1]="control";
		 f.labels[f.labels.length]=l;
										v[i]=new Object();
										 v[i].type="required"; 
										 v[i].name="UserID";
										 v[i].errmsg="Username required";
										 v[i].fcontrol="UserID";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="UserID";
										 v[i].minlength=1;
										 v[i].maxlength=-1;
										 v[i].required=true;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 


										 v[i]=new Object();
										 v[i].type="required"; 
										 v[i].name="UserID2";
										 v[i].errmsg="Username must be atleast 2 characters";
										 v[i].fcontrol="UserID";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="UserID";
										 v[i].minlength=2;
										 v[i].maxlength=-1;
										 v[i].required=false;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 						 
										 v[i]=new Object();
										 v[i].type="required"; 
										 v[i].name="UserID4";
										 v[i].errmsg="Username cannot exceed 16 characters";
										 v[i].fcontrol="UserID";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="UserID";
										 v[i].minlength=-1;
										 v[i].maxlength=16;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 
										 v[i]=new Object();
										 v[i].type="regexp"; 
										 v[i].name="UserID3";
										 v[i].errmsg="Invalid Username (a-z & 0-9)";
										 v[i].fcontrol="UserID";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="UserID";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientregexp="/^[a-zA-Z0-9]*$/";
										 v[i-1].validators[v[i-1].validators.length]=v[i];
		
		
		l=new Object();
		 l.id="ValidationControl_3";
		 l.oktext="Password:";
		 l.errtext="Password:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("Password","Password2","Password3","PassCmp");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[2]="control";
		 f.labels[f.labels.length]=l;

										 v[i]=new Object();
										 v[i].type="required";
										 v[i].name="Password";
										 v[i].errmsg="Password required";
										 v[i].fcontrol="Password";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Password";
										 v[i].minlength=1;
										 v[i].maxlength=-1;
										 v[i].negation=false;
										 v[i].required=true;
										 v[i-1].validators[v[i-1].validators.length]=v[i];

										 
										 v[i]=new Object();
										 v[i].type="required";
										 v[i].name="Password2";
										 v[i].errmsg="Password must be atleast 6 characters";
										 v[i].fcontrol="Password";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Password";
										 v[i].minlength=6;
										 v[i].maxlength=-1;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 
										  v[i]=new Object();
										 v[i].type="required";
										 v[i].name="Password3";
										 v[i].errmsg="Password cannot exceed 32 characters";
										 v[i].fcontrol="Password";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Password";
										 v[i].minlength=-1;
										 v[i].maxlength=32;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 
										 										 
										 v[i]=new Object();
										 v[i].type="regexp"; 
										 v[i].name="Password4";
										 v[i].errmsg="Invalid Password (no & or !)";
										 v[i].fcontrol="Password";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Password";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientregexp="/^[^&!]*$/";
										 v[i-1].validators[v[i-1].validators.length]=v[i];
		
		l=new Object();
		 l.id="ValidationControl_4";
		 l.oktext="Confirm Password:";
		 l.errtext="Confirm Password:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("Password","PassCmp");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[3]="control";
		 f.labels[f.labels.length]=l;
		
										 v[i]=new Object();
										 v[i].type="compare";
										 v[i].name="PassCmp";
										 v[i].errmsg="Both Password fields must be equal";
										 v[i].fcontrol="Password";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Password";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].validtype="string";
										 v[i].casesensitive=false;
										 v[i].comparecontrol=new Array();
										 v[i].comparecontrol[v[i].comparecontrol.length]="Password2";
										 v[i].operator="e";
										 v[i-1].validators[v[i-1].validators.length]=v[i];


		l=new Object();
		 l.id="ValidationControl_5";
		 l.oktext="Palace Address:";
		 l.errtext="Palace Address:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("NameReq", "NameValid", "Check_Domain");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[4]="control";
		 f.labels[f.labels.length]=l;
										 
										 v[i]=new Object();
										 v[i].type="required";
										 v[i].name="NameReq";
										 v[i].errmsg="Palace Address required";
										 v[i].fcontrol="Name";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Name";
										 v[i].minlength=1;
										 v[i].maxlength=-1;
										 v[i].negation=false;
										 v[i].required=true;
										 v[i-1].validators[v[i-1].validators.length]=v[i];

										 v[i]=new Object();
										 v[i].type="regexp"; 
										 v[i].name="NameValid";
										 v[i].errmsg="Invalid Palace Address (a-z & 0-9)";
										 v[i].fcontrol="Name";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Name";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientregexp="/^[a-zA-Z0-9-_]*$/";
										 v[i-1].validators[v[i-1].validators.length]=v[i];


										 v[i]=new Object();
										 v[i].type="custom";
										 v[i].name="Check_Domain";
										 v[i].errmsg="Domain is already registered";
										 v[i].fcontrol="Name";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Name";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientfunction="Check_Domain";
										 v[i-1].validators[v[i-1].validators.length]=v[i];
								 
		l=new Object();
		 l.id="ValidationControl_6";
		 l.oktext="Hosting Plan:";
		 l.errtext="Hosting Plan:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("HostingCheck");
		 l.cerrclass="controlerror2";
		 l.cokclass=new Array();
		 l.cokclass[5]="control";
		 f.labels[f.labels.length]=l;
										 
										 v[i]=new Object();
										 v[i].type="custom";
										 v[i].name="HostingCheck";
										 v[i].errmsg="Hosting Plan not selected";
										 v[i].fcontrol="Plan";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Plan";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientfunction="PlanCheck";
										 v[i-1].validators[v[i-1].validators.length]=v[i];

		l=new Object();
		 l.id="ValidationControl_7";
		 l.oktext="Port Number:";
		 l.errtext="Port Number:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("PortCheck","PortCheck2","PortCheck3", "PortCheck4");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[5]="control";
		 f.labels[f.labels.length]=l;
		 
										 v[i]=new Object();
										 v[i].type="required";
										 v[i].name="PortCheck";
										 v[i].errmsg="Port required";
										 v[i].fcontrol="Port";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Port";
										 v[i].minlength=1;
										 v[i].maxlength=-1;
										 v[i].negation=false;
										 v[i].required=true;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 
										 v[i]=new Object();
										 v[i].type="required";
										 v[i].name="PortCheck2";
										 v[i].errmsg="Port has to be 4 digits";
										 v[i].fcontrol="Port";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Port";
										 v[i].minlength=4;
										 v[i].maxlength=4;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 								 
										 v[i]=new Object();
										 v[i].type="regexp";
										 v[i].name="PortCheck3";
										 v[i].errmsg="Port can only be digits";
										 v[i].fcontrol="Port";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Port";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientregexp="/^[0-9]*$/";
										 v[i-1].validators[v[i-1].validators.length]=v[i];	
										 
										 
										 v[i]=new Object();
										 v[i].type="custom";
										 v[i].name="PortCheck4";
										 v[i].errmsg="9998 Port not allowed";
										 v[i].fcontrol="Port";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Port";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientfunction="jsPortCheck";
										 v[i-1].validators[v[i-1].validators.length]=v[i];
										 
										 
	
		 
		 l=new Object();
		 l.id="ValidationControl_8";
		 l.oktext="Contact:";
		 l.errtext="Contact:";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("ContactCheck");
		 l.cerrclass="controlerror";
		 l.cokclass=new Array();
		 l.cokclass[6]="control";
		 f.labels[f.labels.length]=l;
											

										 v[i]=new Object();
										 v[i].type="custom";
										 v[i].name="ContactCheck";
										 v[i].errmsg="Invalid Contact";
										 v[i].fcontrol="Contact";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Contact";
										 v[i].required=false;
										 v[i].negation=false;
										 v[i].clientfunction="ContactCheck";
										 v[i-1].validators[v[i-1].validators.length]=v[i];
		 
		l=new Object();
		 l.id="ValidationControl_9";
		 l.oktext="I agree with the terms of service";
		 l.errtext="I agree with the terms of service";
		 l.okclass="";
		 l.errclass="error";
		 l.validators=new Array("Agreement");
		 f.labels[f.labels.length]=l;
		 
										 v[i]=new Object();
										 v[i].type="required";
										 v[i].name="Agreement";
										 v[i].errmsg="Must agree to terms of service";
										 v[i].fcontrol="Agreement";
										 v[i].control=new Array();
										 v[i].control[v[i].control.length]="Agreement";
										 v[i].minlength=1;
										 v[i].maxlength=-1;
										 v[i].negation=false;
										 v[i-1].validators[v[i-1].validators.length]=v[i];




		vdAllForms[f.name]=f;
	