var $j	= jQuery.noConflict();
var PSI_MSG = Array();
$j(document).ready(function(){
$j.get("/psi/getmessages/",function(data){
  PSI_MSG = data.split("\n");
  //alert(PSI_MSG);
  psimsg();
});
});

var iteration = 0;
function psimsg(){
  //iteration = iteration+1;
  /*if(iteration==PSI_MSG.length){
    iteration = 0;
  }*/
  var lastit = iteration;
  
  if(PSI_MSG.length>1){
  while(lastit == iteration){
    iteration = Math.floor(Math.random() * PSI_MSG.length);
  //alert(iteration);
    //alert(PSI_MSG.length);
    if(PSI_MSG.length==0) break;
  }
  }
  
  //alert(iteration);
  $j("#PSIBARMAIN").slideUp(function(){
    $j("#PSIBARMAIN").html(PSI_MSG[iteration]);
    $j("#PSIBARMAIN").slideDown();
		if(PSI_MSG.length>1){
			window.setTimeout("psimsg()",10000);
		}
  });
}// JavaScript Document
