// JavaScript Document
<!-- Begin
function breakout(URL){
	if (window.top != window.self) 
 	{
 	 window.top.location=URL
 	}
}
// End -->

<!-- Popup window for map -->
<!-- Idea by:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL:  http://fineline.xs.mw -->

<!-- Begin
function popUpMap(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=900,height=600,left = 50,top = 50');");
}
// End -->

<!-- Begin
function PopUpNav(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=900,height=900,left=50%,top = 50');");
}
// End -->


//Script to validate email send form
function validate_form ( ) 
{ 
var valid = true; 
if ( document.form1.Name.value == "") 
{ 
alert ( "Your Name Is Missing." ); 
valid = false; 
} 
return valid; 
} 

function emailCheck (emailStr) { 
var checkTLD=0; 
var knownDomsPat=/ ^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/; 
var emailPat=/^(.+)@(.+)$/; 
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]"; 
var validChars="\[^\\s" + specialChars + "\]"; 
var quotedUser="(\"[^\"]*\")"; 
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; 
var atom=validChars + '+'; 
var word="(" + atom + "|" + quotedUser + ")"; 
var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); 
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); 
var matchArray=emailStr.match(emailPat); 
if (matchArray==null) { 
alert("The Email Address Is Invalid"); 
return false; 
} 
var user=matchArray[1]; 
var domain=matchArray[2]; 
for (i=0; i<user.length; i++) { 
if (user.charCodeAt(i)>127) { 
alert("The Username Contains Invalid Characters."); 
return false; 
} 
} 
for (i=0; i<domain.length; i++) { 
if (domain.charCodeAt(i)>127) { 
alert("Ths Domain Name Contains Invalid Characters."); 
return false; 
} 
} 
if (user.match(userPat)==null) { 
alert("The Username Is Invalid."); 
return false; 
} 
var IPArray=domain.match(ipDomainPat); 
if (IPArray!=null) { 
for (var i=1;i<=4;i++) { 
if (IPArray>255) { 
alert("The Destination IP Address Is Invalid."); 
return false; 
} 
} 
return true; 
} 
var atomPat=new RegExp("^" + atom + "$"); 
var domArr=domain.split("."); 
var len=domArr.length; 
for (i=0;i<len;i++) { 
if (domArr[i].search(atomPat)==-1) { 
alert("The Domain Name Is Invalid."); 
return false; 
} 
} 
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) { 
alert("The Domain Name Extension Is Invalid"); 
return false; 
} 
if (len<2) { 
alert("The Address Is Missing A Hostname."); 
return false; 
}
return true;
} 

var counter=0; 
function isReady() {
var _ret=false;
if (validate_form())
  _ret=true;
if(emailCheck(document.form1.Email.value))
  _ret=true;
else
  _ret=false;
if(_ret)
  //if(counter++)
  //{
   // _ret=false;
    //alert('The Form Is Already Being Submitted'); 
  //}
  //else
  if(confirm("You are about to SEND this item\nDo you wish to continue?")){
  
    _ret=true;
	//alert(_ret);
	return _ret; 
  }
  else
      _ret=false;
	//alert(_ret);
	return _ret; 
  
}  
// End script to validate email send form-->