nOpac = 50
nPlus = 2
nMin = 1
speed = 30
timer = null; 
timer2 = null;

var ie5=(document.all && document.getElementById);
var ns6=(!document.all && document.getElementById);

function fadeImg2(teller)
{
 apl[teller][1] = "Up";
 changes();
}

function fadeImgend2(teller)
{
 apl[teller][1] = "Down";
 setTimeout("changes()",25);
}

function changes()
{
 next_loop = true;
 count = document.getElementById("related_menu_options").rows.length;
 for (i=0;i<count;i++)
 {
  obj = document.getElementById("related_menu_options").rows[i].cells[0];
  opacity = apl[i][0]
  if (apl[i][1] == "Up")
  {
     opacity += nPlus;
     apl[i][0] = opacity;
     if (apl[i][0] > 105) 
      {apl[i][1] = "";}
     else
     {next_loop = false;}
	 nOpac = opacity;
  }
  else
  {
  if (apl[i][1] == "Down")
  {
     opacity -= nMin;
     apl[i][0] = opacity;
     if (apl[i][0] < 45) 
      {apl[i][1] = "";}
     else
     {next_loop = false;}
	 nOpac = opacity;
  }
  }
  if(ie5){ 
	obj.style.filter="alpha(opacity="+opacity+")";
    }
  if(ns6){ 
   	obj.style.MozOpacity = opacity / 100;
   }
 }
 if (next_loop == false)
  {
   timer = setTimeout("changes()",speed);
  }
  else
  {
   clearTimeout(timer);
  }
}

function goToURL(str) { 
	try {
		window.location = str;
	}
	catch(e) {
	}
}
