function movie_win(filename,pagetitle,ext_link){

	moviewin = null;
	if (!window.moviewin){

		moviewin = window.open("/films/?file="+filename+"&title="+pagetitle+"&ext="+ext_link,"new_win","width=520,height=420,menubar=0,toolbar=0,scrollbars=0,resizable=0");

		/*
		Check to see whether the browser supports DOM / layers:
		document.all: For Internet Explorer only
		document.layers: For Netscape 4 or earlier
		document.getElementById: For Netscape 6 and up
		*/

		if (document.all || document.layers || document.getElementById) {
			moviewin.moveTo((screen.availWidth/2)-260,(screen.availHeight/2)-210);
			moviewin.focus();
		}
	} else {
		moviewin.focus();
	}
}



function news_win(page){

	newswin = null;
	if (!window.newswin){
		newswin = window.open(page,"article","width=760,height=400,menubar=0,toolbar=0,scrollbars=1,resizable=1");

		/*
		Check to see whether the browser supports DOM / layers:
		document.all: For Internet Explorer only
		document.layers: For Netscape 4 or earlier
		document.getElementById: For Netscape 6 and up
		*/
		if (document.all || document.layers || document.getElementById) {

			newswin.moveTo((screen.availWidth/2)-380,(screen.availHeight/2)-200);
			newswin.focus();
		}
	} else {
		newswin.focus();
	}
}



function showpic(filename,winwidth,winheight){

	picwin = null;
	if (!window.picwin){
		picwin = window.open(filename,"Image","width="+winwidth+",height="+winheight+",menubar=0,toolbar=0,scrollbars=0,resizable=0");

		/*
		Check to see whether the browser supports DOM / layers:
		document.all: For Internet Explorer only
		document.layers: For Netscape 4 or earlier
		document.getElementById: For Netscape 6 and up
		*/
		if (document.all || document.layers || document.getElementById) {

			picwin.moveTo((screen.availWidth/2)-250,(screen.availHeight/2)-175);
			picwin.focus();
		}
	} else {
		picwin.focus();
	}


}



function explain() {

	window.open("blur.html","explain","width=450,height=360,menubar=0,scrollbars=0,location=0");
}




function isEmail(the_field) {

var testing = true;
var formField = the_field;
var strLength = formField.length;
var ii = 1;

	if (formField.length <= '5')
		{
		testing = false;
		}
	else
		{	
	for (i = 0; i < formField.length; i++)
		{
		
        if (formField.indexOf(" ") != -1)
			{
			testing = false;
			}
		}
    while ((ii < strLength) && (formField.charAt(ii) != "@"))
    {
	ii++;
	}

    if ((ii >= strLength) || (formField.charAt(ii) != "@"))
	{
	testing = false;
	}
    else
	{
	ii += 2;
	}
	
    while ((ii < strLength) && (formField.charAt(ii) != "."))
    {
	ii++;
    }
	
    if ((ii >= strLength - 2) || (formField.charAt(ii) != "."))
	{
	testing = false;
	}
}
	if (testing == true)
	{
	return true;
	}
	else
	{
		if(testing == false)
		{
		alert('Please enter a valid email address.');
		return false;
		}
	}
	
}


function validate(){

	if(
	document.forms[1].firstname.value.length > 0 &&
	document.forms[1].lastname.value.length > 0 &&
	document.forms[1].email.value.length > 0){

		if(isEmail(document.forms[1].email.value) == true){

			document.forms[1].submit();
		}

	}else{
		alert("You didn't enter all the required information.");
	}
}

