<!--

var formInputsNotEmpty = "";
var formInputsEmailAddress = "";
var formInputsNumericOnly = "";
var runExtraFormChecks = false;

function submitFormValue(obj,formnb,val) {
//	if ( 1 ) {
	if ( checkForm(formnb) ) {
		if ( !obj.disabled && document.forms[formnb] ) {
			if ( obj && document.forms[formnb].elements["submitp"] ) {
				document.forms[formnb].elements["submitp"].value = obj.name;
			}
			if ( document.forms[formnb].elements["submitpval"] ) {
				if ( val != "" ) 
					document.forms[formnb].elements["submitpval"].value = val;
				else if ( obj.value != undefined) 
					document.forms[formnb].elements["submitpval"].value = obj.value;
			}
			document.forms[formnb].submit();
		}
		if ( obj.type == "image" )
			obj.disabled = true;
	}
}
function submitForm(obj,formnb) {
	submitFormValue(obj,formnb,'');
	return false;
}
		
function checkForm(formnb) {
	if ( runExtraFormChecks ) {
		if ( !extraFormChecks() ) {
			return false;
		}
	}
	var tags = formInputsNotEmpty.split('#');
	for(i=0; i< tags.length; i++ ) {
		var details = tags[i].split('|',2);
		if (document.mainForm.elements[details[0]] && details[0] != '' && document.mainForm.elements[details[0]].value == '') {
			alert(details[1]);
			document.mainForm.elements[details[0]].focus();
			return false;
		}
	}
	tags = formInputsEmailAddress.split('#');
	for(i=0; i< tags.length; i++ ) {
		var details = tags[i].split('|',2);
		if (document.mainForm.elements[details[0]] && details[0] != '' && !(new String(document.mainForm.elements[details[0]].value)).match("^.+@{1}.+\\..+$")) {
			alert(details[1]);
			document.mainForm.elements[details[0]].focus();
			return false;
		}
	}
	tags = formInputsNumericOnly.split('#');
	for(i=0; i< tags.length; i++ ) {
		var details = tags[i].split('|',2);
		if (document.mainForm.elements[details[0]] && details[0] != '' && !(new String(document.mainForm.elements[details[0]].value)).match("^\\d+\\.*\\,*\\d*$")) {
			alert(details[1]);
			document.mainForm.elements[details[0]].focus();
			return false;
		}
	}
	return true;
}

/*
	This has to be added in your xml to be able to use the helpbox

	<!-- The default hidden help bubble (this is ahidden layer) -->
	<div style="position:absolute; display:none" id="helpbox">
		<table width="200" border="0" cellspacing="0" cellpadding="1">
		  <tr>
		    <td bgcolor="#CCCCCC"><table width="200" border="0" cellspacing="0" cellpadding="7">
		      <tr>
		        <td bgcolor="#FFFFCC"><div id="bob" style="font-family: Verdana; font-size: 10px; color: #444444; text-decoration: none; line-height:15px;	font-weight: normal;"></div><div id="blubber" style="font-family: Verdana; font-size: 10px; color: #444444; text-decoration: none; line-height:15px;	font-weight: normal;"></div></td>
		      </tr>
		    </table></td>
		  </tr>
		</table>
	</div>

*/
 function helpbox( title, msg ){
 
	 var x = window.event.x;
	 var y = window.event.y;

 
		///alert( event.x + "," + event.y + "--" + docs );

	 document.all.helpbox.style.display = '';
	 document.all.helpbox.style.left = (x + window.document.body.scrollLeft) + 8;
	 document.all.helpbox.style.top  = (y + window.document.body.scrollTop) + 2;	 	
 	
 	
	var bob = document.getElementById('bob');
 	bob.style.display = '';
 	bob.innerHTML = '<strong>'+title+'</strong>';
 	var blubber = document.getElementById('blubber');
 	blubber.style.display = '';
 	blubber.innerHTML = msg;
 }
 function helpboxoff(){
 	var helpbox = document.getElementById('helpbox');	 
 	helpbox.style.display = 'none';	 
 }

function openWindow(theURL,winName,features) { 
        self.name = "mainWindow"; 
        window.open(theURL,winName,features);
}
function closeWindow() {
        window.close();
}
function go(url) {
	document.location = url;
}

function showDiv( divId ){
	var obj = document.getElementById(divId);
	if ( obj ) {
		obj.style.display = '';
	}
}

function hideDiv( divId ){
	var obj = document.getElementById(divId);
	if ( obj ) {
		obj.style.display = 'none';
	}
}

function loadImageSrc(imageId,sourceImage) {

	var image = document.getElementById(imageId);
	if (image) {
		image.src = sourceImage.src;
	}
}

// -->
