/**
 * @author yusliel
 */
function cambiarIdioma()
{
	var sel = gBId('idiomasSel');
	var s = sel.options[sel.selectedIndex].value;
	var url = document.location.search;	
	var urlF = '';
	if(url == '')
		urlF = '?leng='+s;
	else
	{
		var l = url.indexOf('leng')	
		if(l != -1)
		{			
			var v = get('leng');
			urlF = url.replace("leng="+v, "leng="+s);
		}
		else
		{
			urlF = url + "&leng="+s;
		}
	}
	document.location.href = urlF;
}

function get( name ){
	var cad = "[\\?&]"+name+"=([^&#]*)";
	var exp = new RegExp ( cad );
	var url = window.location.href;
	var results = exp.exec( url );
	if( results == null )
		return"";
	else
		return results[1];
}

function mostrarImagenes(idF, n, id)
{
	var frm = gBId(idF);
	var cN = gBId('frmCategoria');
	var cId = gBId('frmIdCategoria');
	var o = gBId('option');
	cN.value = n;
	cId.value = id;
	o.value = 'verImg';
	frm.submit();
}

var win;

function imprimirContenido(id, tipo)
{
   	var args;

   args = 'status=0,menubar=0,scrollbars=1,resizable=1,toolbar=0';
   args +=  ',width=' + (screen.availWidth - 10).toString();
   args += ',height=' + (screen.availHeight - 122).toString();
  
   //args += ',screenX=0,screenY=0,left=0,top=0';

   win = window.open( '', '', args );
   win.location = "print.php?idCont="+id+"&tipo="+tipo+"&disp=none";
   win.focus();
   win.moveTo( 0, 0 );
   win.resizeTo( screen.availWidth, screen.availHeight );
   return win;
 }
 
 function cerrarPrint()
 {
 	win.close();
 }
 
 function mostrarMedia(url)
 {
 	var win;
   	var args;
	w = 300;
	h = 300;
    var l = (screen.availWidth / 2)-(w / 2);
	var t = (screen.availHeight / 2)-(h / 2);
   args = 'status=0,menubar=0,scrollbars=1,resizable=0,toolbar=0';
   args +=  ',width='+w;
   args += ',height='+h;
   args += ',screenX=0,screenY=0,left='+l+',top='+t+'';
   win = window.open( '', '', args );
   //win.moveTo(, );
   win.focus();      
   var html = "<html><head><title>"+url+"</title></head><body>";
   html += "<div align='center'><embed src='"+url+"' width='90%' height='270'></embed></div>";
   html += "</body></html>";
   win.document.write(html);
   win.document.close();
 }
 
 function vinculo(url)
 {
 	document.location.href = url;
 }
 
 function mostrarVinculoIdent(url)
 {
 	var win;
   	var args;
   args = 'status=0,menubar=0,scrollbars=1,resizable=1,toolbar=0';
   args +=  ',width=' + (screen.availWidth - 10).toString();
   args += ',height=' + (screen.availHeight - 122).toString();
   win = window.open( '', '', args );
   win.location = "urlFrame.php?url="+url;
   win.focus();
   win.moveTo( 0, 0 );
   win.resizeTo( screen.availWidth, screen.availHeight );
   return false;
 }
 
 function mostrarArea(idA, objImg, url)
 {
 	var a = gBId(idA);
	if(a.style.display == 'none')
	{
		a.style.display = 'block';
		objImg.src = url+'/imagenes/dp_block.gif';
	}
	else
	{
		a.style.display = 'none';
		objImg.src = url+'/imagenes/dp_none.gif';
	}
 }
 
 function mostrarTextoIframe(idF)
 {
 	var f = widows.frames[idF];
	f.document.innerHTML = "Cargando ...";
 }

 function mostrar(elemento)
        {
                elem="elemento";
                var forma = document.frmOrganigrama;
                elem = document.getElementById(elemento);
                elem.style.display="block";
                elem.style.value="Suggesto01";
        }
        function ocultar(elemento)
        {
                elem="elemento";
                var forma = document.frmOrganigrama;
                elem = document.getElementById(elemento);
                elem.style.display="none";

        }
 
