/* specific form validation 
   author: Yanay.
   
	 for: openrg/info_request.html

*/

// include the generic validation functions. 
// make sure path is right:

function include(script_filename) {
    document.write('<' + 'script');
    document.write(' language="javascript"');
    document.write(' type="text/javascript"');
    document.write(' src="' + script_filename + '">');
    document.write('</' + 'script' + '>');
}
include('../validate_generic.js');


var focus_set;

//-------------------------------------------------------------------------------------------

function vForm(theForm) {

    var why = "";
		focus_set = false;  // when 1st focus is set (1st error detected) - do not keep moving the focus around.
		
		why += notEmpty(theForm.name, "Name", true); 
		why += notEmpty(theForm.company_name, "Company Name", false);
		why += checkEmail(theForm._from_address);
		why += checkWebsite(theForm.company_url, "Company Website");
    why += checkPhone(theForm.phone);
    why += mustSelect(theForm.country, "Country");
/*
		why += checkBoxAny( new Array(theForm.gateway_type_1,theForm.gateway_type_2,theForm.gateway_type_3), 
												"Gateway Type");
*/
		
		
		if(why!="") { display_errors( why ); return false; }

		return true;
}






