


function get_form_value(id){

	var w3c = document.getElementById ? true : false;
	var iex = document.all ? true : false;
	var ns4 = document.layers ? true : false;
	
	try{
		if(w3c){return  document.getElementById(id).value;}
		else {return document.all[id].value;}
	}
	catch(e){
		alert('get_form_value ' + id);
	}
}

function check_age_range()	{
	
		var lo, hi;
		
		lo = document.getElementById('form_age_lo').value;
		hi = document.getElementById('form_age_hi').value;
		
		if(lo > hi){
			alert('From age must not be less than to age.');
			document.getElementById('form_age_lo').focus();
			document.getElementById('form_age_lo').style.backgroundColor = '#ffff00';
			return false;
		}else{
			return true;
		}
		
}

//	it seems that netscape for whatever reason doesn't display textareas the same
//	as ie...to that end we'll shrink the textarea when netscape is active

function fix_textarea() {

	if ((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)>=5))
	{
		var theform = document.forms[0]
		for (var i = 0; i < theform.elements.length; i++) 
		{
			if ((theform.elements[i].type == 'textarea')) 
			{
			    theform.elements[i].cols -= 5;
			    theform.elements[i].rows -= 2;
			}
		}
    }
}

function Right(str, n) {
    if (n <= 0){return "";}    // Invalid bound, return blank string
    if (n > String(str).length){return str;}   // Invalid bound, return entire string
    var iLen = String(str).length;
    return String(str).substring(iLen, iLen - n);
}

function Left(str, n){
    if (n <= 0){  return "";}   // Invalid bound, return blank string
	if (n > String(str).length){return str;}   // Invalid bound, return entire string
    return String(str).substring(0,n);
}
