
/**
*
* Check if the Url for the submit contains 'popup'.
* For popup Urls call submit2Popup, else display the url 
*
**/
function handleSubmit(theServiceUrl, inputObj) {
	
	if (theServiceUrl.indexOf('popup')> 0){
		return submit2Popup(theServiceUrl,inputObj);
	}
	else if (theServiceUrl.indexOf('map.jsp')>0 && theServiceUrl.indexOf('/vip8/edit/')== 0) {
		return submit2Popup(theServiceUrl,inputObj);
	}
	else if (theServiceUrl.indexOf('efa.jsp')>0 && theServiceUrl.indexOf('/vip8/edit/')== 0) {
		return submit2Popup(theServiceUrl,inputObj);
	}	
	else {
		theUrl = theServiceUrl;
		if (inputObj)
			theUrl = theUrl+"&"+inputObj.name+"="+inputObj.value;
		document.location.href=theUrl;		
	}
	return false;
}


/**
*
* Open a popup window and display a given url
*
**/
function submit2Popup(theServiceUrl, inputObj) {

	theUrl = theServiceUrl;
	if (inputObj)
		theUrl = theUrl+"&"+inputObj.name+"="+inputObj.value;
		
	var MdeServiceWin = open(theUrl,'MdeService','height=600,width=840,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=yes,resizable=yes');

	return false;
}	


/**
*
* Clear the value of an input field if name equals param
*
**/
function clearValue(aInputField, aValue) {
	if (aInputField.value == aValue)
		aInputField.value = "";
	return true;
}
