// JavaScript Document

//for contact form
function checkform()
{
	if($F('name') == '')
	{
	alert("Please specify a name");
	$('name').focus();
	return false;
	}
	else if($F('email') == '')
	{
	alert("Please specify an email address");
	$('email').focus();	
	return false;
	}
	else if($F('comments') == '')
	{
	alert("The comments field was left blank.");
	$('comments').focus()	
	return false;
	}		


if(!IsEmail($F('email')))
{
	alert("Invalid Email detected.");
	$('email').focus();	
	return false;	
}

getURL();


}


//===-===-===


function getURL()
{
test = location.href;

test= test.split("/");
str = "";
for(i=0;i<(test.length-1);i++)
{
	if(i == 0)
	str = test[i]+"/";
	else
	str = str + test[i] + "/";
}

$('dbname').value = str;
return true;
}

//===-===-===


function IsEmail(sText)
{

var whereisAT = sText.indexOf('@');

if(whereisAT == -1)
{
	return false;
}
   
var whereisDOT = sText.indexOf('.');  

if(whereisDOT == -1)
{
	return false;
}
  
   return true;
}