function Validator(theForm) {
	if(!validateModel(theForm.model,"Please choose a model"))  {return(false);}
	if(!validateChoice(theForm.choice,"Choose a type of abundances"))  {return(false);}		
	if(!validatePotent(theForm.pot1))  {return(false);}        
	if(!validateKinetic(theForm.kin,"Please enter the kinetic energy"))  {return(false);}
	

}

function IsNumeric(ff) {
	var checkOK = "0123456789";
	var checkStr = ff;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
		
	}
	return (allValid);
}


function validateModel(f,msg){
	if (f.selectedIndex <0){
	alert(msg);
	f.focus();
	return false;
		}

	return true;
       }
function validateChoice(f,msg){
	if (f.selectedIndex <0){
	alert(msg);
	f.focus();
	return false;
		}

	return true;
       }


function validatePotent(f){
	if (f.value =="" || f.value.length == 0) {
	alert("Please  enter:  Modulation potential.");
	f.focus();
	return false;
		}

	else if(!IsNumeric(f.value)) {
	alert("Please use only numerical data for Modulation potential.");
	f.select();
	f.focus();
	return (false);
	}


	return true;
       }

function validateKinetic(f,msg){
	if (f.value =="" || f.value.length == 0){
	alert(msg);
	f.focus();
	return false;
		}

	else {
		for(x=0;x<f.value.length;x++){
		if(f.value.charAt(x)!=" "){
				return (true);
			}
		}
	alert(msg);
	f.select();
	f.focus();
	return (false);
	}			

	return true;
       }



function clock(){
today=new Date();
return today.toLocalString();
}


function Clear(){
 window.location="forms.HTML";
}

function FlinkBar( tableCellRef, hoverFlag, flinkStyle ) {
	if ( hoverFlag ) {
		switch ( flinkStyle ) {

case 1:
				if(navigator.appName=="Netscape"||navigator.appName=="Mozilla") {
				tableCellRef.style.backgroundColor = '#0066cc';
				}
				else {
				tableCellRef.style.backgroundColor = '#0066cc';
				}
				
				tableCellRef.style.Color = '#fff';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
				}

		}
	} else {
		switch ( flinkStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#ffffff';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
				}
		}
	}
}

function FlinkBarClick( tableCellRef, navStyle, url ) {
	FlinkBar( tableCellRef, 0, navStyle );
	Flink_goTo( url );
}

function Flink_goTo( url ) {
	window.location.href = url;
}

function FlinkBarClick1( tableCellRef, navStyle, opt ) {
	FlinkBar( tableCellRef, 0, navStyle );
	theForm.model.size=3;
	theForm.model.selectedIndex=opt;
	window.location.href = '#000';
}




function FlinkBar1( tableCellRef, hoverFlag, flinkStyle ) {
	if ( hoverFlag ) {
		switch ( flinkStyle ) {

case 1:
				if(navigator.appName=="Netscape"||navigator.appName=="Mozilla") {
				tableCellRef.style.backgroundColor = '#0066cc';
				}
				else {
				tableCellRef.style.backgroundColor = '#0066cc';
				}
				
				tableCellRef.style.Color = '#fff';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
				}

		}
	} else {
		switch ( flinkStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#ffffff';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
				}
		}
	}
}







