/*

This Javascript Source Code is Intellectual Property owned by FrostyLabs LLC. 
You may not do any of the following without prior written permission by FrostyLabs LLC, and not limited to:

duplicate or reuse the Service, Source Code, or any portion of it.
sell, resell, trade, or transfer ownership of the Service or any portion of it. 
take advantage of the Source Code for any profitable purposes.

This property of FrostyLabs LLC is protected through all appropriate laws.

If you have any questions please contact www.FrostyLabs.com

*/

function doOrgSignupSubmit(){

	var type = document.tmp.formType.value;
	if(type=="true"){
		return doOrgSignupNewUser();
	}else{
		return doOrgSignupOldUser();
	}
}

function doOrgSignupOldUser(){

	var r = new Array("firstName", 
								 "lastName", "organizationName", "phone1", "email", 
								 "contactEmail", "street1", "city", "zipCode");

	var t = new Array("text", 
								 "text", "text", "phone", "email", 
								 "email", "text", "text", "zip");

	var s = new Array("l_org_contact_firstname", 
									"l_org_contact_lastname", "l_org_name", "l_org_phone", "l_org_email",
									"l_contact_email", "l_org_street1", "l_org_city", "l_org_zip");
		
	var b = required("orgSignupForm", s, t, r, getDefaultColor(), getRequiredColor());

	var r1 = new Array("fax1");
	var t1 = new Array("phone");
	var s1 = new Array("l_org_fax");
	
	var b2 = invalid("orgSignupForm", s1, t1, r1, getDefaultColor(), getRequiredColor());

	if((!b)&&(!b2)){
		throwError();
	}
	
	return ((b)&&(b2));


}
function doOrgSignupNewUser(){
	var r = new Array("username", "password", "firstName", 
								 "lastName", "organizationName", "phone1", "email", 
								 "contactEmail", "street1", "city", "zipCode");
	var t = new Array("text", "text", "text", 
								 "text", "text", "phone", "email", 
								 "email", "text", "text", "zip");
	var s = new Array("l_org_contact_username", "l_org_contact_password", "l_org_contact_firstname", 
									"l_org_contact_lastname", "l_org_name", "l_org_phone", "l_org_email",
									"l_contact_email", "l_org_street1", "l_org_city", "l_org_zip");
		
	var b = required("orgSignupForm", s, t, r, getDefaultColor(), getRequiredColor());

	var r1 = new Array("fax1");
	var t1 = new Array("phone");
	var s1 = new Array("l_org_fax");
	
	var b2 = invalid("orgSignupForm", s1, t1, r1, getDefaultColor(), getRequiredColor());
	if((!b)&&(!b2)){
		throwError();
	}	
	return ((b)&&(b2));


}