function myeh() {
//if (iec > 0) { alert('Error! '+ iee); iec--}
return true
}

if (location.href.indexOf('naked') < 0 && location.href.indexOf('file:/') < 0) { window.onerror= myeh }

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)


// Set-up to use getMouseXY function onMouseMove
//document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function calcCursor() {
ccShow(barfigure)
}


//********* Next script: *****************
NS6= false;
IE4= (document.all);
if (!IE4) { NS6= (document.getElementById); }
NS4= (document.layers);

/***********************************************
* Cool DHTML tooltip script II- © 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
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="arrow2.gif">') //write out pointer image

document.write('<div id="dhtmlbucktip"></div>') //write out tooltip DIV

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false

if (ie||ns6) {
 var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
 var buckobj=document.all? document.all["dhtmlbucktip"] : document.getElementById? document.getElementById("dhtmlbucktip") : ""
 }
var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
//var buckpointerobj=document.all? document.all["dhtmlbuckpointer"] : document.getElementById? document.getElementById("dhtmlbuckpointer") : ""


function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

last_text= ' '

function ddrivetip(thetext, thewidth, thecolor){
last_text= thetext
isbucktip= (thetext == ' ')
if (ns6||ie){
 if (typeof thewidth!="undefined") { tipobj.style.width= thewidth + "px" }
 if (typeof thecolor!="undefined" && thecolor!="") { tipobj.style.backgroundColor= thecolor }
 if (isbucktip) {
   buckobj.innerHTML= '<table width=100 height=41 background="/images/d100100.gif" cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=middle><b><font class=inbuck color=#003300 face=Verdana>$' + barcommad
   + '</font></b></td></tr></table>'
    enabletip=true
   }
  else {
   tipobj.innerHTML= thetext
   enabletip=true
   }
 return false
 }
}

function positiontip(e){
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY

  if (location.href.indexOf('reward') > 0) {
   h_goldbar= document.getElementById("goldbar");

   barfigure= 3300 + (100*(tempX - h_goldbar.offsetLeft))
   barcommad= '' + (barfigure % 1000)
   while (barcommad.length < 3) {barcommad= '0' + '' + barcommad }
   barcommad= parseInt(barfigure/1000) + ',' + barcommad
//  document.Show.MouseX.value = barfigure  // tempX + '/' + (tempX - h_goldbar.offsetLeft)
//  document.Show.MouseY.value = tempY
//  return true
   }

if (enabletip) {
  isbucktip= (last_text == ' ')
  var nondefaultpos=false
  var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
  var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
  //Find out how close the mouse is to the corner of the window
  var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
  var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
  var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
  var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
  var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000
  //if the horizontal distance isn't enough to accomodate the width of the context menu

  if (isbucktip) { tipoffwidth= buckobj.offsetWidth } else { tipoffwidth= tipobj.offsetWidth } 
  if ((! isbucktip) && (tipobj.style.width == '450px')) {
//    if (ie) { tipobj.style.left= (document.body.scrollWidth-450) + "px" }
//     else { tipobj.style.left= (document.width-450) + "px" }
    if (ie) { tipobj.style.left= (document.getElementById("buttcol").offsetLeft+77) + "px" }
     else { tipobj.style.left= (document.width-450) + "px" }
    nondefaultpos= true
    }
  else if ((! isbucktip) && (tipobj.style.width == '451px')) {
    tipobj.style.left= 20
    nondefaultpos= true
    }
  else if ((! isbucktip) && (tipobj.style.width == '452px')) {
    tipobj.style.left= 153
    nondefaultpos= true
    }
  else if ((! isbucktip) && (tipobj.style.width == '600px')) {
    tipobj.style.left= Math.round((winW/2)-300)
    nondefaultpos= true
    }
   else if (rightedge<tipoffwidth) {
    //move the horizontal position of the menu to the left by it's width
    if (isbucktip) { buckobj.style.left= (curX-tipoffwidth) + "px" } else { tipobj.style.left= (curX-tipoffwidth) + "px"  }
    nondefaultpos=true
    }
   else if (curX<leftedge) { if (isbucktip) { buckobj.style.left="5px"} else { tipobj.style.left="5px" } }
   else if (isbucktip) {
    //position the horizontal position of the menu where the mouse is positioned
    buckobj.style.left= curX+offsetfromcursorX-offsetdivfrompointerX+"px"
    pointerobj.style.left=curX+offsetfromcursorX+"px"
    }
   else {
    //position the horizontal position of the menu where the mouse is positioned
    tipobj.style.left= curX+offsetfromcursorX-offsetdivfrompointerX+"px"
    pointerobj.style.left=curX+offsetfromcursorX+"px"
    }

//same concept with the vertical position
  if (isbucktip) { tipoffheight= buckobj.offsetHeight } else { tipoffheight= tipobj.offsetHeight } 
  if ((! isbucktip) && (tipobj.style.width == '450px' || tipobj.style.width == '451px' || tipobj.style.width == '452px' || tipobj.style.width == '600px')) {
    if (ie) { tipobj.style.top= (document.body.scrollTop + 10) + "px" }
     else { tipobj.style.top= (window.scrollY+10) + "px" }
    nondefaultpos= true
    }
   else if (bottomedge < tipoffheight){
    if (isbucktip) { buckobj.style.top= (curY - tipoffheight - offsetfromcursorY) + "px" }
     else { tipobj.style.top= (curY - tipoffheight - offsetfromcursorY) + "px" }
    nondefaultpos= true
    }
   else {
    if (isbucktip) { buckobj.style.top=curY + offsetfromcursorY + offsetdivfrompointerY + "px" }
     else { tipobj.style.top=curY + offsetfromcursorY + offsetdivfrompointerY + "px" }
    pointerobj.style.top= curY + offsetfromcursorY + "px"
    }
  if (isbucktip) {
    buckobj.style.visibility="visible"
    buckobj.innerHTML= '<table width=100 height=41 background="/images/d100100.gif" cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=middle><b><font class=inbuck color=#003300 face=Verdana>$' + barcommad
   + '</font></b></td></tr></table>'
    }
  else {
   if (IE4) {
    tipobj.style.filter="revealTrans(duration=0.75,Transition=5)"; // 19 = diagonal wipe, 12 = dissolve
    if (tipobj.filters.revealTrans.status != 2) { tipobj.filters.revealTrans.apply(); }
    }
   tipobj.style.visibility="visible"
   if (IE4) { if (tipobj.filters.revealTrans.status != 2) { tipobj.filters.revealTrans.play(); } }
   }
  if (!nondefaultpos) { pointerobj.style.visibility="visible" }
   else { pointerobj.style.visibility="hidden" }
  }
}

//window.onresize= resetxy;

function hideddrivetip(spying){
//if (IE4 && spying) {
// tipobj.style.filter="revealTrans(duration=0.5,Transition=4)";
// if (tipobj.filters.revealTrans.status != 2) { tipobj.filters.revealTrans.apply(); }
// }
if (ns6||ie){
  enabletip=false
  pointerobj.style.visibility="hidden"
  tipobj.style.visibility="hidden"
  tipobj.style.left="-1000px"
  tipobj.style.backgroundColor=''
  tipobj.style.width=''
  buckobj.style.visibility="hidden"
  buckobj.style.left="-1000px"
  buckobj.style.backgroundColor=''
  buckobj.style.width=''
  }
//if (IE4 && spying) { if (tipobj.filters.revealTrans.status != 2) { tipobj.filters.revealTrans.play(); } }
}

document.onmousemove= positiontip

cardthumbs= new Array()
cardthumbs[0]= new Image()
cardthumbs[0].src= '/images/ccdisco.jpg'
cardthumbs[1]= new Image()
cardthumbs[1].src= '/images/ccfree.gif'
cardthumbs[2]= new Image()
cardthumbs[2].src= '/images/ccaeblue.jpg'

cardno= 0
cardperc= 7

gospend=1
function spendCard() {
if (gospend > 0) {
 document.getElementById('spendcell').innerHTML= '<img width=65 height=7 src="/images/trans50.gif"><br><a xtitle=\'"Like my little joke?"  ;^)\' onMouseover="gospend= 0" onMouseout="gospend= 1"><font class=percfont>' + cardperc + '%</font></a>' 
 if (cardperc < 999) { cardperc++ }
 }
setTimeout("spendCard()",500)
}

function blendCard() {
cardno++
if (cardno > 2) { cardno= 0 }
if (document.all){
 document.images.ccrot.style.filter="blendTrans(duration=1,Transition=14)"
 document.images.ccrot.filters.blendTrans.Apply()
 }
document.images['ccrot'].src= cardthumbs[cardno].src
if (document.all){ document.images.ccrot.filters.blendTrans.Play() }
setTimeout("blendCard()",2500)
}

//cardthumbs[2].onload= startBlend

