//*******************************************  ROLLOVER SCRIPTS ****************************************//
var revert = new Array();
var inames = new Array('nav-button-about','nav-button-expo','nav-button-tickets','nav-button-guests','nav-button-exhibitors','nav-button-aa','nav-button-floor','nav-button-programming','nav-button-exclusives','nav-button-hotels','nav-button-shop','nav-button-help','nav-button-volunteers','nav-button-past','nav-button-testimonials','nav-button-faq','nav-button-contact','nav-button-press');

// Preload
if (document.images) {
  var flipped = new Array();
  for(i=0; i< inames.length; i++) {
    flipped[i] = new Image();
    flipped[i].src = "./_images/_elements/"+inames[i]+"2.gif";
  }
}

function over(num) {
  if(document.images) {
    revert[num] = document.images[inames[num]].src;
    document.images[inames[num]].src = flipped[num].src;
  }
}
function out(num) {
  if(document.images) document.images[inames[num]].src = revert[num];
}




//******************************************** POPUP BOX ********************************************
function popupBox(div,color,title,close,width,height)
{
	if(!color){
		var color = 'FFFFFF';
	}
	if(!document.getElementById(div)){
		dialog = document.createElement('div');
		dialog.id = div;
		dialog.style.width = width;
		dialog.style.height = height;
		dialog.style.backgroundColor = color;
		dialog.style.top = 50;
		dialog.style.left = 200;
		dialog.style.border = 'solid';
		dialog.style.borderWidth = '1px';
		dialog.style.position = 'absolute';
		document.body.appendChild(dialog);
		//var dragdialog = new dragObject(div, null);
	} else {
		document.getElementById(div).style.visibility = 'Visible';
	}
}




//******************************************** ZOOM ********************************************
function zoomImage(imgUrl,event)
{
	img = new Image();
	img.src = imgUrl;
	width = img.width + 20
	height = img.height + 30;




	posLeft = event.clientX + 50;
	posTop	= event.clientY - height/2;

	posLeft = mouseX(event) + 50;
	posTop	= mouseY(event) - height/2;

	popupBox('zoomImg','000000','','',width,height);
	document.getElementById('zoomImg').style.left = posLeft;
	document.getElementById('zoomImg').style.top = posTop;
	document.getElementById('zoomImg').style.width = width;
	document.getElementById('zoomImg').style.height = height;

	html	= '<table cellspacing="0" cellpadding="0" style="margin: 10px;" onclick="javascript: document.getElementById(\'zoomImg\').style.visibility = \'hidden\';" onmouseover="this.style.cursor=\'pointer\';"><tr><td><img src="' + imgUrl + '"></td></tr><tr><td align="center"><font color="FFFFFF"><span style="font-family: Verdana; font-size: 9px;">Click to close</span></font></td></tr></table>';
	document.getElementById('zoomImg').innerHTML = html;

}




//******************************************** ZOOM ********************************************
function mouseX(evt) {
	if (evt.pageX)
		return evt.pageX;
	else if (evt.clientX)
   		return evt.clientX + (document.documentElement.scrollLeft ?
   			document.documentElement.scrollLeft :
   			document.body.scrollLeft);
	else return null;
}

function mouseY(evt) {
	if (evt.pageY)
		return evt.pageY;
	else if (evt.clientY)
		return evt.clientY + (document.documentElement.scrollTop ?
			document.documentElement.scrollTop :
			document.body.scrollTop);
	else return null;
}