
function IssueSelected( issueList ) {
  var index = issueList.selectedIndex;

  window.location.href = issueList.options[index].value;
}

function selectEvent( selId ) {
  var ctl = document.all(selId);
  var idx = ctl.selectedIndex;
  
  location = ctl.options(idx).value;
}

function isIE() {
  return navigator.appName.indexOf("Explorer") > 0;
}

function onResize() {
  var width, height;
  var x, y;

  if ( isIE() ) {
    width  = document.body.clientWidth;
    height = document.body.clientHeight;
  }
  else {
    width  = window.innerWidth;
    height = window.innerHeight;
  }
  x = ( width < 285 + 120) ? 120 : ((120 + width - 285) / 2);
  y = ( height < 380 + 50) ? 50  : ((50 + height - 380) / 2);

  document.body.style.backgroundPositionX = x + 'px';
  document.body.style.backgroundPositionY = y + 'px';
}

// Effects
Effects = {};

Effects.fade = function(id, opacStart, opacEnd, duration, callback)
{
	Effects.changeOpacity(0, id);
	var speed = Math.round(duration/100);
	var timer = 0;

	if(opacStart > opacEnd)
	{
		for(var i=opacStart; i>=opacEnd; i--)
		{
			setTimeout("Effects.changeOpacity("+ i +", '"+ id +"', "+ opacEnd +", '"+ callback +")", (timer*speed));
			timer++;
		}
	}
	else if(opacStart < opacEnd)
	{
		for(var i=opacStart; i<=opacEnd; i++)
		{
			setTimeout("Effects.changeOpacity("+ i +", '"+ id +"', "+ opacEnd +", '"+ callback +"')", (timer*speed));
			timer++;
		}
	}
}

Effects.changeOpacity = function(opacity, id, endPoint, callback)
{
	var _style = document.getElementById(id).style;
    _style.opacity = (opacity / 100);
    _style.MozOpacity = (opacity / 100);
    _style.KhtmlOpacity = (opacity / 100);
    _style.filter = "alpha(opacity=" + opacity + ")";
	
	if(opacity == endPoint && callback != null)
	{
		eval(callback);
	}
}
