// ADD ANY NECESSARY JAVASCRIPT HERE, SO THAT IT IS CENTRALIZED RATHER
// THAN BEING PRESENT THROUGHOUT THE JSPs
 
// allowSubmit()
// Prevents multiple clicks of form submit buttons causing parallel-concurrent
// http requests. To enable on a form:
// - include the script in your form:
//   <Script language="JavaScript" src="../../javaScript/jslib.js" ></Script>
// - add form tag attribute onsubmit="return allowSubmit()"
// 

var formSubmitted=false;

function allowSubmit() {
  if ( formSubmitted == false ) {
    formSubmitted = true; 
    return true;
  } else {
    // this form has already been submitted.
    return false; 
  }
}

function makePopupWindow(theURL)
{
	window.open(theURL, null, "width=400, height=300, top=200, left=200, location=no, menubar=no, status=no, toolbar=no, resizable=yes, scrollbars=yes");
}

function validateCreate(){

	var prjName = document.forms["newProjectionForm"].projectionName;
	var prjCatId = document.forms["newProjectionForm"].projectonCatID;

	if(prjName.value == ""){
		alert('Please enter projection name ')	
		prjName.focus();
		
		return false;
	}else if(prjCatId.value == '0'){
		alert('Please select a projection category ')	
		prjCatId.focus();
		
		return false;
	}
	
	//submitAction()
	
	return true;
}

function submitAction(){
	document.forms["newProjectionForm"].projectionCreated.value = 'Create'
	document.forms["newProjectionForm"].submit();
}