function OpenUrlSelect(Obj){

	var value = Obj.options[Obj.selectedIndex].value;

	var array = value.split(";");

	window.open(array[1], array[0]);

}



function FormataData(campo,teclapres) {

	var tecla = teclapres.keyCode;

	var obj = document.getElementById(campo);

	vr = obj.value;

	vr = vr.replace( ".", "" );

	vr = vr.replace( "/", "" );

	vr = vr.replace( "/", "" );

	tam = vr.length + 1;



	if ( tecla != 9 && tecla != 8 ){

		if ( tam > 2 && tam < 5 )

			obj.value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );

		if ( tam >= 5 && tam <= 10 )

			obj.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); 

	}

}



// url_encode version 1.0  

function UrlEncode(str) {  

    var hex_chars = "0123456789ABCDEF";  

    var noEncode = /^([a-zA-Z0-9\_\-\.])$/;  

    var n, strCode, hex1, hex2, strEncode = "";  



    for(n = 0; n < str.length; n++) {  

        if (noEncode.test(str.charAt(n))) {  

            strEncode += str.charAt(n);  

        } else {  

            strCode = str.charCodeAt(n);  

            hex1 = hex_chars.charAt(Math.floor(strCode / 16));  

            hex2 = hex_chars.charAt(strCode % 16);  

            strEncode += "%" + (hex1 + hex2);  

        }  

    }  

    return strEncode;  

}  



// url_decode version 1.0  

function UrlDecode(str) {  

    var n, strCode, strDecode = "";  



    for (n = 0; n < str.length; n++) {  

        if (str.charAt(n) == "%") {  

            strCode = str.charAt(n + 1) + str.charAt(n + 2);  

            strDecode += String.fromCharCode(parseInt(strCode, 16));  

            n += 2;  

        } else {  

            strDecode += str.charAt(n);  

        }  

    }  

    return strDecode;  

}  



function showLoading()

{

	document.body.style.cursor = 'wait';

	document.getElementById('loading').style.display = 'block';

}



function hideLoading()

{

	document.body.style.cursor = '';

	document.getElementById('loading').style.display = 'none';

}



function textCounter(campo, countcampo, maxlimit){ //Esta função que irá contar, mostrar e restringir o tamanho do campo

    if (campo.value.length > maxlimit) { //se passar do limite não deixará entrar o caracter

		campo.value = campo.value.substring(0, maxlimit);

	}

	else { //aqui, enquanto não se chegar ao limite, a cada caracter inserido ele reduzira -1 da contagem

        countcampo.value = maxlimit - campo.value.length;

	}

}



function displayOff( id ){

	document.body.style.cursor = '';

	//document.getElementById(id).style.display = 'none';

	document.getElementById(id).style.visibility = 'hidden';

}

function displayOn( id ){

	document.body.style.cursor = 'wait';

	//document.getElementById(id).style.display = 'block';

	document.getElementById(id).style.visibility = 'visible';

}



Util = {

    DebugObj : function(obj){

        var temp = "";

        for(x in obj)

            temp += x + ": " + obj[x] + "\n";

        alert(temp);

    },

    Formatar : function(valor){

        var valores = new String(valor).split('.');

        if(valores != valor){

            if(valores[1].length > 2){

                var outrosValores = valores[1].split('');

                return (valores[0] + "," + outrosValores[0] + outrosValores[1]);

            }

            else if(valores[1].length==1)

                return valor + "0";

            else

                return valor;

        }

        else{

            return valor + ",00";

        }

    },

    Popup : function(url){

           window.open(url,"", 'width=720, height=450, scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

    }

}
function Void(x){
x=0;
}


function Confime_acao($pergunta,$url,$cancelado){

		var name = confirm($pergunta);
		if (name == true) {
		if (!$url == '') {location.href=$url;}
		}else {
		(alert($cancelado));
		} ;
}


//###########################################################################
//###################| CONTA CARACTERES, Levy Mac® |#########################
//######| http://www.levymac1.hpg.com.br ou http://www.levymac.com.br |######
//###########################################################################  
var vez  = 0;function max(txarea,total,Digitad,Restant){ 
var msg  = "ATENÇÃO!\n\n Você atingiu o limite máximo de caracteres!";
var msg2 = "ATENÇÃO,\n\nPor favor não insista!\n\nVocê já atingiu o limite máximo de caracteres!";
var tam  = txarea.value.length; 
str=""; 
str=str+tam; 
document.getElementById(Digitad).innerHTML = str; 
document.getElementById(Restant).innerHTML = total - str; 
if (tam >= total){ 
aux = txarea.value; 
txarea.value = aux.substring(0,(total-1)); 
Digitad.innerHTML = (total) ;
Restant.innerHTML = 0;
if((total-tam)>=0){
if(msg){vez++;
if(vez>3){alert(msg2)}else{alert(msg)}}
}}} 


//##########################################################################
//###################| RECONHECE BROSER, LevyMac® |#########################
//#####| http://www.levymac1.hpg.com.br ou http://www.levymac.com.br |######
//##########################################################################
function Browser() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf("opera") != -1) {
        browserName = "opera";
        	//return 1;
		return browserName;

    } else if (ua.indexOf("msie") != -1) {
        browserName = "msie";
        	//return 2;
		return browserName;

    } else if (ua.indexOf("safari") != -1) {
        browserName = "safari";
        	//return 3;
		return browserName;

    } else if (ua.indexOf("mozilla") != -1) {
        if (ua.indexOf("firefox") != -1) {
            browserName = "firefox";
            	//return 4+'Mozila';
		return browserName;

        } else {
            browserName = "mozilla";
            	//return 5;
		return browserName;
        }
    } 
}




