img0 = new Image();
img0.src = "images/future/packard_1_lg.jpg";
img1 = new Image();
img1.src = "images/future/packard_2_lg.jpg";
img2 = new Image();
img2.src = "images/future/packard_3_lg.jpg";
img3 = new Image();
img3.src = "images/future/packard_4_lg.jpg";

var flag = false;
document.onmousemove = getPosition;

function hoverDiv(option, pic, width, height) {
obj = document.getElementById('hoverDiv');
if (option == 'hide') {
 obj.style.display = 'none';
 flag = false;
} else {
 if (!flag) {
  obj.innerHTML = '<img src="images/future/packard_'+pic+'_lg.jpg" height="'+height+'" width="'+width+'">';
  obj.style.display = 'block';
  flag = true;
 }
}
}

function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
//    return cursor;

    winSize = windowSize();
    
    centerOffset = (cursor.x < (winSize[0]-75)/2) ? -50:-400;
    
	obj = document.getElementById('hoverDiv');
	obj.style.top = cursor.y-280+'px';
	obj.style.left = cursor.x+centerOffset+'px';
}

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];

}