

if (document.images){
  
  on_button01 = new Image();
  on_button01.src = "http://cdn.aim.com/i/on_button01.gif";

  on_button02 = new Image();
  on_button02.src = "http://cdn.aim.com/i/on_button02.gif";

  on_button03 = new Image();
  on_button03.src = "http://cdn.aim.com/i/on_button03.gif";

  on_button04 = new Image();
  on_button04.src = "http://cdn.aim.com/i/on_button04.gif";

  on_button05 = new Image();
  on_button05.src = "http://cdn.aim.com/i/on_button05.gif";
  
  on_button06 = new Image();
  on_button06.src = "http://cdn.aim.com/i/on_button06.gif";
  
  on_button07 = new Image();
  on_button07.src = "http://cdn.aim.com/i/on_button07.gif";

  on_button08 = new Image();
  on_button08.src = "http://cdn.aim.com/i/on_button08.gif";
  
  on_button09 = new Image();
  on_button09.src = "http://cdn.aim.com/i/on_button09.gif";
  
  on_starting_out = new Image();
  on_starting_out.src = "http://cdn.aim.com/i/on_arrow.gif";
  
 }

var imgName = "button01";

function img_act(imgName)
{
      if (document.images)
	  {
	  	imgOn = "http://cdn.aim.com/i/on_" + imgName + ".gif";
		document[imgName].src = imgOn;
	  }
}

function img_inact(imgName)
{
	if (document.images)
	{
		imgOff = "http://cdn.aim.com/i/off_" + imgName + ".gif";
		document[imgName].src = imgOff;
	}
}

function img_act2(imgName)
{
      if (document.images)
	  {
	  	imgOn = "http://cdn.aim.com/i/on_" + imgName + ".gif";
		document.menu1[imgName].src = imgOn;
	  }
}




var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;


if (document.getElementById) {isID = 1; isDHTML = 1;}
else
{
		if (document.all) {isAll = 1; isDHTML = 1;}
		else
		{
				browserVersion = parseInt(navigator.appVersion);
				if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
		}
}

function sniffDOM(id,styleType)
{
	if (styleType == 1)
	{
		if (isID) { return (document.getElementById(id).style) ; }
		else
		{ 
			if (isAll) { return (document.all[id].style); }
			else
			{
				if (isLayers) { return (document.layers[id]); }
			};
		}
	}
	else
	{
			if (isID) { return (document.getElementById(id)) ; }
			else
			{ 
				if (isAll) { return (document.all[id]); }
				else
				{
					if (isLayers) { return (document.layers[id]); }
				}
			;}
	}
}

var menuTop = 165;
var domSMenu = null;
var oldDomSMenu = null;
var t = 0;
var pause = 5;
var count = 0;

function doFlyout(menuNum,top) //can remove parameter top
{
	if (isDHTML)
	{
		t = 2;
		if (oldDomSMenu)
		{
			oldDomSMenu.visibility = 'hidden'; 
			oldDomSMenu.zIndex = '0'; 
			t = 2; 
			count = 0;
		}

		var idSMenu = 'menu' + menuNum;
		var domSMenu = sniffDOM(idSMenu,1);

// Offset the height for IE on the Mac	
		var heightOffset = 0;
		var UA = navigator.userAgent;
		var ua = UA.toLowerCase();
		var loc = new String(document.location);
  		
      	if((loc.indexOf("?aolp=1")!=-1) && (menuNum==1))
   	  	{
		  menuTop +=  35;
	    } 

		if(ua.indexOf("mac") != -1 && ua.indexOf("msie") != -1)
		{
			heightOffset = 145;
			
		}
		
		if (oldDomSMenu != domSMenu) {	

			domSMenu.left =  160; 
			domSMenu.top = menuTop - heightOffset;
			domSMenu.visibility = 'visible';
			domSMenu.zIndex = '100';
			oldDomSMenu = domSMenu;
			
		}

		else { oldDomSMenu = null; }
	}


	else { return null; }

 }

function hideMenu() {
    if ((oldDomSMenu) && (t == 0)) {

        oldDomSMenu.visibility = 'hidden'; 
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        count = 0; 
        return false;
    }

    if (t == 2) { count = 0; return false; }

    if (t == 1) { 
        count = count + 1;
        if (pause <= count) { t = 0; }
        if (pause >= count) { setTimeout('hideMenu(' + t + ')',100); }
    }

heightOffset = 0;
}


	function toggleMenu(ID)
	{
		if (isAll || isID)
		{
			domStyle = sniffDOM(ID,1);
			
			if (domStyle.display =='block')
			{
				domStyle.display='none';
				if (ID == 'menu2')
				{
					img_inact('starting_out')
				}
				if (ID == 'menu3')
				{
					img_inact('using')
				}
			}
			else
			{
				domStyle.display='block';
				if (ID == 'menu2')
				{
					img_act('starting_out');
				}
				if (ID == 'menu3')
				{
					img_act('using');
				}
			}
	}
	else
	{
		if (ID == "menu2")
		{
			location.replace("http://www.aim.com/help_faq/starting_out/index.adp?aolp=");
		}
		if (ID == "menu3")
		{
			location.replace("http://www.aim.com/help_faq/using/index.adp?aolp=");
		}
	}
	return;
}

