// JavaScript Document

<!--
  var current_press = 0;
  var article_count = 0;

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
			if(i == opacEnd) { showhide(id, 'hide'); }
        }
    } else if(opacStart < opacEnd) {
        showhide(id, 'show');
		for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function showhide(id, sh_toggle) {
	var object = document.getElementById(id).style;
	if(sh_toggle == 'show') { object.visibility = 'visible'; }
	if(sh_toggle == 'hide') { object.visibility = 'hidden'; }
}

  function change_article(article_change) {

	if(article_change == 'next') {
	  current_press++;
	  if(current_press > article_count) { current_press = 0; }
	}

	if(article_change == 'previous') {
	  current_press--;
	  if(current_press < 0) { current_press = article_count; }
	}

	press_room_call(current_press);
  }

function press_room_call(change_to) {

  parent.document.getElementById('pressroom').src = 'press_box.php?go=grab_article&move_to=' + change_to + '&num=' + Math.random();

}

function update_vars(the_current, the_count) {

  current_press = the_current;
  article_count = the_count;

}

-->