// JavaScript Document

function openNotice(noticeID) {
var win=window.open('http://newsandevents.scnetwork.com/scnetwork_redesign/actors_and_models/viewNotice.asp?id='+noticeID,'Details','width=610,height=350,location=no,toolbars=no,status=no,scrollbars=yes');
	win.focus();
	}

function checkEmail (value) {

var strng=value;
			var error="";
			if (strng == "") {
						error = "You didn't enter an email address.\n";
			}
		
						var emailFilter=/^.+@.+\..{2,3}$/;        
						if (!(emailFilter.test(strng))) { 
									error = "Please enter a valid email address.\n";
						} 
						else {
				var x=0;
			for(i=0; i<strng.length; i++) {
					if (strng.charAt(i)=="@") {
						x++;
						}			
				}
				if (x>1) {
										error = "Please enter a valid email address.\n";
								} 
				//test email for illegal characters
							var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;
							if (strng.match(illegalChars)) {
										error = "The email address contains illegal characters.\n";
							}
					}
	
				return error;
 
}


// for the collection email
function checkEmailField(theForm) {
var intro, outro;
			var why="";
					if (checkEmail(theForm.email.value)!="") why+=checkEmail(theForm.email.value);
			
			intro="We couldn't add you to the list because:\r\r";
			outro="\r\rPlease correct and try again.";

			if (why!="") {
					alert(why); 
					return false;
			} else {
					return true;
			}
}
function newsandeventsURL() {
location="http://newsandevents.scnetwork.com/scnetwork_redesign/news/index.asp";
}


urlPrefix='http://newsandevents.scnetwork.com/scnetwork_redesign/'; // located in subNav.js ALSO

function fullSize(what) {
	// for the popup images
window.open(urlPrefix+"/popups/popUpWindowFrame.asp?what="+what,"Close_Up","width=800,height=500,location=no,toolbar=no");
}