//##############################################################
//################| TRANSIÇÃO DE FOTOS |########################
//##############################################################
function briaskISS(idModule, random, picInterval, transDelay, picArray)
{
	this.picRandom = random;
	this.picInterval = picInterval;
	this.transDelay = transDelay;
	this.picArray = picArray;

	this.curPic = 0;
	this.nextPic = 0;
	this.numPics = 0;
	this.curOpacity = 99
	this.nextOpacity = 0;

	this.idModule = idModule;

	this.initISS();
	

document.write("<style> @CHARSET \"ISO-8859-1\"; ")
document.write(" ul.briask-iss {position:relative;list-style:none;list-style-image:none;margin:0px auto;padding:0px;overflow:hidden;border:none;background:none;}")
document.write(" ul.briask-iss li {list-style:none;margin:0px;padding:0px;border:none;background:none;}")
document.write(" ul.briask-iss li a {margin:0px;padding:0px;border:none;background:none;}")
document.write(" ul.briask-iss li a img {display:none;position:absolute;padding:0px;top:0;left:0;border:none;background:none;}")
document.write(" ul.briask-iss li img {display:none;position:absolute;top:0;padding:0px;left:0;border:none;background:none;}")
document.write(" ul.briask-iss li img {visibility:visible;}")
document.write("</style>")

}

briaskISS.prototype.initISS=function()
{
	if (!document.getElementById || !document.createElement) return;

	this.picArray[0]
		= document.getElementById("briask-iss"+this.idModule).getElementsByTagName("img");

	this.numPics = this.picArray[0].length ;

	for(i = 0; i < this.picArray[0].length; i++)
		{
			this.picArray[0][i].opacity = 0;
			this.picArray[0][i].style.MozOpacity = .0;
			this.picArray[0][i].style.filter = "alpha(opacity=0)";
		}

	if (this.picRandom == 1)
	{
		this.issNextPic();
	}

	this.picArray[0][this.nextPic].style.display = "block";
	this.picArray[0][this.nextPic].style.opacity = .99;
	this.picArray[0][this.nextPic].style.MozOpacity = .99;
	this.picArray[0][this.nextPic].style.filter = "alpha(opacity=" + (.99*100) + ")";

	setTimeout("briaskInstance"+this.idModule+".issShow()", this.picInterval);
}

briaskISS.prototype.issShow=function()
{
	this.issNextPic();

	this.picArray[0][this.nextPic].style.display = "block";
	this.curOpacity = 100, this.nextOpacity = 0;

	setTimeout("briaskInstance"+this.idModule+".issTransition()", this.transDelay);
}

briaskISS.prototype.issNextPic=function()
{
	if (this.picRandom == 0)
	{
		if (this.curPic < (this.numPics - 1))
		{
			this.nextPic = this.curPic + 1;
		}
		else
		{
			this.nextPic = 0;
		}
	}
	else
	{
		do
		{
			now = new Date();

			var rndPic = Math.ceil(this.numPics * Math.random(this.idModule)) - 1;

		} 	while (this.curPic == rndPic)

		this.nextPic = rndPic;
	}
}

