// JavaScript Document
  function show_flash(id, r){
    if (r) clearInterval(timerStartID);
    document.getElementById('flash_'+sel_flash).style.display = 'none';
    document.getElementById('show_flash_'+sel_flash).className = 'show_flash';

   	document.getElementById('flash_'+id).style.display = 'block';
   	document.getElementById('show_flash_'+id).className = 'show_flash active';
    sel_flash = id;
				if (r) timerStartID=setTimeout('show_rnd_flash()',5000);
    return;
  }
  function show_rnd_flash(){
    //id = Math.floor(Math.random()*max_flash);
    if(sel_flash < (max_flash - 1)){
     id = sel_flash + 1;
				} else {
     id = 0;
				}
     
    show_flash(id,0);
    timerStartID=setTimeout('show_rnd_flash()',5000);
  }

  function show_flash_p(idp, rp){
    if (rp) clearInterval(timerStartIDP);
    document.getElementById('flash_p_'+sel_flash_p).style.display = 'none';
    document.getElementById('show_flash_p_'+sel_flash_p).className = 'show_flash_p';

   	document.getElementById('flash_p_'+idp).style.display = 'block';
   	document.getElementById('show_flash_p_'+idp).className = 'show_flash_p active_p';
    sel_flash_p = idp;
    if (rp) timerStartIDP=setTimeout('show_rnd_flash_p()',5000);
    return;
  }  
  
  
  function show_rnd_flash_p(){
    //idp = Math.floor(Math.random()*max_flash_p);
 			
    if(sel_flash_p < (max_flash_p - 1)){
     idp = sel_flash_p + 1;
				} else {
     idp = 0;
				}				
				
				
				show_flash_p(idp,0);
    timerStartID=setTimeout('show_rnd_flash_p()',5000);
  }
