function get_random(iIni, iFim) {
    var ranNum= iIni + Math.round(Math.random()*(iFim-iIni));
    return ranNum;
}

function makeTransition(imgTarget) {
   // efeito de transição em imagens e textos	
   imgTarget.style.visibility = "hidden"
   imgTarget.filters.revealTrans.apply()
   imgTarget.style.visibility = "visible"
   imgTarget.filters.revealTrans.play()
}

function BomDia() {
   // insere um Bom Dia, Boa Tarde ou Boa Noite	ao documento
   var hoje = new Date()
   var horas = hoje.getHours()

   if ( (horas >= 5) && (horas < 12) ) 
   {
      document.write("Bom Dia,")
   }
   else if ( (horas >= 12) && (horas <= 18) )
   {
      document.write("Boa Tarde,")
   }
   else 
   {
      document.write("Boa Noite,")
   }
} 


function BomDiaVar() {
   // retorna um Bom Dia, Boa Tarde ou Boa Noite a uma variável
   var hoje = new Date()
   var horas = hoje.getHours()

   if ( (horas >= 5) && (horas < 12) ) 
   {
      return("Bom Dia,")
   }
   else if ( (horas >= 12) && (horas <= 18) )
   {
      return("Boa Tarde,")
   }
   else 
   {
      return("Boa Noite,")
   }
} 


//This is the master JavaScript file for the HTML Help documentation.

/* These functions (doSection, noSection) are used to make sidebars appear and disappear.
*/

function doSection (secNum){
	//display the section if it's not displayed; hide it if it is displayed
	if (secNum.style.display=="none"){secNum.style.display=""}
	else{secNum.style.display="none"}
}

function noSection (secNum){
	//remove the section when user clicks in the opened DIV
	if (secNum.style.display==""){secNum.style.display="none"}
}

function doExpand(paraNum,arrowNum){
	//expand the paragraph and rotate the arrow; collapse and rotate it back
	if (paraNum.style.display=="none")
		{paraNum.style.display="";arrowNum.src="arrowdn.gif"}
	else{paraNum.style.display="none";arrowNum.src="arrowrt.gif"}
}

//These functions control the behavior of the homepage go arrows.
function liteGo(spNo){
	spNo.style.background="#00cc33";
	spNo.style.color="#FFFFFF";
}

function liteOff(spNo){
	spNo.style.background="transparent";
	spNo.style.color="#000000";
}

/* Evita visualização de código ao clicar botão direito */

function nocontextmenu() {
  event.cancelBubble = true, event.returnValue = false;
  return false;
} 

function norightclick(e) {
  if (window.Event) {
    if (e.which == 2 || e.which == 3) return false;
  }
  else if (event.button == 2 || event.button == 3) {
    event.cancelBubble = true, event.returnValue = false;
    return false;
  }
}


//Return current dir -- '' if in browser or path to CHM if in a CHM
//If in browser then - location.href=file:///d:/path/file.htm
//If in CHM then - location.href=mk:@MSITStore:D:\path\help.chm::/file.htm 
function GetCurrDir() {
  var X, Y, sl, a, ra, dir;
  ra = /::/;
  a = location.href.search(ra);
  if (a <= 0)   //no a CHM - return an empty string
    return('');

  //find the index of the first colon in the string 
  ra = /:/;
  a = location.href.search(ra);
  if (a == 2)
    X = 14;  //prefix = mk:@MSITStore:
  else
    X = 7;   //prefix = ms-its: 

  //find last back slash
  sl = "\\";
  Y = location.href.lastIndexOf(sl);
  dir = location.href.substring(X, Y);

  //UnEscape path - EG. Replace %20 with spaces
  var dir2 = unescape(dir) 
  return(dir2);
  }


// pop-up
	function min(a,b)
	{
		return ((a)<(b))?(a):(b);
	}

	function max(a,b)
	{
		return ((a)>(b))?(a):(b);
	}

	function addBulle(nom, terme, definition)
	{
			document.write("<Div Id=\""+nom+"\" class=\"planqued\"><TABLE BORDER=1 BORDERCOLORLIGHT=#FFFFFF BORDERCOLORDARK=#B3020B CELLSPACING=0 CELLPADDING=3 WIDTH=200><TR><TD><DIV CLASS=\"help\">"+terme+"&nbsp;:</DIV></TD></TR><TR><TD><DIV class=\"help\">"+definition+"</DIV></TD></TR></TABLE></Div>");
	}

	function showBulle(nom, e)
	{
		var xL = min(e.x, document.body.offsetWidth - document.all(nom).offsetWidth);
		document.all(nom).style.left=xL;
		document.all(nom).style.top=max(e.y - document.all(nom).offsetHeight + document.body.scrollTop,document.body.scrollTop);
		document.all(nom).className='montred';
		return;
	}

	function hideBulle(nom)
	{
		document.all(nom).className='planqued';
		return;
	}
