// JavaScript Document
		
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.p = navigator.platform
	this.ie = (this.b=="ie" && this.v>=4 && this.p=="Win32")
	this.ns = (this.b=="ns" && this.v>=4)
	this.three = (this.v < 4)
}

function getAttr(height,width){
	if (ns) {
		 // Center on the main window.
		 dialogleft = window.screenX + ((window.outerWidth - width) / 2);
		 dialogtop = window.screenY + ((window.outerHeight - height) / 2);
		 var attr = "screenX=" + dialogleft + ",screenY=" + dialogtop + ",width=" + width + ",height=" + height;
	  } else if (ie){
		 // The best we can do is center in screen.
		 dialogleft = (screen.width - width) / 2;
		 dialogtop = (screen.height - height) / 2;
		 var attr = "left=" + dialogleft + ",top=" + dialogtop + ",width=" + width + ",height=" + height;
	  } else {
		 var attr = "width=" + width + ",height=" + height;
	  }
	  return (attr);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function changeImages2() {
	if(hasFlash == 'plugin'){
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages2.arguments.length; i+=2) {
				document[changeImages2.arguments[i]].src = changeImages2.arguments[i+1];
			}
		}
	}
}

function preloadImages() {
	if (document.images) {
		demoButton_over = newImage("demoButton-over.gif");
		demoButton_swap = newImage("getFlash.gif");

		preloadFlag = true;
		
		if(hasFlash == 'no'){
				changeImages('demoButton', 'getFlash.gif'); return true;
				lemmeIn_over = newImage("lemmeIn-over.gif");
				changeImages('lemmeIn', 'lemmeIn.gif'); return true;
		}
		

	}
}

function val_contactus(fname, email) {
	//alert('fname is: '+fname+', lname is: '+lname+' ,email is: '+email);
	if (fname.length < 2){
		alert('You must include a first name with at least 2 characters!'); 
		return false;
	}
	else {
		if (email.length < 7){
			alert('You must enter an email address!'); 
			return false;
		}
		else{
			return true;
		}
	}
}

function val_supportform(fname, occupation, email, phone, address, city, state ,zip) {
	//alert('fname is: '+fname+', lname is: '+lname+' ,email is: '+email);
	if (fname.length < 5){
		alert('You must include a NAME with at least 5 characters!'); 
		return false;
	}
	else {
		if (occupation.length < 5){
			alert('You must include an OCCUPATION with at least 5 characters!'); 
			return false;
		}
		else {
			if (email.length < 7){
				alert('You must enter an email address (i.e. abc@123.com)!'); 
				return false;
			}
			else {
				if (phone.length < 10){
					alert('You must enter a PHONE NUMBER with a least 10 characters (i.e. 555-555-55555)!'); 
					return false;
				}
				else {
					if (address.length < 7){
						alert('You must enter an ADDRESS with a least 7 characters (123 A St.)!'); 
						return false;
					}
					else {
						if (city.length < 2){
							alert('You must enter a CITY with a least 2 characters!'); 
							return false;
						}
						else {
							if (state.length < 2){
								alert('You must enter a STATE with a least 2 characters!'); 
								return false;
							}
							else {
								if (zip.length < 5){
									alert('You must enter a ZIP CODE with a least 5 numbers!'); 
									return false;
								}
								else{
									return true;
								}
							}
						}
					}
				}
			}
		}
	}
}

function val_volunteerform(fname, email, phone, address, city, state ,zip,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10) {
	//alert('v1 is: '+v1+', v2 is: '+v2);
	if (fname.length < 5){
		alert('You must include a NAME with at least 5 characters!'); 
		return false;
	}
	else {
		if (email.length < 7){
			alert('You must enter an email address (i.e. abc@123.com)!'); 
			return false;
		}
		else {
			if (phone.length < 10){
				alert('You must enter a PHONE NUMBER with a least 10 characters (i.e. 555-555-55555)!'); 
				return false;
			}
			else {
				if (address.length < 7){
					alert('You must enter an ADDRESS with a least 7 characters (123 A St.)!'); 
					return false;
				}
				else {
					if (city.length < 2){
						alert('You must enter a CITY with a least 2 characters!'); 
						return false;
					}
					else {
						if (state.length < 2){
							alert('You must enter a STATE with a least 2 characters!'); 
							return false;
						}
						else {
							if (zip.length < 5){
								alert('You must enter a ZIP CODE with a least 5 numbers!'); 
								return false;
							}
							else {
								if (v1 == false  && v2 ==false && v3 ==false && v4 ==false && v5 ==false && v6 ==false && v7 ==false && v8 ==false && v9 ==false && v10 ==false){
									alert('You must select a volunteer activity.'); 
									return false;
								}
								else{
									return true;
								}
							}
						}
					}
				}
			}
		}
	}
}
		
