// javascript.js
// This file contains the common JavaScript functons used on the home sites of
// RAZZIE.PLUS.COM and RAZ.CO.UK
// This file is stored on RAZ.CO.UK for convienience
// Written by Darrell Edgley, 21st May 1999
// Copyright (C) 1999, 2000, 2001, Raz Associates Limited, http://www.raz.co.uk
// This file may be used as long as the above copyright notice appears in the file.

var i         = 0 ;
var totalPics = 0 ;
var title     = ' ' ;
var footnote  = ' ' ;
var pictures  = ' ' ;
images = new Array

function makeArray(n) {
  this.length = n ;
  return this ;
}

var dayNames   = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dayNumber  = new Array("1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th","17th","18th","19th","20th","21st","22nd","23rd","24th","25th","26th","27th","28th","29th","30th","31st");

function lastChange() {
  update = new Date(document.lastModified) ;

  var theDay   = dayNames[update.getDay()] ;
  var theMonth = monthNames[update.getMonth()] ;
  var theDayNo = dayNumber[update.getDate() -1] ;
  var theYear  = update.getYear() ;

  if (theYear <= 900) {
    // Handle 20th century years if there are any .... ;
    // This is for browsers that have a year of 99, 100, 101 etc
    theYear = theYear + 1900 ;
  }
  
  if (theYear <= 1980) {
    // Handle 20th century years if there are any .... ;
    // This is for browsers that have a year of 99, 00, 01 etc
    theYear = theYear + 100 ;
  }

//  document.writeln(theDay + ' ' + theMonth + ' ' + theDayNo + ' ' + theYear) ;
  document.writeln(theMonth + ' ' + theDayNo + ' ' + theYear) ;
}

function pageFoot(lm,author,url,htmltag) {
  // Format the month number ....
//  var month = lm.substring(0,2) ;
           
  if (Date.parse(lm) != 0) {
    if (htmltag == "br" || htmltag == "BR" || htmltag == "<br>" || htmltag == "<BR>") {
      document.write('<br>Last updated:<br>') ;
    }
    else {
      document.write('<br>This page was last updated on ') ;
    }

    lastChange(lm) ;

    if (author == "Darrell Edgley") {
      if (url == null || url == "" || url == undefined) {
        url = "http://www.raz.co.uk/" ;
      }
    }

    if (author == null || author == "" || author == undefined) {
  //  author = "Darrell Edgley" ;
    }
    else {  
      if (htmltag == "br" || htmltag == "BR" || htmltag == "<br>" || htmltag == "<BR>") {
        document.write('<br>by ') ;
      }
      else {
        document.write(' by ') ;
      }

      if (url == null || url == "" || url == undefined) {
      }
      else {
        document.write('<A HREF="' + url + '" TARGET="photolib">') ;
      }
      
      document.write(author) ;

      if (url == null || url == "" || url == undefined) {
      }
      else {
        document.write('</A>') ;
      }
    }
  }
}

