function loadNewLink(link) {
	window.open(link); 
	return false;
}

function loadImages(){
   var img
   if (document.images){
      if (!loadedImages) loadedImages = new Array()
      for (var i=0; i < arguments.length; i++){
         img = new Image()
         img.src = arguments[i]
         loadedImages[loadedImages.length] = img
      }
   }
}
function flip(imgName, imgSrc){
   if (document.images){
   	  var theImg = document.getElementById(imgName);
      theImg.src = imgSrc;
   }
  }
function setClass(elId, elClass) {
	if (document.getElementById(elId)) { document.getElementById(elId).className = elClass; }
}
function resetAllSubmenus() {
    var topMenuDiv = document.getElementById("top-menu");
    var menus = topMenuDiv.getElementsByTagName("ul");
    for (var i = 0; i < menus.length; i++) {
        menus[i].className = "submenu-invisible";
    }
}
function resetIds(resetMenu) {
	if (activeMenuId != null && resetMenu) {
		setClass (activeMenuId, activeMenuClass);
	}
	if (activeImageId != null && resetMenu) {
		flip (activeImageId, activeImageSrc);
	}
	activeMenuId = null;
	activeMenuClass = null;
	activeImageId = null;
	activeImageSrc = null;
}
function showSubmenu(submenuId, submenuClass, imageId, imageSrc) {
	resetAllSubmenus();
    setClass(submenuId, submenuClass);
    clearTimeout(timer);
    timer = null;
    flip(imageId, imageSrc);
    resetIds(false);
}
function Left(str, n) {
    if (n <= 0)
        return "";
    else if (n > String(str).length)
        return str;
    else
        return String(str).substring(0, n);
}
function Right(str, n) {
    if (n <= 0)
        return "";
    else if (n > String(str).length)
        return str;
    else {
        var iLen = String(str).length;
        return String(str).substring(iLen, iLen - n);
    }
   }
function resetAllMenus() {
	resetAllSubmenus();
	resetIds(true);
	clearTimeout(timer);
	timer = null;
}
function resetMenu(menuId, menuClass, imageId, imageSrc) {
   	resetAllSubmenus();
	setClass (menuId, menuClass);
	flip(imageId, imageSrc);
	resetIds();
}
function setMenuTimer(menuId, menuClass, imageId, imageSrc) {
    var timerFunction = "resetMenu('" + menuId + "', '" + menuClass + "', '" + imageId + "', '" + imageSrc + "');";
    timer = setTimeout(timerFunction, 1000)
    activeMenuId = menuId;
    activeMenuClass = menuClass;
    activeImageId = imageId;
    activeImageSrc = imageSrc;
}
function changeMenuImage(imageId, imgSrc) {
    flip(imageId, imgSrc);
}
function changeLinks(picValue) {
	var uBound = pictures.length;
	var curValue;
	var newHTML;
	newHTML = "";
	var picDiv = document.getElementById("PagerBox1");
	for (var i = 0; i < uBound; i++) {
		curValue = eval(i + 1);
		if (picValue != curValue) {
			newHTML += pictures[i][0];
		}
		newHTML = newHTML + curValue;
		if (picValue != curValue) {
			newHTML += pictures[i][2];
		}
		if (i < uBound - 1) {
			newHTML += "&nbsp;\n"
		}
	}
	picDiv.innerHTML = newHTML;
}
function changeImage(descriptor, count, picture, picWidth, picHeight, imageRoot, picValue) {
	var adjustableSpan = document.getElementById("adjustablespan");
	adjustableSpan.innerHTML = picValue;
	var printableDiv = document.getElementById("printablediv");
	printableDiv.style.width = picWidth + "px";
	var printablePic = document.getElementById("printablepic");
	picture = imageRoot + picture;
	printablePic.src = picture;
	printablePic.style.width = picWidth;
	printablePic.style.height = picHeight;
	changeLinks(picValue);
}
function openNewWindow(Link, width, height) {
	var newWindow = window.open(Link, "newWindow", "resizable=1,scrollbars=1,height=" + height + ",width=" + width)
	var scrWidth = screen.width;
	var scrHeight = screen.height;
	var leftPos = (scrWidth - width) / 2;
	var topPos = (scrHeight - height) / 2;
	newWindow.moveTo(leftPos, topPos);
	newWindow.focus();
}
function showLink(link) {
    document.location = link;
}
function trackExhibitorLink(link, category, action) {
    setTimeout('showLink ("' + link.href + '")', 100)
    try {
        var pageTracker = _gat._getTracker("UA-7359526-3");
        pageTracker._trackEvent(category, action);
    } catch (err) { }
    return false;
}
var curURL, pageSplitter, curPage, curLeftPage, curRightPage;
var loadedImages = null;
var timer = null;
var activeId;
var activeMenuId = null;
var activeMenuClass = null;
var activeImageId = null;
var activeImageSrc = null;

