<!--//
function emailCheck(theField){
	var j = theField.value.length;
	var k = j-1;
	var l = j+1;
	var firstChar = 'N';
	var dot = 0;
	var thingy = 0;
	for(var i = 0; i < j; i++){
		var ch = theField.value.substring(i, i+1);
		if (ch == " "){
			alert('Please enter a valid email address.');
			theField.focus();
			theField.select();
			return false;
		}
		if (i ==0 && ch != "@"){
			firstChar = 'Y';
		}
		if (i !=0 && ch == "@"){
			thingy++;
			l = i+1;
			continue;
		}
		if (i != l && i != k && ch == "." && thingy != 0){
			dot++;
			continue;
		}
	}
	if(j > 0){
		if (firstChar == 'N' || dot == 0 || thingy == 0 || thingy > 1){
			alert('Please enter a valid email address.');
			theField.focus();
			theField.select();
			return false;
		} else {
			return true;
		}
	} else {
		return true;
	}
}

function isFieldBlank(theField){
	if(theField.value.length == 0)		
		return true;		
	else			
		return false;	
}

function verify_form(form,regtype){
	if (regtype == 0){
		if(isFieldBlank(form.name)){
			alert('Please enter your name');
			form.name.focus();
		} else if(isFieldBlank(form.address)){
			alert('Please enter your address');
			form.address.focus();
		} else if(isFieldBlank(form.city)){
			alert('Please enter your city');
			form.city.focus();
		} else if(isFieldBlank(form.zip)){
			alert('Please enter your ZIP code');
			form.zip.focus();
		} else if(isFieldBlank(form.email)){
			alert('Please enter your email address');
			form.email.focus();
		} else if(!emailCheck(form.email)){
			form.email.focus();
		} else {
			form.submit();
		}

	}
}

function launch(loc,w,h){
	orderWindow = window.open(loc,"listWindow","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h);
	orderWindow.focus();
}

function launch2(loc,w,h,n){
	orderWindow = window.open(loc,n,"toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h);
	orderWindow.focus();
}


function opener_redirect(loc,closetype){
//	top.opener.parent.frames[1].location.href = loc;
	top.opener.location.href = loc;
	top.opener.focus();
	if(closetype == 1){
		this.window.close();
	}
}

function closeMe(){
	this.window.close();
}

function act(targetName, imgName){
	if (document.images){ 
		document[targetName].src = eval(imgName + ".src");
		return;
	}
}

// -->
