// rev. 05-11-06

if ( top.frames.length > 1 )
        top.location="/";

function openWin(url, name) {
  popupWin = window.open(url, name, 'scrollbars,resizable,width=400,height=420');
}

// AutoBlink
// Puts Google's Autolink on the Blink :)
// (c) 2005 Chris Ridings http://www.searchguild.com
// Redistribute at will but leave this message intact

var linkcount;
function checklinks() {
  if (!(linkcount==document.links.length)) {
   // Something changed the links!
   // Iterate for an id of _goog
   for (i=0; i < document.links.length; i++) {
    if (document.links[i].id.substring(0,5)=="_goog") {
     // If we find an id of _goog then remove the link!
     var tr = document.links[i].parentTextEdit.createTextRange();
     tr.moveToElementText(document.links[i]);
     tr.execCommand("Unlink",false);
     tr.execCommand("Unselect",false);
    }
   }
  }
   setTimeout("checklinks()",500);
}
if (document.getElementById && document.createElement) {
  linkcount=document.links.length;
  setTimeout("checklinks()",500);
}

var nextPage = false;
function sendIt() {
	if (!nextPage) {
		if (validate()) {
			nextPage = true;
			return true;
		} else {
			return false;
		}
	} else {
			alert("Your form has already been submitted. Please Wait...");
			return false;
	}
}

function validate_signup() {
	if (document.signup.first_name.value == "First name" || document.signup.first_name.value.length < 1 || document.signup.first_name.value == " ") {
		alert("Please enter your FIRST NAME");
		document.signup.first_name.focus();
		return false;
	}
	if (document.signup.email.value == "email@email.com" || document.signup.email.value.length < 1 || document.signup.email.value == " ") {
		alert("Please enter your EMAIL ADDRESS");
		document.signup.email.focus();
		return false;
	}
	var pat1 = /.*\@emeraldbayrecords.com/;
	var s = document.signup.email.value;
	if (s != "") {
		if (pat1.test(s)) {
			alert("EMAIL ADDRESS is not valid");
			document.signup.email.focus();
			return false;
		}
	}
	var pat1 = /^[1-9A-Za-z]+\w*(\.\w+)*\@{1}([1-9A-Za-z]+(\.[1-9A-Za-z]+)*\.[A-Za-z]+)$/;
	var s = document.signup.email.value;
	if (s != "") {
		if (!pat1.test(s)) {
			alert("EMAIL ADDRESS is not valid");
			document.signup.email.focus();
			return false;
		}
	}
}


// AutoBlink
// Puts Google's Autolink on the Blink :)
// (c) 2005 Chris Ridings http://www.searchguild.com
// Redistribute at will but leave this message intact

var linkcount;
function checklinks() {
  if (!(linkcount==document.links.length)) {
   // Something changed the links!
   // Iterate for an id of _goog
   for (i=0; i < document.links.length; i++) {
    if (document.links[i].id.substring(0,5)=="_goog") {
     // If we find an id of _goog then remove the link!
     var tr = document.links[i].parentTextEdit.createTextRange();
     tr.moveToElementText(document.links[i]);
     tr.execCommand("Unlink",false);
     tr.execCommand("Unselect",false);
    }
   }
  }
   setTimeout("checklinks()",500);
}
if (document.getElementById && document.createElement) {
  linkcount=document.links.length;
  setTimeout("checklinks()",500);
}