function advert(country) {
  mod = new Date() ;
  var min = mod.getSeconds() ;
  
  caseVal   = min % 12 ;
   
  document.write('<TABLE WIDTH="100%"><TR><TD VALIGN="middle" ALIGN="center">') ;


  if (country == "US") {
    expatsVal = min % 2 ;


    if (caseVal == 0) {
      document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970"  WIDTH="160px" HEIGHT="400px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970" quality="high" bgcolor="#ffffff" name="Player_d613cfc0-8be6-4af0-b68a-14a101002970" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="400px" width="160px"/> </OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT>>') ;
    }
    else if (caseVal == 1) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/B000ICL3KG?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=B000ICL3KG" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/inconvenient_truth.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 2) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/B000BTH4K4?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=B000BTH4K4" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/walmart.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 3) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/1592576435?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=1592576435" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/solar_power.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 4) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0061544515?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0061544515" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/saving_earth.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 5) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/B000I5Y8FU?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=B000I5Y8FU" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/electric_car.jpg" align="middle" alt="Who Killed the Electric Car"></a>') ;
    }
    else if (caseVal == 6) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0865715203?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0865715203" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/pv.jpg" align="middle" alt="PV"></a>') ;
    }
    else if (caseVal == 7) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0963738321?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0963738321" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/solar_house.jpg" align="middle" alt="Solar House"></a>') ;
    }
    else if (caseVal == 8) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0965809870?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0965809870" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/go_solar.jpg" align="middle" alt="Go Solar"></a>') ;
    }
    else if (caseVal == 9) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/086571536X?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=086571536X" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/renew.jpg" align="middle" alt="Go Solar"></a>') ;
    }
    else if (caseVal == 10) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/1931498148?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=1931498148" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/wind_power.jpg" align="middle" alt="Go Solar"></a>') ;
    }
    else {
      document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970"  WIDTH="160px" HEIGHT="400px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970" quality="high" bgcolor="#ffffff" name="Player_d613cfc0-8be6-4af0-b68a-14a101002970" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="400px" width="160px"/> </OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT>') ;
    }

  }
  else if (country == "ENERGY") {
    expatsVal = min % 2 ;


    if (caseVal == 0) {
      document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970"  WIDTH="160px" HEIGHT="400px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970" quality="high" bgcolor="#ffffff" name="Player_d613cfc0-8be6-4af0-b68a-14a101002970" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="400px" width="160px"/> </OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT>>') ;
    }
    else if (caseVal == 1) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/B000ICL3KG?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=B000ICL3KG" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/inconvenient_truth.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 2) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/B000BTH4K4?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=B000BTH4K4" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/walmart.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 3) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/1592576435?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=1592576435" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/solar_power.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 4) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0061544515?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0061544515" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/saving_earth.jpg" align="middle" alt="Saving Earth"></a>') ;
    }
    else if (caseVal == 5) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/B000I5Y8FU?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=B000I5Y8FU" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/electric_car.jpg" align="middle" alt="Who Killed the Electric Car"></a>') ;
    }
    else if (caseVal == 6) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0865715203?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0865715203" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/pv.jpg" align="middle" alt="PV"></a>') ;
    }
    else if (caseVal == 7) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0963738321?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0963738321" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/solar_house.jpg" align="middle" alt="Solar House"></a>') ;
    }
    else if (caseVal == 8) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/0965809870?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=0965809870" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/go_solar.jpg" align="middle" alt="Go Solar"></a>') ;
    }
    else if (caseVal == 9) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/086571536X?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=086571536X" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/renew.jpg" align="middle" alt="Go Solar"></a>') ;
    }
    else if (caseVal == 10) {
      document.writeln('<BR><A HREF="http://www.amazon.com/gp/product/1931498148?ie=UTF8&tag=raz-20&linkCode=xm2&camp=1789&creativeASIN=1931498148" target="_top"><img border=0 ' + 'src="http://www.raz.co.uk/images/wind_power.jpg" align="middle" alt="Go Solar"></a>') ;
    }
    else {
      document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970"  WIDTH="160px" HEIGHT="400px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=GetDisplayTemplate" id="Player_d613cfc0-8be6-4af0-b68a-14a101002970" quality="high" bgcolor="#ffffff" name="Player_d613cfc0-8be6-4af0-b68a-14a101002970" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="400px" width="160px"/> </OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fraz-20%2F8009%2Fd613cfc0-8be6-4af0-b68a-14a101002970&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT>') ;
    }

  }
  else {
    if (caseVal == 0) {
      document.writeln('<a href="http://www.scoot.co.uk" target="_top"><img border=0 ' +
                       'src="http://www.raz.co.uk/images/scoot9.gif" width=88 height=31 align = "middle" alt="Scoot"></a>') ;
    }
    else if (caseVal == 1) {
      document.writeln('Buy books and CDs online from <a href="http://www.amazon.co.uk/exec/obidos/redirect-home/darrelledgley" target="_top"><img border=0 ' +
                       'src="http://www.raz.co.uk/images/uk_w_blkborder_logo.gif" width=94 height=32 align = "middle" alt="Amazon"></a>') ;
    }
    else if (caseVal == 2) {
      document.writeln('<a href="http://www.amazon.co.uk/exec/obidos/redirect-home/darrelledgley" target="_top"><img border=0 ' +
                       'src="http://www.raz.co.uk/images/etcstory40.gif" width=158 height=37 align="middle" alt="Amazon"></a>') ;
    }
    else if (caseVal == 3) {
      document.writeln('<a href="http://www.amazon.co.uk/exec/obidos/redirect-home/darrelledgley" target="_top"><img border=0 ' +
                       'src="http://www.raz.co.uk/images/etfront40.gif" align = "middle" alt="Amazon"></a>') ;
    }
    else if (caseVal == 4) {
      document.writeln('<a href="http://www.scoot.co.uk" target="_top"><img border=0 ' +
                       'src="http://www.raz.co.uk/images/scoot8.gif" width=88 height=31 alt="Scoot"></a>') ;
    }
    else {
      document.writeln('<a href="http://www.amazon.co.uk/exec/obidos/redirect-home/darrelledgley" target="_top"><img border=0 ' +
                       'src="http://www.raz.co.uk/images/newshapemagenta120x30a8.gif" width=120 height=30 align = "middle" alt="Amazon"></a>') ;
    }
  }
  
  document.writeln('</TD></TR></TABLE>') ;
}

