function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=500,width=900,scrollbars=yes');
myform.target=windowname;
return true;
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

// count down timer based on http://javascript.internet.com/time-date/countdown-timer-2.html 

var sec = 30;   // set the seconds
var min = 02;   // set the minutes

function countDown() {
  sec--;
  if (sec == -01) {
    sec = 59;
    min = min - 1;
  } else {
   min = min;
  }
if (sec<=9) { sec = "0" + sec; }
  time = (min<=9 ? "0" + min : min) + " min and " + sec + " sec ";
if (document.getElementById) { if(theTime) { theTime.innerHTML = time; } }
  SD=window.setTimeout("countDown();", 1000);
if (min == '00' && sec == '00') { sec = "00"; window.clearTimeout(SD); }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  countDown();
});

// ========= end count down timer

window.defaultStatus="Please bookmark this site while it is fresh in your mind."

function ModE()
{ 
  var item = 1; 
  var m1='mai'; 
  var d='frickers.co.uk'; 
  var m2='lto:'; 
  var m=m1+m2; 
  var a='@'; 
  for (i=1; item; i++) 
  { 
    item=document.getElementById('em-' + i); 
    if (item) 
    { 
      item.innerHTML='<'+'a href='+m+item.title+a+d+'>'+item.title+a+d+'<'+'/a>'; 
    } 
  } 
}

function findRest(u) {
 var p1 = "<a href='"; var d = "&#102;&#114;&#105;&#99;&#107;&#101;&#114;&#115;&#46;&#99;&#111;&#46;&#117;&#107;";
 var t = "&#64;"; var p2 = "mail"; var q = "'>"; var p3 = "to:"; var r = "</a>";
 var a = p1+p2+p3+u+t+d+q+u+t+d+r; document.write(a); }

function Validator(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter your name.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length < 3)
  {
    alert("Please enter your full name.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Subject.value.length < 5)
  {
    alert("Please enter your message.");
    theForm.Message.focus();
    return (false);
  }


  if (theForm.Email.value == "")
  {
    alert("Please enter your email address.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 5)
  {
    alert("Please check your email address because it is not valid.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value != theForm.Email2.value)
  {
    alert("Please check your email addresses because they do not match.");
    theForm.Email.focus();
    return (false);
  }
  return (true);
}

// javascript functions for this page functionality


// Source: CodeFoot.com
// Please leave in this header.

var isReady = false;
function doSaveAs(){
if ((navigator.appName == "Microsoft Internet Explorer") && (document.execCommand)){
if (isReady){document.execCommand("SaveAs");}
}else{
alert('Only works with IE 4+. Please use File | Save As...');
}
}


/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "");
else alert('Feature not available. Please use Ctrl-D or Bookmarks | Bookmark this Page... or similar.')
}
