function __get(){return;}

function extraiScript(texto){
    // inicializa o inicio ><
    var ini = 0;
    // loop enquanto achar um script
    while (ini!=-1){
        // procura uma tag de script
        ini = texto.indexOf('<script', ini);
        // se encontrar
        if (ini >=0){
            // define o inicio para depois do fechamento dessa tag
            ini = texto.indexOf('>', ini) + 1;
            // procura o final do script
            var fim = texto.indexOf('</script>', ini);
            // extrai apenas o script
            codigo = texto.substring(ini,fim);
            // executa o script
            eval(codigo);
        }
    }
}

function __getmyValue(vl){
V = document.getElementById(vl).value;
return V;
}

function __getmyCheckedValue(vl){
if(document.getElementById(vl).checked==true){
  V = document.getElementById(vl).value;
}
return V;
}

function __getmyValueEnter(){
 var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) : event.keyCode;
 if (keyCode == 13) {
//   alert('teste');
   return true;
 }
 else
 return false;
}


try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

function goandget(page,showme){
d = document.getElementById(''+showme);
d.innerHTML='<img src="images/loading.gif" border="0" align="absmiddle">&nbsp;Aguarde...</b>'
xmlhttp.open('GET','./'+page,true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4 && page != ""){
        texto=xmlhttp.responseText;
        d.innerHTML=texto;
        extraiScript(texto);
    }
}
xmlhttp.send(null)
}

try{
    xmlhttp2 = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp2 = false;
        }
    }
}

function goandget2(page,showme){
d2 = document.getElementById(''+showme);
d2.innerHTML='&nbsp;Aguarde...</b>'
xmlhttp2.open('GET','./'+page,true);
xmlhttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
xmlhttp2.onreadystatechange=function() {
    if (xmlhttp2.readyState==4 && page != ""){
        texto=xmlhttp2.responseText;
        d2.innerHTML=texto;
        extraiScript(texto);
    }
}
xmlhttp2.send(null)
}

try{
    xmlhttp3 = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp3 = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp3 = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp3 = false;
        }
    }
}

function goandget3(page,showme){
d3 = document.getElementById(''+showme);
d3.innerHTML='&nbsp;Aguarde...</b>'
xmlhttp3.open('GET','./'+page,true);
xmlhttp3.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
xmlhttp3.onreadystatechange=function() {
    if (xmlhttp3.readyState==4 && page != ""){
        texto=xmlhttp3.responseText;
        d3.innerHTML=texto;
        extraiScript(texto);
    }
}
xmlhttp3.send(null)
}

try{
    xmlhttp4 = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp4 = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp4 = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp4 = false;
        }
    }
}

function goandget4(page,showme){
d4 = document.getElementById(''+showme);
d4.innerHTML=''
xmlhttp4.open('GET','./'+page,true);
xmlhttp4.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
xmlhttp4.onreadystatechange=function() {
    if (xmlhttp4.readyState==4 && page != ""){
        texto=xmlhttp4.responseText;
        d4.innerHTML=texto;
        extraiScript(texto);
    }
}
xmlhttp4.send(null)
}

try{
    xmlhttp5 = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp5 = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp5 = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp5 = false;
        }
    }
}

function goandget5(page,showme){
d5 = document.getElementById(''+showme);
d5.innerHTML=''
xmlhttp5.open('GET','./'+page,true);
xmlhttp5.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
xmlhttp5.onreadystatechange=function() {
    if (xmlhttp5.readyState==4 && page != ""){
        texto=xmlhttp5.responseText;
        d5.innerHTML=texto;
        extraiScript(texto);
    }
}
xmlhttp5.send(null)
}

try{
    xmlhttp6 = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp6 = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp6 = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp6 = false;
        }
    }
}

function goandget6(page,showme){
d6 = document.getElementById(''+showme);
d6.innerHTML=''
xmlhttp6.open('GET','./'+page,true);
xmlhttp6.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
xmlhttp6.onreadystatechange=function() {
    if (xmlhttp6.readyState==4 && page != ""){
        texto=xmlhttp6.responseText;
        d6.innerHTML=texto;
        extraiScript(texto);
    }
}
xmlhttp6.send(null)
}


function ConfirmActionLink(page,message) {
var answer = confirm(message)
if (answer){
window.location = page;
}
else{
return
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w;
    top.outerHeight=h;
   }
   else top.resizeTo(w,h);
 }
}

	function addTag(tag){
		if(document.selection){
			var sel = document.selection.createRange().text;
			if(sel!=''){
				document.selection.createRange().text = "[" + tag + "]"+sel+"[/"+tag+"]";
			}
		}
	}

function addsmiley(symbol,field) {
var enterThere;
if (document.getElementById(''+field+'') && document.getElementById(''+field+'').type == 'textarea') {
enterThere = document.getElementById(''+field+'');
}
else {
return false;
}
if (document.selection) {
enterThere.focus();
sel = document.selection.createRange();
sel.text = symbol;
enterThere.focus();
}
else if (enterThere.selectionStart || enterThere.selectionStart == '0') {
var startPos = enterThere.selectionStart;
var endPos = enterThere.selectionEnd;
var cursorPos = endPos;
enterThere.value = enterThere.value.substring(0, startPos)
+ symbol
+ enterThere.value.substring(endPos, enterThere.value.length);
cursorPos += symbol.length;
enterThere.focus();
enterThere.selectionStart = cursorPos;
enterThere.selectionEnd = cursorPos;
}
else {
enterThere.value += symbol;
enterThere.focus();
}
}

function MyDisplay(the_sub){
var subs_array = new Array("divp1","divp2","divp3");
if(document.getElementById(the_sub).style.display==""){document.getElementById(the_sub).style.display = "none";return}
document.getElementById(the_sub).style.display = "";
}
function MyDisplayClose(the_sub){
document.getElementById(the_sub).style.display = "none";return
}

// LINK EM NEGRITO
var selectedLink;
function selectLink(lnk) {
  if (selectedLink) selectedLink.style.fontWeight='normal';
  lnk.style.fontWeight='bold';
  selectedLink=lnk;
}

function VerifyKey() 
 { 
  var tecla=window.event.keyCode; 
  if (tecla==116) {alert('error'); event.keyCode=0; 
event.returnValue=false;} 
 }

function openMyWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function autoResize(id){
    var newheight;
    var newwidth;
    if(document.getElementById){
        newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
        newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth;
    }
    document.getElementById(id).height=(newheight) + "px";
    document.getElementById(id).width=(newwidth) + "px";
}

function numero(evtKeyPress)
{
    var nTecla = 0;
    if (document.all) {
        nTecla = evtKeyPress.keyCode;
    } else {
        nTecla = evtKeyPress.which;
    }
    if ((nTecla> 47 && nTecla <58)
    || nTecla == 8 || nTecla == 127
    || nTecla == 0 || nTecla == 9  // 0 == Tab
    || nTecla == 13) { // 13 == Enter
        return true;
    } else {
        return false;
    }
}

