// JavaScript Document

function hideLoading()
{

	var ld=(document.all);
	
	var ns4=document.layers;
	var ns6=document.getElementById&&!document.all;
	var ie4=document.all;
	
	if (ns4)
	{
		ld=document.loading;
	}else if (ns6)
	{
		ld=document.getElementById("loading").style;
	}else if (ie4)
	{
		ld=document.all.loading.style;
	}
	if(ns4){ld.visibility="hidden";}
	else if (ns6||ie4){ ld.display="none"; }

}
		
function toggleHidden(hidden, readMore, hideDetails) {

		var hiddenElement = document.getElementById(hidden);	
		var hiddenElementLink = document.getElementById('link_'+hidden);		
			
        if ( hiddenElement.style.display == "" ){
		
		       hiddenElement.style.display = "none";
			   if( hiddenElementLink ){ hiddenElementLink.innerHTML = readMore; }

        } else if ( hiddenElement.style.display == "none" ){

			   hiddenElement.style.display = "";
			   if( hiddenElementLink ){ hiddenElementLink.innerHTML = hideDetails; }
	    }
		
	   
}

function sayHello()
{
   alert('hello');
}



// this script flips the navigation images so
//  that the correct one is higlighted

function highlightMap(imgID)
{
	  
	  for (i=0;i<navImgs.length;i++)
	  {

	     if( navImgs[i] == imgID )
		 {
		    document.getElementById(navImgs[i]).src = mapImgsPath + navImgs[i] + '_on' + mapImgsExt;
		 }else{
	        document.getElementById(navImgs[i]).src = mapImgsPath + navImgs[i] + '_off' + mapImgsExt;
	     }
	  }
	  
}

// This function takes a tile name and exhibitor ID and loads the tile and open the exhibitor window
		
function showExhibitor( mevent, boothID, showID, prefix )
{
   // hide any open ballons
   balloon.hideTooltip(1);
   
   
   // pop open the exhibitor booth
   var exhURL = '\<iframe allowTransparency=true width=460 height=400 frameborder=0 \src=' + prefix + '/shows/' + showID + '/showfloor/booths/booth' + boothID + '.php></iframe>';
   //balloon.showTooltip(event,exhURL,1,460);
   
   var ballfunc = 'balloon.showTooltip(mevent,\''+exhURL+'\',1,460)';
   window.setTimeout(ballfunc,300);


}




// This code rescales and moves the exhibitor tabs
var tabsFull = false;
var tabstop = 0;
var tabsheight = 0;

var tabHeight = 0;
var boothHeight = 0;

var loadScaleTabs = true;

function scaleTabs(etabHeight,eboothHeight)
{

   boothHeight = eboothHeight;
   tabHeight = etabHeight;
   
   
   if( loadScaleTabs )
   {
      tabstop = eboothHeight - tabHeight -20;
	  tabsheight = tabHeight;
      loadScaleTabs = false;
   }	  
   if( tabsFull )
   {
      tabsShrink();
	  tabsFull = false;
   }else{
      tabsUp();
	  tabsFull = true;
   }
}






function tabsUp()
{

   var exhtabs=document.getElementById("exh-tabs");
   if( tabstop > 10 )
   {
      tabstop -= 10;
      exhtabs.style.top = tabstop + 'px';
	  t=setTimeout("tabsUp();",0);
   }else{
      t=setTimeout("tabsGrow();",0);
   }
}

function tabsGrow()
{

   var exhtabspane=document.getElementById("pane2");

   if( tabsheight < boothHeight - 40 )
   {
      tabsheight += 10;
      exhtabspane.style.height = tabsheight + 'px';
	  t=setTimeout("tabsGrow();",0);
	  //tabsGrow();
   }
}


function tabsShrink()
{

   var exhtabspane=document.getElementById("pane2");
   if( tabsheight > tabHeight )
   {
      tabsheight -= 10;
      exhtabspane.style.height = tabsheight + 'px';
	  t=setTimeout("tabsShrink();",0);
   }else{
      t=setTimeout("tabsDown();",0);
   }
}

function tabsDown()
{

   var exhtabs=document.getElementById("exh-tabs");
   if( tabstop < boothHeight - tabHeight - 40  )
   {
      tabstop += 10;
      exhtabs.style.top = tabstop + 'px';
	  t=setTimeout("tabsDown();",0);
   }
}


