function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}

addLoadListener(function()
{
for (var i = 0; i < tNames.length; i++) {
  tObjects[i] = new Image();
  tObjects[i].src = 'images/news/'+tNames[i];
}

document.getElementById('hoverDiv').innerHTML = '<img src="images/spacer.gif" width="300" height="225" id="hoverPic" />';

});

var tNames = ['george-lopez-in-the-round-s.jpg', 'DJ-Rig-Moster-Massive-2006.jpg', 'Jackson-Brown-Avila-Beach-C.jpg','TGA1.jpg','TGA1b.jpg','Doobie-Brothers-Visalia-Fox.jpg','','','CarlosMencia.jpg',''];
var tObjects = [];

function bigger(option) {
if (option == 'hide') {
 document.getElementById('hoverDiv').style.display = 'none';
} else {
 if (tNames[option].length < 1) {
  return false;
 }
 document.getElementById('hoverPic').src = 'images/news/'+tNames[option];
 document.getElementById('hoverDiv').style.display = 'block';
}
}

var posx = 0;
var posy = 0;

//function doSomethingInit() {
document.onmousemove = doSomething;
//}

function doSomething(e) {

	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}

    winSize = windowSize();
    
    centerOffset = (posx < winSize[0]/2) ? 12:-355;
	
	document.getElementById('hoverDiv').style.top = posy-240 + 'px';
	document.getElementById('hoverDiv').style.left = posx+15+centerOffset + 'px';
	
	//document.FormName.top.value = posy;
	//document.FormName.left.value = posx;
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
}

function windowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//  window.alert( 'Width = ' + myWidth );
//  window.alert( 'Height = ' + myHeight );
  return [myWidth,myHeight];
}