// checar si el user esta usando el odioso intenet explorer
var IE=(navigator.userAgent.indexOf("MSIE")>=0)?1:0;
function returnXML(){
    var r=false;
    if(window.XMLHttpRequest){
        r=new XMLHttpRequest();
    }else if(window.ActiveXObject){
        try{
            r=new ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){
            r=new ActiveXObject("Msxml2.XMLHTTP");
        }
    }
    return r;
}
function extractGET(){// v1.0 2006-05-16
    window.GET=new Array();
    if(window.location.search.length){
        var pares=window.location.search.substr(1).split("&");
        for(var i=0;i<pares.length;i++){
            var par=pares[i].split("=");
            window.GET[par[0]]=(isNaN(par[1]))?par[1]:parseFloat(par[1]);
        }
    }
}
var x;
function logOut(){
    if(confirm("¿Está seguro de que desea salir del sistema?")){
        x= returnXML();
        x.onreadystatechange=function(){
            if(x.readyState==4){
                if(x.status==200){
                    window.location.replace("index.php");
                }else{
                    alert(x.status);
                }
            }
        };
        x.open("GET","scripts/logout.php",true);
        x.send("");
    }
}

//domCorners by Alessandro Fulciniti on http://web-graphics.com/mtarchive/001660.php
function DomCheck(){
return(document.createElement && document.getElementById)
}

function DomCorners(id,bk,h,tries){
var el=document.getElementById(id);
if(el==null){
    if(tries==null) tries=200;
    if(tries>0)
        setTimeout("DomCorners('"+id+"','"+bk+"',"+h+","+(--tries)+")",50);
    return;
    }
var c=new Array(4);
for(var i=0;i<4;i++){
    c[i]=document.createElement("b");
    c[i].style.display="block";
    c[i].style.height=h+"px";
    c[i].style.fontSize="1px";
    if(i%2==0)
        c[i].style.background="url("+bk+") no-repeat 0 -"+ i*h + "px";
    else
        c[i].style.background="url("+bk+") no-repeat 100% -"+ i*h + "px";
    }
c[0].appendChild(c[1]);
c[2].appendChild(c[3]);
el.style.padding="0";
el.insertBefore(c[0],el.firstChild);
el.appendChild(c[2]);
}

function cambio(){
	var select=document.getElementById('select_comp');
	if (select.selectedIndex >0){
	window.location='odt.php?companias_id='+document.getElementById('select_comp').value;
	}
	else{
	window.location='odt.php';
	}	
}	