briaskISS.prototype.issTransition = function ()
{
	this.picArray[0][this.curPic].style.opacity = this.curOpacity/100;
	this.picArray[0][this.curPic].style.MozOpacity = this.curOpacity/100;
	this.picArray[0][this.curPic].style.filter = "alpha(opacity=" + (this.curOpacity) + ")";

	this.picArray[0][this.nextPic].style.opacity = this.nextOpacity/100;
	this.picArray[0][this.nextPic].style.MozOpacity = this.nextOpacity/100;
	this.picArray[0][this.nextPic].style.filter = "alpha(opacity=" + (this.nextOpacity) + ")";



	if (this.curOpacity > 0)
	{
		this.curOpacity -= 4;
		this.nextOpacity += 4;
		setTimeout("briaskInstance"+this.idModule+".issTransition()", this.transDelay);

	}
	else
	{
		this.picArray[0][this.curPic].style.display = "none";

		this.curPic = this.nextPic;
		setTimeout("briaskInstance"+this.idModule+".issShow()", this.picInterval);
		
					
	largura = this.picArray[0][this.nextPic].width;
	altura = this.picArray[0][this.nextPic].height;
		  //confirm(altura + "x" + largura);
		  var box = 'box_agenda';
		  var elemento ='briask-iss65';
		
		  if(document.getElementById(box)){ 
		  var almentabox = document.getElementById(box).style.height=(altura+30);
		  }else{confirm("ERRO! \n\nO elemento ou objeto \ncom o id=''"+box+"'' \nnão foi encontrato \nem ''Agenda de Eventos''! \n\nPor favor contate seu web designer" )}
		  if(document.getElementById(elemento)){ 
		  var almentafot = document.getElementById(elemento).style.height=altura;
		  }else{confirm("ERRO! \n\nO elemento ou objeto \ncom o id=''"+elemento+"'' \nnão foi encontrato \nem ''Agenda de Eventos''! \n\nPor favor contate seu web designer!" )}
		 	
	}
}


//######################################################################
//#######################| FLASH PARA IE GERAL |########################
//######################################################################

function GerarSWF($arquivo,$largura,$altura,$id){
document.writeln('<object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="' + $largura + '" height="' + $altura + '" id="' + $id + '" name="' + $id + '">');
if($id=='transparent'){document.writeln('<param name="wmode" value="transparent" />');}
document.writeln('<param name="movie" value="' + $arquivo + '" />');
document.writeln('<param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
document.writeln('<param name="menu" value="false" />');
document.writeln('<param name="quality" value="high" />');
//document.writeln('<param name="scale" value="noscale" />');

if($id=='transparent'){
document.writeln('<embed id="globalnav-embed" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" quality="high" scale="noscale" id="' + $id + '" src="' + $arquivo + '" wmode="transparent" width="' + $largura + '" height="' + $altura + '"></embed>');
}else{
document.writeln('<embed pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" id="' + $id + '" src="' + $arquivo + '"  width="' + $largura + '" height="' + $altura + '"></embed>');
}

document.writeln('</object>');
}
//######################################################################

//######################################################################
//#######################| CHANGE PROP |################################
//######################################################################
function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
//######################################################################


//######################################################################
//########################| DRAG LAYER |################################
//######################################################################

var objSelecionado = null;
var mouseOffset = null;
function addEvent(obj, evType, fn) {
if (typeof obj == "string") {
  if (null == (obj = document.getElementById(obj))) {
   throw new Error("Elemento HTML não encontrado. Não foi possível adicionar o evento.");
  }
}
if (obj.attachEvent) {
  return obj.attachEvent(("on" + evType), fn);
} else if (obj.addEventListener) {
  return obj.addEventListener(evType, fn, true);
} else {
  throw new Error("Seu browser não suporta adição de eventos.");
}
}
document.onmousemove = function(ev) {
var ev = ev || window.event;
var mousePos = mouseCoords(ev);
if (objSelecionado) {
  document.getElementById(objSelecionado).style.left = mousePos.x - mouseOffset.x + 'px';
  document.getElementById(objSelecionado).style.top = mousePos.y - mouseOffset.y + 'px';
  document.getElementById(objSelecionado).style.margin = '0px';
  return false;
}
}
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
  return {x:ev.pageX, y:ev.pageY};
}
return {
  x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
  y:ev.clientY + document.body.scrollTop  - document.body.clientTop
};
}
function getPosition(e, ev){
e = document.getElementById(e);
var left = 0;
var top  = 0;
var coords = mouseCoords(ev);
while (e.offsetParent){
  left += e.offsetLeft;
  top  += e.offsetTop;
  e     = e.offsetParent;
}
left += e.offsetLeft;
top  += e.offsetTop;
return {x: coords.x - left, y: coords.y - top};
}
document.onmouseup = function() {
objSelecionado = null;
}
function dragdrop(local_click, caixa_movida) {
document.getElementById(local_click).style.cursor = 'move';
addEvent(local_click, 'mousedown', function(ev) {
  objSelecionado = caixa_movida;
  mouseOffset = getPosition(objSelecionado, ev);
});
}


