var http = crearAjax();

function crearAjax(){
    var xmlhttp=false;
     try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
        try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }catch (E){
               xmlhttp = false;
          }
     }

    if (!xmlhttp && typeof XMLHttpRequest!='undefined'){
          xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}

PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function AbreImagen(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Cargando ...</title><style>body{margin:0px;}</style>');
writeln('<sc'+'ript>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=10-(document.documentElement.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images["imagenes"].width;');
writeln('window.innerHeight=document.images["imagenes"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');
writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="imagenes" src='+imageURL+' style="display:block"></body></html>');
close();
}}

/* ******************************************************************************************************** */
/* ****************************************** ADMIN ******************************************************* */
/* ******************************************************************************************************** */
function enviarnoticia(){  
    bool = false; 
    if(document.getElementById('not_titular').value == "") {
        bool = false;
        alert("Titular obligatorio");
        document.getElementById('not_titular').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('not_fecha').value == "") {
            bool = false;
            alert("Fecha obligatoria");
            document.getElementById('not_fecha').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('not_cuerpo').value == "") {
            bool = false;
            alert("Cuerpo obligatorio");
            document.getElementById('not_cuerpo').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatos').submit();
    } 
}
function enviarcliente(){
    bool = false; 
    if(document.getElementById('cli_nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('cli_nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('cli_descripcion').value == "") {
            bool = false;
            alert("Texto obligatorio");
            document.getElementById('cli_descripcion').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('cli_enlace').value == "") {
            bool = false;
            alert("Enlace obligatorio");
            document.getElementById('cli_enlace').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatos').submit();
    } 
}
/* ******************************************************************************************************** */
/* ****************************************** FIN ADMIN *************************************************** */
/* ******************************************************************************************************** */
function orden(){   
    document.getElementById('frmdatos').submit();    
}
function mostrar(){
    document.getElementById('leyenda').style.display="block";
    window.location.href="#iconos";
}
function mostrar2(){ 
    document.getElementById('aplicontenido').style.display="block";
    document.getElementById('aplimas').style.display="none";
}
function ocultar(){ 
    document.getElementById('aplicontenido').style.display="none";
    document.getElementById('aplimas').style.display="block";
}
function comprobar(){
    bool = false; 
    if(document.getElementById('Nombre').value == "") {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('Nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('Email').value == "") {
            bool = false;
            alert("Email obligatorio");
            document.getElementById('Email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Asunto').value == "") {
            bool = false;
            alert("Asunto obligatorio");
            document.getElementById('Asunto').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Comentarios').value == "") {
            bool = false;
            alert("Comentario obligatorio");
            document.getElementById('Comentarios').focus();
        }
        else{
            bool = true;
        }
    }         
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}