// jadedbysophia.com Javascript

function resetform() {
document.forms[0].elements[1]=="";
}

function submitForms() {
if (isEmail() && isFname() && isLocation())
if (confirm("\n You are about to e-mail your submission. \n\nYES to submit.    NO to abort."))
{
alert("\nYour submission will now be sent. Thank you for joining my mailing list!");
return true;
}
else
{
alert("\n You have chosen to abort the submission.");
return false
}
else 
return false;
}

function isEmail() {
if (document.forms[0].elements[1].value == "") {
alert ("\n The E-Mail field is blank. \n\n Please enter your E-Mail address.")
document.forms[0].elements[1].focus();
return false;
}
if (document.forms[0].elements[1].value.indexOf ('@',0) == -1 ||
document.forms[0].elements[1].value.indexOf ('.',0) == -1) {
alert ("\n The E-Mail field requires a \"@\" and a \".\"be used. \n\nPlease re-enter your E-Mail address.")
document.forms[0].elements[1].select();
document.forms[0].elements[1].focus();
return false;
}
return true;
}

function isFname() {
if (document.forms[0].elements[2].value == "")
{
alert ("\n The Name field is blank. \n\n Please enter your name.")
document.forms[0].elements[2].focus();
return false;
}
return true;
}

function isLocation() {
if (document.forms[0].elements[4].value == "") {
alert ("\n The Location field is blank. \n\nPlease enter your location.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=369,height=805,left = 300,top = 5');");
}

function fotoWindow(url)
{
	newwindow=window.open(url,'name','height=700,width=800,left = 150,top = 75');
	if (window.focus) {newwindow.focus()}
}