function start_msg(msg,$i){
	if(msg){
	document.write('<TABLE CELLPADDING=5 CELLSPACING=5 BORDER=0 id="paleta'+$i+'" WIDTH=95% HEIGHT=87% ><TR><TD valign="top" align="left" BGCOLOR="#F5F5F5">');
	document.write("</div id='msgE'"+$i+">&nbsp;&nbsp;"+msg+"</div>");
	document.write('</TD><TD WIDTH=5>&nbsp;</TD></TR></TABLE>');
	}
}
//######################################################################

//######################################################################
//#######################| COORDENDAS DO MOUSE |########################
//######################################################################

function Coordenadas_Mouse(id,a,b){
//alert(Browser());

	if(Browser()=='msie'){
		/* //POSICIONAMENTO COM O MOUSE
		document.getElementById(id).style.top  = (window.event.y-a)+"px";
		document.getElementById(id).style.left = (window.event.x-b)+"px";
		//*/
		document.getElementById(id).style.top  = ('25%');
		document.getElementById(id).style.left = ('30%');
		$posicaoy = document.getElementById(id).style.top
		$altura = document.getElementById(id).style.height;
		$posicaox = document.getElementById(id).style.left
		$largura = document.getElementById(id).style.width;
		
		$largura = $largura.replace(/\px/g,'');
		$posicaox = $posicaox.replace(/\%/g,'');
		$largura = (($posicaox-($largura/2))+($posicaox*23.6))/15;
		
		$altura = $altura.replace(/\px/g,'');
		$posicaoy = $posicaoy.replace(/\%/g,'');
		$altura = (($posicaoy-($altura/2))+($posicaoy*10.6))/6;
		document.getElementById(id).style.left = $largura+'%';
		document.getElementById(id).style.top = $altura+'%';
		document.getElementById(id).style.position = 'fixed';


		//alert('[' + $largura + ']');
	}else{
		var objeto = document.getElementById(id);
		
		objeto.style.top  = (window.screenY-(a-500))+"px";
		objeto.style.left = (window.screenX-(b-290))+"px";
		/* //POSICIONAMENTO COM O MOUSE
		document.getElementById(id).style.top  = (screenY-a);
		document.getElementById(id).style.left = (screenX-b);
		//*/

		document.getElementById(id).style.top  = ('25%');
		document.getElementById(id).style.left = ('30%');
		$posicaoy = document.getElementById(id).style.top
		$altura = document.getElementById(id).style.height;
		$posicaox = document.getElementById(id).style.left
		$largura = document.getElementById(id).style.width;
		
		$largura = $largura.replace(/\px/g,'');
		$posicaox = $posicaox.replace(/\%/g,'');
		$largura = (($posicaox-($largura/2))+($posicaox*23.6))/15;
		
		$altura = $altura.replace(/\px/g,'');
		$posicaoy = $posicaoy.replace(/\%/g,'');
		$altura = (($posicaoy-($altura/2))+($posicaoy*10.6))/6;
		document.getElementById(id).style.left = $largura+'%';
		document.getElementById(id).style.top = $altura+'%';
		document.getElementById(id).style.position = 'fixed';
		
		//alert('[' + $altura + ']');
	}

}
//######################################################################




