/ JavaScript Document
/*****************************
author: Rolando Espinosa
creation date: 06/08/2002
Variables Globales
****************************/
var aMeses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio","Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
var aDias = new Array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes","S&aacute;bado");
function Bottom_Np(sFecha,sID){
	var MyDate = new Date(replaceCharacters(sFecha,"-","/"));
	document.writeln("<p align='center' class='pu-fin'>DIRECCI&Oacute;N GENERAL DE INFORMACI&Oacute;N Y COMUNICACI&Oacute;N<br>");
	sFecha = "Managua, " + MyDate.getDate() + " de "  + aMeses[MyDate.getMonth()];
	sFecha += MyDate.getFullYear() > 1999? " del " : " de ";
	sFecha += MyDate.getFullYear() + "</p>";
	document.writeln(sFecha);
	sFecha = "<p><font color='#996600' size='2' face='Times New Roman, Times, serif'><em>Referencia: NP-";
	sFecha += sID + "-" + MyDate.getFullYear() + "</em></font></p>\n<p></p>";
	document.write(sFecha);
}
function BusNp_Top(iRegFound, iAno, iMes, sTexto){
	document.write("<p><font size='2' face='Arial, Helvetica, sans-serif'><strong>Se han econtrado ");
	document.write(iRegFound + " registro(s),");
	if(sTexto)
		document.write(" conteniendo el texto: <em>" + sTexto + "</em></strong> </font></p>");
	else
		document.write(" en <em>" + aMeses[iMes - 1] + (iAno > 1999? " del " : " de ") + iAno + "</em></font></p>");
}
/***********************************
Esta función Crea los Combos para con los años y los meses para realizar
la búqueda en la notas e prensa
***********************************/
function CreateSelect(){
	var MyDate = new Date();
	document.write("<font color='#FFFFFF' size='2' face='Arial, Helvetica, sans-serif'><strong>Año: </strong></font>");
	document.write ("<select name='cboAnos'>");
	for( i = MyDate.getFullYear(); i >= 1999; i--){
		document.write("<option value='" + i + "'>" + i + "</option>");
	}
	document.write ("</select>");
	document.write("<font color='#FFFFFF' size='2' face='Arial, Helvetica, sans-serif'><strong> Mes: </strong></font>");
	document.write ("<select name='cboMeses'>");
	for(i=0;i<aMeses.length;i++){
		sTemp = "<option value='" + (i + 1);
		sTemp += i == MyDate.getMonth()? "' selected>" : "'>";
		document.write( sTemp + aMeses[i] + "</option>");
	}
	document.write ("</select>");
	/*cboAnos.selectedIndex = 1;
	cboMeses.selectedIndex = MyDate.getMonth();*/
}
/*Función Tomada de DreamWeaver*/
function replaceCharacters(conversionString,inChar,outChar)
{
  var convertedString = conversionString.split(inChar);
  convertedString = convertedString.join(outChar);
  return convertedString;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/******************/
/********************/
/***MIS FUNCIONES***/
/*******************/
function txt_pad(text,char,n,dir){
	var a_tmp = new Array(n);
	var j = a_tmp.length;
	a_tmp[j++] = text;
	for(i=0;j<n;i++){
		a_tmp[j++] = char;
	}
	if(dir=="lpad"){
		a_tmp.reverse();
	}
	j = new String(a_tmp.join(""))
	return j.substr(0,n);
}