function toDay() {
  var now = new Date();
  document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate());
}

function toolbar() {
  document.write("<SPAN style=\"color:black;font:8pt,arial;cursor:help\"> ") ;
  
  if (navigator.appName.indexOf("Netscape") != -1) {
  }
  else {
    if (navigator.appVersion.charAt(0) >= 4) {
      document.write("<span style=\"cursor:hand\" ") ;
      document.write("onclick='window.external.AddFavorite(top.location.href,top.document.title);'>") ;
      document.write("<span style=\"font:12pt,wingdings;color:red\">=</span>") ;
      document.writeln("Add this site to <u>Bookmarks</u> list</span>") ;
    }
  
    if (navigator.appVersion.charAt(0) >= 5) {
      document.write("&nbsp;<span style=\"cursor:hand\" ") ; 
      document.write("          onClick=\"location=\'mailto:?subject=A URL you may be interested in") ;
      document.write("&body=Hi, I just visited the web page at called ") ;
      document.write(top.document.title + " at " + top.document.location + " and thought you may be interested in it.") ;
      document.write("\'\"> ") ;
      document.write("    <span style=font:12pt,wingdings;color:red>+</span>") ;
      document.writeln("    Email URL to a <u>Friend</u></span>") ;
    }

    if (navigator.appVersion.charAt(0) >= 4) {
      document.write("&nbsp<span style=\"cursor:hand\" ") ;
      document.write(" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage(top.location.href)\">") ;
      document.write("      <span style=font:12pt,wingdings;color:red>:</span>") ;
      document.write("         Make&nbsp;it&nbsp;your&nbsp;<u>Homepage!</u>") ;
      document.writeln("    </span>") ;
    }
  }

  document.write("<\SPAN>") ;
}

function loadImages() {
  if (document.images) {
    // preload advert images
    window.status='Loading images';

    pic1      = new Image() ;
    pic2      = new Image() ;
    pic3      = new Image() ;
    pic4      = new Image() ;
    pic5      = new Image() ;
    pic6      = new Image() ;
    pic7      = new Image() ;
    pic8      = new Image() ;
    pic9      = new Image() ;
    pic10     = new Image() ;
    pic11     = new Image() ;
    pic12     = new Image() ;
    pic13     = new Image() ;
    pic14     = new Image() ;
    pic15     = new Image() ;

    pic1.src  = "http://www.raz.co.uk/images/etcstory40.gif" ;
    pic2.src  = "http://www.raz.co.uk/images/etfront40.gif" ;
    pic3.src  = "http://www.raz.co.uk/images/newshapemagenta120x30a8.gif" ;
    pic4.src  = "http://www.raz.co.uk/images/scoot8.gif" ;
    pic5.src  = "http://www.raz.co.uk/images/scoot9.gif" ;
    pic6.src  = "http://www.raz.co.uk/images/uk_w_blkborder_logo.gif" ;
    pic7.src  = "http://www.raz.co.uk/images/vh40.gif" ;
    pic8.src  = "http://www.raz.co.uk/images/mwcos.gif" ;
    pic9.src  = "http://www.raz.co.uk/images/vcss.gif" ;
    pic10.src = "http://www.raz.co.uk/images/hwg.gif" ;  
    pic11.src = "http://www.raz.co.uk/images/readmore.gif" ;
    pic12.src = "http://www.raz.co.uk/images/bookscd.gif" ;
    pic13.src = "http://www.raz.co.uk/images/ppblue_blur.gif" ;
    pic14.src = "http://www.raz.co.uk/images/amazon-w-logo.gif" ;
    pic15.src = "http://www.raz.co.uk/images/dvused120x60.gif" ;
    
    window.status='';
  }
}

