<!--
//************ Start Default Commands ************
var h = "hidden";
var v = "visible";
var db = "block";
var dn = "none";
var graphic = "";   
var isNS4 = 0; var isIE4 = 0; var isNS6 = 0; var isNew = 0;
var docObj, styleObj, currObj, cstyleObj;

var bVer = (parseInt(navigator.appVersion));
var bName = navigator.appName;
var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));

if (bName == "Netscape" && bVer >= 3) version = "js";
else if (bName == "Microsoft Internet Explorer" && bVer >= 4) version = "js";
else if (bName == "Netscape" && bVer == 2) version = "no";
else if (bName == "Microsoft Internet Explorer" && bVer >= 2) version = "no";

if (parseInt(navigator.appVersion >= 5)){isNew = 1}
else if (brow == "Netscape4") {isNS4 = 1;}
else if (brow == "Netscape5") {isNS6 = 1;}
else if (brow == "Microsoft Internet Explorer4") {isIE4 = 1;}
				
if (isNS4||isNS6||isIE4||isNew) {
  if(isNS4){ docObj = "document."; }
  else if(isNS6){ docObj = "document.getElementById('"; }
  else { docObj = "document.all."; }

  if(isNS4){ styleObj = ""; }
  else if(isNS6){ styleObj = "').style"; }
  else { styleObj = ".style"; }
  
  if(isNS4){ cstyleObj = ""; }
  else if(isNS6){ cstyleObj = "').currentStyle"; }
  else { cstyleObj = ".currentStyle"; }
}

function getQuery(val){
  var querystring = location.search.substring(1,location.search.length);
  var o = "";
  var tSec = querystring.indexOf(val+"=");
  var tStr = querystring.substring( (tSec+(val.length+1)),querystring.length);
  
  if(tSec != -1){
    if(tStr.indexOf('&') != -1){
      o = tStr.substring(0,tStr.indexOf('&'));
    } else {
      o = tStr;
    }
  }
  return o;
}

function replaceSubstring(s,f,w){
  rtn = "";
  flg = 0;
  
  for(i = 0; i < s.length; i++){
    if(s.substr(i,f.length) == f){
      rtn += w;
      i += (f.length - 1);
    } else {
      rtn += s.charAt(i);
    }
  }
  
  return (rtn);
}

function writeFlash(fName,bg,w,h){
  if( (navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4) ){
    document.write('<embed src="' + fName + '" quality="high" bgcolor="#' + bg + '" WIDTH="' + w + '" HEIGHT="' + h + '" NAME="header" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" />');
  } else {
    document.write('<OBJECT data="' + fName + '" width="' + w + '" height="' + h + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" codetype="application/x-shockwave-flash">');
    document.write(' <PARAM NAME="movie" VALUE="' + fName + '" />');
    document.write(' <PARAM NAME="quality" VALUE="high" />');
    document.write(' <PARAM NAME="bgcolor" VALUE="#' + bg + '" />');
    document.write(' <PARAM NAME="menu" VALUE="false" />');
    document.write(' <PARAM NAME="allowScriptAccess" VALUE="sameDomain" />');
    document.write(' <embed src="' + fName + '" quality="high" bgcolor="#' + bg + '" WIDTH="' + w + '" HEIGHT="' + h + '" NAME="header" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</OBJECT>');
  }
}

function openPopup(URL,id,width,height){
  window.open(URL, id, "toolbar=no,location=no,width="+width+",height="+height+",status=yes,scrollbars=yes,scrolling=yes,menubar=no,resizable=yes");
}

function openPopupLocked(URL,id,width,height){
  window.open(URL, id, "toolbar=no,location=no,width="+width+",height="+height+",status=yes,scrollbars=yes,scrolling=yes,menubar=no,resizable=no");
}

function goPage(u){
  location.href = u;
}

function layerChange(tmpLayer,tmpVisible) {
  if (isNS4||isNS6||isIE4||isNew) { eval(docObj + tmpLayer + styleObj + '.visibility = ' + tmpVisible) }
}

function displayChange(tmpLayer,tmpVisible) {
  if (isNS4||isNS6||isIE4||isNew) { eval(docObj + tmpLayer + styleObj + '.display = ' + tmpVisible) }
}

function rollover(graphic,state) {
  if(state==1){ if (version == "js") { document[graphic].src = "/graphics/" + graphic + "_dn.gif" } }
  if(state==0){ if (version == "js") { document[graphic].src = "/graphics/" + graphic + "_up.gif" } }
}

function imageover(graphic,filename) {
  if (version == "js") { document[graphic].src = "/graphics/" + filename }
}

function inputover(graphic,state) {
  if(state==1){ if (version == "js") { document.getElementById(graphic).src = "/graphics/" + graphic + "_dn.gif" } }
  if(state==0){ if (version == "js") { document.getElementById(graphic).src = "/graphics/" + graphic + "_up.gif" } }
}

function clearText(f,t,d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];
  var ele = doc.elements[f].value;

  if(ele == t){
    doc.elements[f].value = "";
  }
}
//************ End Default Commands ************

/********************************************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)  *
* This notice MUST stay intact for legal use                        *
* Visit http://www.dynamicdrive.com/ for this script and 100s more. *
*********************************************************************/

