// sign up form validation


	var defaultText = "hello sasha"
	function popWin() {
	//need to build query string here
	//so that the cgi will be able to decode the value of the "from" field
	qstring = "?email="+document.myform.email.value+"&site=Sciencecore"
	//load the form location and the query string into a variable
	url = "http://ci.columbia.edu/cgi-bin/dkv/emlist/news_ck" + qstring
	//adjust "props" as needed by changing the width, height, or
	//by adding other window properties, such as scrollbars
	props = "width=200,height=200";
	window.open(url,"formval",props)
	}
	function validatit() {
	//test if "email" field is empty or contains the default text
	if(document.myform.email.value == '' || document.myform.email.value == defaultText) {
		alert('Please enter your email.')
		return false;
		}
	//test if "email" contains an @ sign. might want to 
	//make this email validation more sophisticated or remove it.
	else if(document.myform.email.value.indexOf("@") == -1) { 
		
		alert('Please enter a valid email address.')
		return false;
	}
	//alert(document.myform.email.value)
	}

function openAnimation(url,winname) {
topWin = (screen.availHeight - 750) / 2;
leftWin = (screen.availWidth - 440) / 2;
props="scrollbars=yes,status=yes,width=740,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
var myPop = window.open(url,winname,props);
myPop.focus();
}

function openTr(url,winname) {
topWin = (screen.availHeight - 500) / 2;
leftWin = (screen.availWidth - 550) / 2;
props="scrollbars=yes,status=yes,width=500,height=550,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
var myTrPop = window.open(url,winname,props);
myTrPop.focus();
}

function openVid(url,winname) {
topWin = (screen.availHeight - 500) / 2;
leftWin = (screen.availWidth - 400) / 2;
props="scrollbars=yes,status=yes,width=590,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
var myVidPop = window.open(url,winname,props);
myVidPop.focus();
}

function openWin(url,winname,w,h) {
topWin = (screen.availHeight - h) / 2;
leftWin = (screen.availWidth - w) / 2;
props="scrollbars=yes,status=yes,width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
var myVidPop = window.open(url,winname,props);
myVidPop.focus();
}