//######################################################################
//###########################| START FRAME |############################
//######################################################################
function start_frame(id){

	if(id){
	document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 id="tabela'+id+'" WIDTH=100% HEIGHT=88% ><TR><TD valign="top" align="left" BGCOLOR="#FFFFFF">');
	document.write('&nbsp;<iframe name=\"'+id+'\" src=\"enquete'+id+'/enquete.php\" align=\"middle\" scrolling=\"no\" frameborder=\"0\" height=\"300\" width=\"98%\">');
	document.write('Seu navegador não oferece suporte para frames ou está configurado para não exibi-los.');
	document.write('</iframe>');
	document.write('</TD><TD WIDTH=5>&nbsp;</TD></TR></TABLE>');

	}}
//######################################################################




//######################################################################
//########################| START FRAME EDIT |##########################
//######################################################################
function start_frame_edit(id){

	if(id){
	document.write('<TABLE CELLPADDING=5 CELLSPACING=5 BORDER=0 id="tabela'+id+'" WIDTH=95% HEIGHT=80% ><TR><TD valign="top" align="left" BGCOLOR="#FFFFFF">');
	document.write('&nbsp;<iframe name=\"frame'+id+'\" src=\"enquete'+id+'/bannersedit.php\" align=\"middle\" scrolling=\"no\" frameborder=\"0\" height=\"295\" width=\"95%\">');
	document.write('Seu navegador não oferece suporte para frames ou está configurado para não exibi-los.');
	document.write('</iframe>');
	document.write('</TD><TD WIDTH=5>&nbsp;</TD></TR></TABLE>');

	}}
//######################################################################




//######################################################################
//#####################| START COMUNIDADE EDIT |########################
//######################################################################
function start_comunidade_edit(id){

	if(id){
	document.write('<TABLE CELLPADDING=5 CELLSPACING=5 BORDER=0 id="tabela'+id+'" WIDTH=95% HEIGHT=80% ><TR><TD valign="top" align="left" BGCOLOR="#FFFFFF">');
	document.write('&nbsp;<iframe name=\"comunidade'+id+'\" src=\"enquete'+id+'/bannersedit.php\" align=\"middle\" scrolling=\"no\" frameborder=\"0\" height=\"295\" width=\"95%\">');
	document.write('Seu navegador não oferece suporte para frames ou está configurado para não exibi-los.');
	document.write('</iframe>');
	document.write('</TD><TD WIDTH=5>&nbsp;</TD></TR></TABLE>');

	}}
//######################################################################




