﻿/*
CSS Browser Selector v0.3.1
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3')?g+' ff3':is('gecko/')?g:/opera(\s|\/)(\d+)/.test(ua)?'opera opera'+RegExp.$2:is('konqueror')?'konqueror':is('chrome')?w+' '+s+' chrome':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);

function showmenu(elmnt)
        {
            document.getElementById(elmnt).style.display = "block";
            document.getElementById('lnk_'+elmnt).className = "menu_on"; 		
        }
        
function hidemenu(elmnt)
        {
	        document.getElementById(elmnt).style.display = "none";
	        document.getElementById('lnk_'+elmnt).className = "menu_off";     	
        }  
function Login(){
	document.aspnetForm.action="http://dual-pem.dualtec.com.br/admin/index.php?Page=Login&Action=Login";
	document.aspnetForm.submit();
}

function getRequestXml()
{
    if (window.XMLHttpRequest){
        http_request = new XMLHttpRequest();
        
        if (http_request.overrideMimeType) 
            http_request.overrideMimeType('text/xml');
        
    }else if (window.ActiveXObject){
        try{
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e){
            // Faz nada
        }
        
        if(!http_request){
            try{
                http_request= new ActiveXObject("Microsoft.XMLHTTP");
            }catch (e){// Faz nada 
            }
        }
    }
   
    if (!http_request)
        alert('Sem suporte há esta funcionalidade');
    else
        return http_request;
      
}

// Conteudo //
function ajax_conteudo(xmlHttp,url,div_resultado)
{       
    xmlHttp.onreadystatechange = function() {ajax_conteudo_ready(xmlHttp,div_resultado);}
    xmlHttp.open("GET", url, true);
    xmlHttp.send(null);
}

function ajax_conteudo_ready(xmlHttp,div_resultado){
    if (xmlHttp.readyState == 4){ 
        if (xmlHttp.status == 200){
            retorno = xmlHttp.responseText;
            
            if(retorno != ""){
                div_resultado.innerHTML = "";
                div_resultado.innerHTML = retorno;
            }else{ 
                div_resultado.style.display = "none";
                div_resultado.innerHTML = "";
            }
        }
    }
}

function Evento(e){
	if(e.keyCode==13)
		Login();
}