function popu(page) {



x=screen.width



y=screen.height



window.open(page,'','width='+x+',height='+y+',top=0,left=0,status=yes,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,menubar=yes');



}



function Linkbrowse (URL,ancho,largo,scro){



scrollmax="No"



if (scro==1){



	scrollmax="Yes";



}



x = (screen.width - ancho) / 2;



y = (screen.height - largo) / 2;



window.open(URL,'',"top="+x+",left="+y+",width="+ancho+",height="+largo+",scrollbars="+scrollmax+",left="+x+",top="+y)



}



 function putFocus(formInst, elementInst) {



  if (document.forms.length > 0) {



   document.forms[formInst].elements[elementInst].focus();



  }



 }



 function Direction(dia,mes,ano,tipo){



window.open('link_nl.php'+'?ano='+ano+'&mes='+mes+'&dia='+dia,'','location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=800,height=600,left=0,top=0')



}



function Bol(dia,mes,ano,tipo){



x=screen.width;



y=screen.height;



window.open('../boletin/boletin.php'+'?fecha='+ano+'-'+mes+'-'+dia,'',"width="+x+",height="+y+",status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes,scrollbars=yes,left=0,top=0") 



}



function Sum(dia,mes,ano,tipo){



x=screen.width;



y=screen.height;



   window.open('b_normativo.php'+'?fecha='+ano+'-'+mes+'-'+dia,'',"width="+x+",height="+y+",status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes,scrollbars=yes,left=0,top=0") 



}



function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {



var i, j;



var prompt;



// empty existing items



for (i = selectCtrl.options.length; i >= 0; i--) {



selectCtrl.options[i] = null; 



}



prompt = (itemArray != null) ? goodPrompt : badPrompt;



if (prompt == null) {



j = 0;



}



else {



selectCtrl.options[0] = new Option(prompt);



j = 1;



}



if (itemArray != null) {



// add new items



for (i = 0; i < itemArray.length; i++) {



selectCtrl.options[j] = new Option(itemArray[i][0]);



if (itemArray[i][1] != null) {



selectCtrl.options[j].value = itemArray[i][1]; 



}



j++;



}



// select first item (prompt) for sub list



selectCtrl.options[0].selected = true;



   }



}

function NextTxt(iobjOrigen, iobjDestino, iintNumCaracteresMax)

{

	var lstrValor = iobjOrigen.value;

	var lintKeyCode = window.event.keyCode;

	

	if (lintKeyCode != 9 && lintKeyCode != 16)

	{

		if (lstrValor.length == iintNumCaracteresMax)

		{

			iobjDestino.focus();

			iobjDestino.select();

		}

	}

	return;

}

function optransf(ivalue,iChange,iButton){

	if (form3.chkcc.checked == true){

		document.getElementById(iChange).disabled=true

		document.getElementById(iButton).value="Trasladar Consulta"}

	else {

		document.getElementById(iChange).disabled=false

		document.getElementById(iButton).value="Reenviar Consulta"}

	}

function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;
}

function LTrim(s){
	// Devuelve una cadena sin los espacios del principio
	var i=0;
	var j=0;
	// Busca el primer caracter <> de un espacio
	for(i=0; i<=s.length-1; i++)
		if(s.substring(i,i+1) != ' '){
			j=i;
			break;
		}
	return s.substring(j, s.length);
}
function RTrim(s){
	var j=0;
	// Busca el último caracter <> de un espacio
	for(var i=s.length-1; i>-1; i--)
		if(s.substring(i,i+1) != ' '){
			j=i;
			break;
		}
	return s.substring(0, j+1);
}
function Trim(s){
	// Quita los espacios del principio y del final
	return LTrim(RTrim(s));
}

function Len(s){
	// Devuelve la longitud de la cadena s
	return s.length;
}
function ismail(s){
	var t=0
if( s.indexOf('@',0) <= 0  || s.indexOf('.',0) <= 0
     || s.indexOf(' ',0) != -1 || s.indexOf('/',0) != -1
     || s.indexOf(';',0) != -1 || s.indexOf('<',0) != -1
     || s.indexOf('>',0) != -1 || s.indexOf('*',0) != -1
     || s.indexOf('|',0) != -1 || s.indexOf('`',0) != -1
     || s.indexOf('&',0) != -1 || s.indexOf('$',0) != -1
    || s.indexOf('!',0) != -1 || s.indexOf('"',0) != -1
    || s.indexOf(':',0) != -1 || s.indexOf(',',0) != -1 ){
	t = 1;	
	}
	return t;
}
//  End -->
function linkfavorite(URL,TITULO){
	window.external.AddFavorite(URL,TITULO);
}
function windowsmall (URL){
	var ancho,alto
	ancho = screen.width
	alto = screen.width
	x = (screen.width - ancho) / 2;
	y = (screen.height - alto) / 2;
  window.open(URL,'',"width="+ancho+",height="+alto+",status=yes,menubar=yes,toolbar=yes,titlebar=yes,location=yes,resizable=yes,scrollbars=yes,left=0,top=0") 
}
function iLink(aHref)
{	
	parent.location=aHref;
}