var delayb4scroll = 2000; //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed = 1; //Specify marquee scroll speed (larger is faster 1-10)
var pauseit = 1; //Pause marquee onMousever (0=no. 1=yes)?
var copyspeed = marqueespeed;
var pausespeed=(pauseit==0)? copyspeed: 0;
var actualheight='';

function scrollmarquee(){
  if(parseInt(cross_marquee.style.top)>((actualheight*(-1)+8))/2){ //if scroller hasn't reached the end of its height
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"; //move scroller upwards
  } else {
    cross_marquee.style.top="2px"; //else, reset to original position
  }
}

function initializemarquee(){
  cross_marquee=document.getElementById("event_list")
  cross_marquee.style.top=0
  marqueeheight=document.getElementById("event_container").offsetHeight
  actualheight=cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view)
  if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
    cross_marquee.style.height=marqueeheight+"px"
    cross_marquee.style.overflow="scroll"
    return
  }
  setTimeout('lefttime=setInterval("scrollmarquee()",40)', delayb4scroll)
}

//************ End Scroller Functions ************

//************ Start Validation Functions ************
function setFocus(f,d){
  document.forms[d].elements[f].focus();
}

function testEmail(f,d){
  var a = document.forms[d].elements[f].value;
  var at = a.indexOf("@")
  var name = a.substring(0, at)
  var isp = a.substring(at + 1, a.length)
  var dot = a.lastIndexOf(".")

  if (at == -1 || at == 0 || name == "" || isp == "" || dot == -1 || dot == (a.length - 1)) {
    alert('You must enter a valid email address');
    setFocus(f,d);
  } else {
    return true;
  }
}

function testText(f,t,c,d){
  if( (document.forms[d].elements[f].value != "") && (document.forms[d].elements[f].value != c) ){
    return true;
  } else {
    alert('You must enter ' + t);
    setFocus(f,d);
  }
}

function testSelect(f,t,d){
  var a = document.forms[d].elements[f];
  if( (a.selectedIndex >= 0) && (a.options[a.selectedIndex].value != "") ){
    return true;
  } else {
    alert('You must select a ' + t);
    setFocus(f,d);
  }
}

function testCheck(f,l,d){
  var a = document.forms[d].elements[f];
  var str = "";

  for(i = 0; i < a.length; i++){
    if(a[i].checked == true){
      str = "yes";
	break;
    } else {
      str = "no";
    }
  }

  if(str == "yes"){
    return true;
  } else {
    alert('You must select a ' + t);
  }
}
//************ End Validation Functions ************

//************ Start General Functions ************
function printPage(){
  window.print();
}

function loginScripts(){
  var doc = document.forms['scripts_login'];
  
  if( (doc.username.value != "" && doc.username.value != "name") && (doc.password.value != "") ){
    doc.action.value = "scripts_login";
    doc.submit();
  } else {
    alert('You must enter your username and password.');
  }
}

function submitEnquiry(d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];

  if( testText('firstname','your first name','First name',d) && testText('lastname','your last name','Last name',d) && testEmail('emailaddress',d) ){
    doc.action.value = "submitenquiry";
    doc.submit();
  }
}

function forgotPassword(d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];

  if( testEmail('emailaddress',d) ){
    doc.action.value = "submitforgot";
    doc.submit();
  }
}

function validateRegister(d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];

  if( testText('name','your name','Name',d) && testEmail('emailaddress',d) && testText('telephone','your telephone number','Telephone',d) && testText('company','your company name','Company',d) && testText('username','a username','username',d) && testText('password','a password','Password',d) && testText('confirm_password','a confirmation password','Confirm Password',d) ){
    if( doc.password.value == doc.confirm_password.value){
      doc.action.value = "submitregister";
      doc.submit();
    } else {
      alert('Please make sure that your passwords match');
      setFocus('password',d);
    }
  }
}

function validateUpdate(d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];

  if( testText('name','your name','Name',d) && testEmail('emailaddress',d) && testText('telephone','your telephone number','Telephone',d) && testText('company','your company name','Company',d) ){
    doc.action.value = "submitregister";
    doc.submit();
  }
}

function launchCalendar(y,m,d,t){
  location.href = "/scripts/" + document.forms[0].ScriptNum.value + "/" + y + "/" + m + "/" + d + "/" + t;
}

function submitSearch(d,s){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];

  if( testText(s,'a search query','',d) ){
    location.href = "/search/" + doc.ScriptNum.value + "/" + doc.YearKey.options[doc.YearKey.selectedIndex].value + "/" + replaceSubstring(doc.elements[s].value,' ','+') + "/";
  }
}

function setupRightsTable(){
  if(document.getElementById){
    if(document.getElementById('rightstable')){
      var tbl = document.getElementById('rightstable');
      var rows = tbl.getElementsByTagName('tr');
      var j = 0;

      for(i=0; i < rows.length; i++){
        var ele = rows[i];

        if(ele.className == "row"){
          j = 0;
        } else {
          if((j%2) == 0){
            ele.className = "rights_odd";
          }
          j++;
        }
      }
    }
  }
}



//-->