//popup vars

var theWidth = 800;
var theHeight = 485;
var theTop=(screen.height/2)-(theHeight/2);
var theLeft=(screen.width/2)-(theWidth/2);
var features = "height=485,width=800,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,top=" + theTop + ",left=" + theLeft;


// globals
imageSubdirectory = "menu/";
imagePrefix       = "menu_";
offSuffix         = "_off.gif";
onSuffix          = "_on.gif";
pickSuffix        = "_on.gif";
frameTarget = "_self";
picked=9;         
highlighted=9;

// Compatibility check vars
var agt = navigator.userAgent.toLowerCase();
nav4plus = false;
nav3plus = false;
IEmac = false;
menuActive = false;

with (this.location) {baseURL = href.substring (0,href.lastIndexOf ("/") + 1)}

var menuActive = false;
var totalGraphics=0;	    
var graphic = new Array(); 


function tocGraphic (name, statusText, link) {

  this.name     = name;
  this.link     = link;
  this.off      = new Image ();
  this.off.src  = imageSubdirectory + imagePrefix + name + offSuffix;
  this.offname  = imageSubdirectory + imagePrefix + name + offSuffix;

  if (link != "") {

    
    this.on         = new Image ();
    this.on.src     = imageSubdirectory + imagePrefix + name + onSuffix;
    this.pick       = new Image ();
    this.pick.src   = imageSubdirectory + imagePrefix + name + pickSuffix;
    this.statusText = statusText;
  }
}

function createTocGraphic (name, statusText, link) {

  graphic[totalGraphics] = new tocGraphic(name, statusText, link);
  totalGraphics++;
}

if (navigator.userAgent.indexOf ("Mozilla") != -1) {
	IEmac = (agt.indexOf('mac') != -1 && agt.indexOf('msie') != -1);
	nav3plus = parseInt(navigator.appVersion.substring(0,1)) >= 3
	nav4plus = (parseInt(navigator.appVersion.substring(0,1)) >= 4 && !IEmac)
}

function init()
{
	if(nav3plus)
	{
		rolloverInit();
	}
}

function doClick (num) 
{
if(nav3plus && menuActive)
{
	document.images[graphic[num].name].src = graphic[num].pick.src;

  if (num != picked)
  {
    document.images[graphic[picked].name].src = graphic[picked].off.src;
  }
  picked = num;
  highlighted = picked;
}
}

function doMouseOver(num)
{
if(nav3plus && menuActive)
{
  if (num != picked)
  {
	document.images[graphic[num].name].src = graphic[num].on.src;
  }

  if (highlighted != picked  && highlighted != num)
  {
    document.images[graphic[highlighted].name].src = graphic[highlighted].off.src;
  }
  highlighted = num;
  self.status = graphic[num].statusText;
}
}

function doMouseOut (num)
{
if(nav3plus && menuActive)
{
  if (highlighted != picked)
  {
    document.images[graphic[highlighted].name].src = graphic[highlighted].off.src;
	self.status = '';
  }
}
}

function synch()
{
	//alert('synch got called');
	if(nav3plus && menuActive)
	{
		var s = self.location.href;
		//alert(s);
		for(i=0;i<graphic.length;i++)
		{
			if(s.indexOf(graphic[i].link) != -1)
			{
				//alert('inside synch got called');
				doClick(i);
			}
		}
	}
}


function rolloverInit()
{
	createTocGraphic("findoutmore", "Find Out More","findoutmore_default.asp");
	createTocGraphic("2005program", "2005 Program","2005program_default.asp");
	createTocGraphic("register", "Register","register_default.asp");
	createTocGraphic("resources", "Resources","resources_default.asp");
	createTocGraphic("pressandmedia", "Press and Media","pressandmedia_default.asp");
	createTocGraphic("contact", "Contact","contact_default.asp");
	createTocGraphic("sponsors", "Sponsors","sponsors_default.asp");
	createTocGraphic("partnerships", "Partnerships","partnerships_default.asp");
	createTocGraphic("gallery", "2005 Gallery","gallery.asp");
	if(self.location.href.indexOf("sponsors") != -1)
	{
		createTocGraphic("sponsorssub", "Sponsor List","sponsors_list.asp");
		createTocGraphic("corporatepackages", "Corporate Packages","sponsors_corporatepackages.asp");
	}
	if(self.location.href.indexOf("2005program") != -1)
	{
		createTocGraphic("speakers", "Speakers","2005program_speakers.asp");
		createTocGraphic("briefs", "Briefs","2005program_briefs.asp");
	}
	createTocGraphic("blank", "","blank");
	menuActive = true;
	top.loaded = true;
	parent.loaded = true;
	synch();
}

window.onload = init;