function setFocus(id)
{
    element = document.getElementById(id);
           if(element.focus)
            element.focus();
}

function addUrlReferencia()
{
    form = document.getElementById('form_ingreso_popup');
    refer = document.createElement('input');
    refer.setAttribute('name', 'url_referencia');
    refer.setAttribute('type', 'hidden');
    refer.value = document.location.href;
   // alert(refer.value);
    form.appendChild(refer);
}


function desplegarVentanaLogin(div)
{
    if(div == '')
    {
        div = 'popup_login';
    }
    divi = document.getElementById(div);

 // window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );

  if(divi)divi.style.height = '2000px';
    Element.show(div);
    $('pagina').startWaiting('bigBlackWaiting');
}
function descargarContenidoCelular(url, div)
{

}

function cambiarTiposValidacion(categoriaSelect)
{
    categoriaId = parseInt(categoriaSelect.value);
    //alert(categoriaId);
    exts = "";
    if( categoriaId == 4 || categoriaId == 347 )
    {
        exts = "jpg, gif, png";
    }
    if(categoriaId == 8)
    {
        exts = ",jpeg";
    }
    if(categoriaId == 2)
    {
        exts = ",jar";
    }
    if(categoriaId == 7)
    {
        exts = ",mp3";
    }

    iframe = document.getElementById('contenido_principal');
    if(iframe)
    {
         formUpload = iframe.contentWindow.document.getElementById('upload_contenido');
         tipos = formUpload['tipos'];
         tipos.value = exts;
    }else
    {
 
        if(window.frames['contenido_principal'].document)
        {
            formUpload = window.frames['contenido_principal'].document.getElementById('upload_contenido');
            tipos = formUpload['tipos'];
            tipos.value = exts;
        }/*else
        {
            tipos =  document.getElementById('Pagina2').document.getElementById('tipos');
            tipos.value = exts;
        }*/
    }
}

function cancelarUpload()
{
    try
    {
      window.frames['Pagina2'].window.stop();
    }catch(e)
    {
        if (navigator.appName.indexOf("Explorer") != -1)
        {
            execCommand("Stop");
        }
    }

    var RegExPattern = /misContenidos/;
    var url = window.location.href;
    if ((url.match(RegExPattern)))
    {
        //alert('jejej');
        window.location.reload();
    }
    
}
