if ( top.frames.length > 1 ) {
        top.location="/";
}

function openWin(url, name) {
  popupWin = window.open(url, name, 'scrollbars,resizable,width=400,height=420');
}


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_report() {
	if (document.report.from.value.length > 100) {
		alert("EMAIL ADDRESS is not valid");
		document.report.from.focus();
		return false;
	}
	var pat1 = /.*\@utahfishfinder.com/;
	var s = document.report.from.value;
	if (s != "") {
		if (pat1.test(s)) {
			alert("EMAIL ADDRESS is not valid");
			document.signup.from.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.report.from.value;
	if (s != "") {
		if (!pat1.test(s)) {
			alert("EMAIL ADDRESS is not valid");
			document.report.from.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);
}



now = new Date
expireDate = new Date
expireDate.setMonth(expireDate.getMonth()+6)
pageVisit = new Date(cookieVal("pageVisit"))  // today's visit
lastVisit = new Date(cookieVal("lastVisit"))  // previous visit

// if no cookies, make them
if (!lastVisit) {
  document.cookie = "lastVisit="+now+"; expires=" + expireDate.toGMTString()
}
if (!pageVisit) {
  document.cookie = "lastVisit="+now+"; expires=" + expireDate.toGMTString()
}
// don't change cookies unless this is a new day
if (now > pageVisit){
  document.cookie = "lastVisit="+pageVisit+";expires=" + expireDate.toGMTString()
  document.cookie = "pageVisit="+now+";expires=" + expireDate.toGMTString()
}

function cookieVal(cookieName) {
  thisCookie = document.cookie.split("; ")
    for (i=0; i<thisCookie.length; i++) {
      if (cookieName == thisCookie[i].split("=")[0]) {
        return thisCookie[i].split("=")[1]
      }
    }
  return "1 January 1970"
}

function newCheck(yyyy,mm,dd) {
  lastChgd = new Date(yyyy,mm,dd)
  if (lastChgd.getTime() > lastVisit.getTime()) {
    document.write("<img src='/graphics/new.gif' align='left' alt='new'>")
  }
}