function img_act(imgName) {
  if (document.images) {
    imgOn = eval(imgName + "_mo.src") ;
    document[imgName].src = imgOn ;
  }
}

function img_inact(imgName) {
  if (document.images) {
    imgOff= eval(imgName + ".src") ;
    document[imgName].src = imgOff ;
  }
}

// Checks that input fields have been completed
function errorcheck(form) {
  var missing="";
  if (form.email.value == "") missing=missing + "Email address\n";
  if (missing !=""){
    showmsg(missing);
    return false;
  }
  else return true;
}
   
function runsubmit(form) {
  if (errorcheck(form)) {
    form.action="http://cgi.razzie.plus.com/cgi-bin/mailform.cgi";
    form.submit(); 
  }
  else return false;
}

function runreset() {
  return true ;
}
   
// Creates the window and message to alert the user to input errors
function showmsg(missing) {
  alert("\nThe following fields are missing\n" +
        "and must be completed to continue:\n\n" + 
        missing);
}

if (navigator.appVersion.charAt(0) <= 3) {
  window.open("http://www.raz.co.uk/early.html","Early_Browser","width=400,height=300,left=50,screenX=50,top=80,screenY=80") ;
} 

/***********************************************
* Dynamic Countdown script- © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function cdtime(container, targetdate){
  if (!document.getElementById || !document.getElementById(container)) return
  this.container=document.getElementById(container)
  this.currentTime=new Date()
  this.targetdate=new Date(targetdate)
  this.timesup=false
  this.updateTime()
}

cdtime.prototype.updateTime=function(){
  var thisobj=this
  this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
  setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

cdtime.prototype.displaycountdown=function(baseunit, functionref){
  this.baseunit=baseunit
  this.formatresults=functionref
  this.showresults()
}

cdtime.prototype.showresults=function(){
var thisobj=this


var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds
if (timediff<0){ //if time is up
  this.timesup=true
  this.container.innerHTML=this.formatresults()
return
}

var oneMinute=60 //minute unit in seconds
var oneHour=60*60 //hour unit in seconds
var oneDay=60*60*24 //day unit in seconds
var dayfield=Math.floor(timediff/oneDay)
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))

if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level
  hourfield=dayfield*24+hourfield
  dayfield="n/a"
}
else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level
  minutefield=dayfield*24*60+hourfield*60+minutefield
  dayfield=hourfield="n/a"
}
else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level
  var secondfield=timediff
  dayfield=hourfield=minutefield="n/a"
}

this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield)
  setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
}

/////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////

//Create your own custom format function to pass into cdtime.displaycountdown()
//Use arguments[0] to access "Days" left
//Use arguments[1] to access "Hours" left
//Use arguments[2] to access "Minutes" left
//Use arguments[3] to access "Seconds" left

//The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown()
//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc


function formatresults(){
if (this.timesup==false){//if target date/time not yet met
  var displaystring="<span class='lcdstyle' align=center>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> left to Register to Vote in the NC Primary"
}
else{ //else if target date/time met
  var futuredate=new cdtime("countdowncontainer", "May 06, 2008 06:30:00")
  futuredate.displaycountdown("days", formatresults2)
}
return displaystring
}

function formatresults2(){
if (this.timesup==false){//if target date/time not yet met
  var displaystring="<span class='lcdstyle' align=center>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> left until polls open in NC for our Primary (6:30am May 6th)"
}
else{ //else if target date/time met
  var futuredate=new cdtime("countdowncontainer", "May 06, 2008 19:30:00")
  futuredate.displaycountdown("days", formatresults3)
}
return displaystring
}

function formatresults3(){
if (this.timesup==false){//if target date/time not yet met
  var displaystring="<span class='lcdstyle' align=center>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> left until polls close at 7:30pm in NC --> GO VOTE for 'Barack Obama'"
}
else{ //else if target date/time met
  var displaystring="Vote Obama!"
}
return displaystring
}