//######################################################################
//##############| CONFIGURAÇÃO DAS FUNÇÕES A SEGUIR |###################
//######################################################################
			var style_function;
			style_function = '<STYLE>';
			/* CSS Document */
			style_function += '@charset utf-8;';

			style_function += 'html, body { height: 100%; }';
			style_function += '* html div#m2brOverlay { height: 100%; }';
			style_function += 'div > div#m2brDialogJanela, div > div#m2brOverlay { position:fixed; }';
			style_function += 'div#m2brOverlay { width: 100%; height: 100%; display: none; z-index: 160; position: absolute; left:0; top:0; filter:alpha(opacity=70); -moz-opacity: 0.65; opacity: 0.65; background: #000;/*overlay*/ }/*#eaf3fa;*/';
			style_function += 'div#m2brDialogJanela { top: 50%; left: 50%; margin: 0; padding: 0; color: #2D68AE/*#fff*/; display: none; z-index: 1000000; font: 11px Arial, Helvetica, Tahoma, sans-serif; position: absolute; border: 1px solid #000/*#6997d2*/; background: #33689a; }';
			style_function += 'div#m2brDialogJanela-texto a {font-size:12px;font-style: italic;}';


			style_function += 'div#m2brDialogJanela h2{color:#000/*#b3ddf9*/;height:16px;font-size:12px;text-transform:uppercase;margin:0;font-weight:700;text-align:center;margin-bottom:10px;background:url(imgs/m2brbgtitulo.jpg) repeat-x;padding:3px;}';
			style_function += 'div#m2brDialogJanela h2 a#m2brDialogFechar{margin:-2px -7px; display:block;float:right;width:60px/*15*/;height:20px/*15*/;background:url(imgs/ico_close.gif)/*m2brfechar.gif*/ no-repeat;}';
			style_function += 'div#m2brDialogJanela-texto{font-weight:700;font-size:11px;margin-left:54px;margin-right:20px;margin-top:10px;text-align:left;}';
			style_function += 'div#m2brDialogJanela-botoes{text-align:center;margin-top:20px;margin-left:20px;margin-right:20px;}';
			style_function += 'div#m2brDialogJanela-botoes a{border:1px solid #1B3D67/*#fff*/;background-color:#2D68AE;color:#FFF/*#fff*/;font-weight:700;margin-right:3px;text-decoration:none;padding:4px 10px;}';
			style_function += 'div#m2brDialogJanela-botoes a:hover{border:1px solid #2D68AE/*#fff*/;background-color:#1B3D67/*06C*/;}';
			style_function += 'div#m2brDialogJanela-botoes div.carregando{background:url(imgs/m2brloading3.gif) no-repeat;border:none!important;width:62px;height:13px;margin:0 auto;}';
			style_function += 'div#m2brDialogJanela.m2brDialog-alerta{background:#FFFFFF/*#2D68AE*/ url(imgs/m2bralerta.png) no-repeat 12px 25px;}';
			style_function += 'div#m2brDialogJanela.m2brDialog-erro{background:#FFFFFF/*#2D68AE*/ url(imgs/m2brerro.png) no-repeat 12px 25px;}';
			style_function += 'div#m2brDialogJanela.m2brDialog-pergunta{background:#FFFFFF/*#2D68AE*/ url(imgs/m2brpergunta.png) no-repeat 12px 25px;}';
			style_function += 'div#m2brDialogJanela.m2brDialog-info{background:#FFFFFF/*#2D68AE*/ url(imgs/m2brinfo.png) no-repeat 12px 25px;}';
			style_function += 'div#m2brDialogJanela.m2brDialog-script{background:#FFFFFF/*#2D68AE*/ url(#imgs/m2brinfo.png) no-repeat 12px 25px;}';
			style_function += '</STYLE>';
			//######################################
			//###########| PRELOADING |#############
			//######################################
			style_function += '<IMG src="imgs/ico_close.png" style="display:none;">';
			style_function += '<IMG src="imgs/m2brloading3.png" style="display:none;">';
			style_function += '<IMG src="imgs/m2bralerta.png" style="display:none;">';
			style_function += '<IMG src="imgs/m2brerro.png" style="display:none;">';
			style_function += '<IMG src="imgs/m2brpergunta.png" style="display:none;">';
			style_function += '<IMG src="imgs/m2brinfo.png" style="display:none;">';
			//######################################
			
			
			
			document.write(style_function);
			
			var titleStart = 	'<h4 style=color:#FF0000>';
			var titleEnd = 		'</h4>';
//######################################################################















//#######################################################################
//######################| FUNÇÃO SCRIPT |################################
//#######################################################################

		var $i =0;
		function script($titulo,$texto,$altura,$largura){
				
		$texto = $texto.replace(/\n/g,'<BR>');

		$texto = $texto.replace(/\[/g,titleStart);
		$texto = $texto.replace(/\]/g,titleEnd);
		//####################################################
		//############| PRE START DO SCRIPT |#################
		//####################################################
					var ID_Alert = $i++;
		var ScriptPadrao = function(titulo, msg, tipo, altura, largura) {
			var $i
			$('body').append('<LevyMacAlert href="#" id="'+ID_Alert+'"></LevyMacAlert>');
			$('#'+ID_Alert).m2brDialog({
					draggable: true,
					texto: '<div '+$Scrol_V+'>'+msg+'</div>',
					tipo: tipo,
					titulo: titulo,
					altura: altura,
					largura: largura,
					botoes: {
						/*1: {
							label: 'Fechar',
							tipo: 'fechar'
						}
						*/
					}									   
			});
			$('#'+ID_Alert)
				.click()
				.remove();
		};
		//####################################################
		
		
		//################################################
		//############| START DO SCRIPT |#################
		//################################################
		$Scrol_V='';
		$Scrol_H='';
		if($altura>580){$altura=580; $Scrol_V=' style="overflow-y: scroll;height:'+($altura-40)+'px;"';}
		if($altura<220){$altura=220;} 
		if($largura>990){$largura=990; $Scrol_H=' style="overflow-x: scroll;height:'+($largura-40)+'px;"';}
		if($largura<400){$largura=400;}
		
		$(document).ready(function(){
 		ScriptPadrao($titulo, $texto, 'script', $altura,$largura);
 		});
		//################################################
		return (true);}
//#######################################################################




