document.oncontextmenu = function(){return false}
if(document.layers) {
    window.captureEvents(Event.MOUSEDOWN);
    window.onmousedown = function(e){
        if(e.target==document)return false;
    }
}
else {
    document.onmousedown = function(){return false}
}

function GetCookie(name) 
{
  var arg=name+"=";
  var alen=arg.length;
  var clen=document.cookie.length;
  var i=0;
  while (i<clen) 
  {
    var j=i+alen;
    if (document.cookie.substring(i,j)==arg)
      return "here";
    i=document.cookie.indexOf(" ",i)+1;
    if (i==0) break;
  }
  return null;
}

var visit=GetCookie("COOKIE1"); // 4
if (visit==null){
var expire=new Date();
window.name = "thiswin";
newwin=open("newsletter.html","news","width=350,height=350,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");
//newwin=open("popup.html","news","width=400,height=340,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");
document.cookie="COOKIE1=here; expires=Thu 01-01-2004 00:00:00 GMT;";
} 


function refreshDocJSTOD(frequency) {
  var max = tips.length;
  var dateObj = new Date();
  switch(frequency) {
    case "month": // 0 - 11
      tipIndex = dateObj.getMonth();
      break
    case "dayOfTheMonth": // 1 - 31
      tipIndex = dateObj.getDate() - 1 // 0 - 30
      break;
    case "dayOfTheWeek": // 0 - 6
      tipIndex = dateObj.getDay();
      break;
    case "hour": // 0 - 23
      tipIndex = dateObj.getHours();
      break;
    case "now": // Default
    default:
      tipIndex = getRandomIndex(max);
   }
  if (document.location == "http://www.racing-index.com/virtual_horse_racing.html")
    tipIndex = 12;
  else if (document.location == "http://www.racing-index.com/horse-laying-bets.html")
    tipIndex = 7;
  else  
    tipIndex = tipIndex % max;
 document.write(tips[tipIndex]);
}

function bookAd() {
  var max = bets.length;
  betIndex = getRandomIndex(max);
  if (document.location == "http://www.racing-index.com/horseracing_tipsters.html")
    betIndex = 0; 
  else if (document.location == "http://www.racing-index.com/horse-laying-bets.html")
    betIndex = 1; 	
  else
    betIndex = betIndex % max;
  document.write(bets[betIndex]);
}

function skyscraper() {
  var max = ss.length;
  ssIndex = getRandomIndex(max);
  ssIndex = ssIndex % max;
  document.write(ss[ssIndex]);
}

function refreshAdvent() {
  var max = advent.length;
  var dateObj = new Date();
  adventIndex = dateObj.getDate()// 0 - 30
  adventIndex = adventIndex % max;
 document.write(advent[adventIndex]);
}

function getRandomIndex(max) {
 var randomNum = Math.random();
 randomNum = randomNum * max;
 randomNum = parseInt(randomNum);
 if(isNaN(randomNum)) randomNum = 0; // for Netscape
 return randomNum;
}

/*
Cross browser marquee script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var messmax = marq.length;
//Specify the marquee's width (in pixels)
var marqueewidth=460
//Specify the marquee's height (in pixels, pertains only to NS)
var marqueeheight=20
//Specify the marquee's scroll speed (larger is faster)
var speed=5
//Specify the marquee contents
marqIndex = getRandomIndex(messmax);
marqIndex = marqIndex % messmax;
//var marqueecontents='<span class="marquee"><a href="http://www.racing-index.com/losers-into-winners.html">Latest : Make money backing horses to lose! Click Here to read our review of the new eBook "Losers into Winners"</a></span>'
var marqueecontents=marq[marqIndex];

function regenerate(){
window.location.reload()
}

function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}

window.onload=regenerate2

function setSite(sitename)
{
  var sSite = new Image;
  <!--sSite.src = sitename;-->
}