var st=1;
var stmax=5;
function animlayers(){
  var isOpera = (navigator.userAgent.indexOf("Opera") != -1); 
  var uni = document.getElementById("universe");
	var bani = document.getElementById("banner00");
	if (isOpera) {
	  uni.setAttribute("align","left")
		bani.className="b00op";
	}
	else {
		uni.setAttribute("align","center")
		bani.className="b00";
	}
  setTimeout("flashlayer()",100);
  setTimeout("flashlayer()",1000);
  setTimeout("flashlayer()",2000);
  setInterval("flashlayer()",4500);
}
function flashlayer(){
  if (st>stmax) st=3;
	  id = 'ban'+st;
		setTimeout("opacity('" + id + "', 0, 100, 1000)",1000);
  if (st>2) { //hide the print
	  setTimeout("opacity('" + id + "', 100, 0, 1000)",3000);
	}
	 ++st;
}
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++; 
        } 
    } else if(opacStart < opacEnd) { 
        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 popup(mypage,mytitle,w,h) {
  if(screen.width){
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
  }
  else{winl = 0;wint =0;}

  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
	
  var marg = 20;
  var w1 = w + marg;
  var h1 = h + marg;

  var settings = 'height=' + h1 + ',';
  settings += 'width=' + w1 + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += 'titlebar=no,location=no,resizable=yes,status=no';

  var url = 'images/stories/' + mypage;
  myWin = window.open('',mytitle,settings);

  with (myWin.document) {
    writeln("<html>");
    writeln("<head>");
    writeln("<title>"+mytitle+"</title>");
    writeln("</head>");
    writeln("<body onLoad='self.focus()' onBlur='self.close()' link='#000000' alink='#000000' vlink='#000000' bgcolor='#FFFFFF'>");
    write("<img src='"+url+"' alt='"+title+"' border='0' height='"+h+"' width='"+w+"' />\n");
    write("</body></html>\n");
  }
  myWin.document.close();	     
}