//#######################################################################
//########################| FUNÇÃO INFO |################################
//#######################################################################

		var $i =0;
		function info($texto){
				
		$texto = $texto.replace(/\n/g,'<BR>');

		$texto = $texto.replace(/\[/g,titleStart);
		$texto = $texto.replace(/\]/g,titleEnd);
		//####################################################
		//#############| PRE START DO INFO |##################
		//####################################################
					var ID_Alert = $i++;
		var infoPadrao = function(titulo, msg, tipo, altura, largura) {
			var $i
			$('body').append('<LevyMacAlert href="#" id="'+ID_Alert+'"></LevyMacAlert>');
			$('#'+ID_Alert).m2brDialog({
					draggable: true,
					texto: msg,
					tipo: tipo,
					titulo: titulo,
					altura: altura,
					largura: largura,
					botoes: {
						1: {
							label: 'Fechar',
							tipo: 'fechar'
						}
					}									   
			});
			$('#'+ID_Alert)
				.click()
				.remove();
		};
		//####################################################
		
		
		//################################################
		//#############| START DO INFO |##################
		//################################################
		$(document).ready(function(){
 		infoPadrao('Informa&ccedil;&atilde;o:', $texto, 'info', 220,400);
 		});
		//################################################
		return (true);}
//#######################################################################



//#######################################################################
//########################| FUNÇÃO ALERT |###############################
//#######################################################################
		
		//var $i =0;
		function alert($texto){
				
		$texto = $texto.replace(/\n/g,'<BR>');

		$texto = $texto.replace(/\[/g,titleStart);
		$texto = $texto.replace(/\]/g,titleEnd);
		//####################################################
		//#############| PRE START DO ALERT |#################
		//####################################################
					var ID_Alert = $i++;
		var alertaPadrao = function(titulo, msg, tipo, altura, largura) {
			var $i
			$('body').append('<LevyMacAlert href="#" id="'+ID_Alert+'"></LevyMacAlert>');
			$('#'+ID_Alert).m2brDialog({
					draggable: true,
					texto: msg,
					tipo: tipo,
					titulo: titulo,
					altura: altura,
					largura: largura,
					botoes: {
						1: {
							label: 'Fechar',
							tipo: 'fechar'
						}
					}									   
			});
			$('#'+ID_Alert)
				.click()
				.remove();
		};
		//####################################################
		
		
		//################################################
		//#############| START DO ALERT |#################
		//################################################
		$(document).ready(function(){
 		alertaPadrao('Alerta:', $texto, 'alerta', 220,400);
 		});
		//################################################
		return (true);}
//#######################################################################



//#######################################################################
//######################| FUNÇÃO CONFIRM |###############################
//#######################################################################

		//var $i =0;
		function Confirme_acao($pergunta,$btn1,$btn2,$url1,$url2,$cancelado){
		
		$pergunta = $pergunta.replace(/\n/g,'<BR>');		

		$pergunta = $pergunta.replace(/\[/g,titleStart);
		$pergunta = $pergunta.replace(/\]/g,titleEnd);
		//######################################################
		//#############| PRE START DO CONFIRM |#################
		//######################################################
			
			var ID_Confirm = $i++;
			//var ID_Confirm = 'confirm'+$i;
		var Confirm = function(titulo, msg, tipo, altura, largura) {
			$('body').append('<LevyMacConfirm id="'+ID_Confirm+'"></LevyMacConfirm>');
			var codigo = ID_Confirm;
			$('#'+ID_Confirm).m2brDialog({
				tipo: 		'pergunta',
				titulo:		'Confirme',
				texto:		$pergunta,
				draggable: true,
				
				botoes: {
			
					1: {
						label		: $btn1,
						tipo		: 'link',
						endereco	: $url1
					},
					
					/*
					2: {
						label		: $btn2,
						tipo		: 'link',
						endereco	: $url2
					
					}
					*/
					/*
					2: {
						label		: $btn2,
						tipo		: 'script',
						funcao		: function() { alert($cancelado); }
					
					}
					*/
					//*
			
					2: {
						label		: $btn2,
						tipo		: 'script',
						funcao		: function() { Confirme_acao($cancelado,'OK','Cancelar',$url2,$url2,$cancelado); }
					
					}
			
					//*/
					}
			});
			$('#'+ID_Confirm)
				.click()
				.remove();
		};
		//######################################################
		
		
		//##################################################
		//#############| START DO CONFIRM |#################
		//##################################################
		$(document).ready(function(){
 		Confirm();
 		});
		//################################################
		return (true);}
//#######################################################################
