// JavaScript Document
		/* 	
function ValidarVariable(Variable, Tipo) { 
				1 -> URL
				2 -> E-mail
				3 -> Fecha
    var RegExPattern = /^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)( [a-zA-Z0-9\-\.\?\,\’\/\\\+&amp;%\$#_]*)?$/;

    var errorMessage = 'Password Incorrecta.'; 
    if (Variable.match(RegExPattern[Tipo])) { 
        alert('Password Correcta'); 
    } else { 
        alert('Password Correcta'); 
    } 
} 
		*/
function animacion(direccion,ancho,alto,alt)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ancho+'" height="'+alto+'" title="'+alt+'">');
document.write('<param name="movie" value="'+direccion+'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><embed src="'+direccion+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></embed></object>');
}		

function VideoPlay(video)
	{
	document.write(video);
	}		

		
function sobre(src,color,color2) {
	src.style.cursor = "pointer";
	src.style.backgroundColor = color2;	
	src.onmouseout=function() {
		src.style.backgroundColor = color;
		}
}
function sobre2(src,color,color2) {
	src.style.backgroundColor = color2;	
	src.onmouseout=function() {
		src.style.backgroundColor = color;
		}
}

		

function Direccion () {
  URL_Entrada  = document.location.href;
  URL_hash     = document.location.hash;
  URL_host     = document.location.host;
  URL_port     = document.location.port;
  URL_hostname = document.location.hostname;
  URL_pathname = document.location.pathname;
  URL_protocol = document.location.protocol;
  URL_search   = document.location.search;
  
   //alert("Location pathname: '" + URL_search + "'"); 
  return URL_protocol + "//" + URL_hostname + URL_pathname;
  //document.write(actual);

}

function Directorio () {
  URL_Entrada  = document.location.href;
  URL_hash     = document.location.hash;
  URL_host     = document.location.host;
  URL_port     = document.location.port;
  URL_hostname = document.location.hostname;
  URL_pathname = document.location.pathname;
  URL_protocol = document.location.protocol;
  URL_search   = document.location.search;
	URL_path = URL_pathname.substring(0,URL_pathname.lastIndexOf("/"))
	URL_name = URL_pathname.substring(URL_pathname.lastIndexOf("/")+1,URL_pathname.length)


//   alert("Location href: '" + location.href + "'"); 
//   alert("Location host: '" + location.host + "'"); 
//   alert("Location hostname: '" + location.hostname + "'"); 
//   alert("Location pathname: '" + location.pathname + "'"); 
//   alert("Location port: '" + location.port + "'"); 
//   alert("Location protocol: '" + location.protocol + "'"); 
//   alert("Location path: '" + URL_path + "'"); 
//   alert("Location name: '" + URL_name + "'"); 




  return URL_protocol + "//" + URL_hostname + URL_path;
  //document.write(actual);

}





function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var win= null;
function NewWindow(mypage,myname,w,h,scrollbars,resizable,menubar,status,location,toolbar){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scrollbars+',';
      settings +='resizable='+resizable+',';
	  settings +='menubar='+menubar+',';
	  settings +='status='+status+',';
	  settings +='location='+location+',';
	  settings +='toolbar='+toolbar+',';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function P7AniMagic(el, x, y, a, b, c, s) { //v2.5 PVII
 var g,elo=el,f="",m=false,d="";x=parseInt(x);y=parseInt(y);
 var t = 'g.p7Magic = setTimeout("P7AniMagic(\''+elo+'\','; 
 if ((g=MM_findObj(el))!=null) {d=(document.layers)?g:g.style;}else{return;}
 if (parseInt(s)>0) {eval(t+x+','+y+','+a+','+b+','+c+',0)",' + s+')');return;}
 var xx=(parseInt(d.left))?parseInt(d.left):0;
 var yy=(parseInt(d.top))?parseInt(d.top):0;
 if(parseInt(c)==1) {x+=xx;y+=yy;m=true;c=0;}
 else if (c==2) {m=false;clearTimeout(g.p7Magic);}
 else {var i=parseInt(a);
  if (eval(g.moved)){clearTimeout(g.p7Magic);}
  if (xx<x){xx+=i;m=true;if(xx>x){xx=x;}}
  if (xx>x){xx-=i;m=true;if(xx<x){xx=x;}}
  if (yy<y){yy+=i;m=true;if(yy>y){yy=y;}}
  if (yy>y){yy-=i;m=true;if(yy<y){yy=y;}}}
 if (m) {if((navigator.appName=="Netscape") && parseInt(navigator.appVersion)>4){
    xx+="px";yy+="px";}
  d.left=xx;d.top=yy;g.moved=true;
	eval(t+x+','+y+','+a+','+b+','+c+',0)",'+b+')');
  }else {g.moved=false;}
}

function P7_MultiMove() { //v1.2 PVII
  var a,b,x,xx,y,yy,args=P7_MultiMove.arguments;

	for (i=0; i<(args.length-3); i+=4) if ((a=MM_findObj(args[i]))!=null) {
	  b=(document.layers)?a:a.style;x=args[i+1];y=args[i+2];
	  if (args[i+3]==1) {
		 xx=(parseInt(b.left))?parseInt(b.left):0;
     yy=(parseInt(b.top))?parseInt(b.top):0;
	   x+=xx;y+=yy;
	  }
	  b.left = parseInt(x);b.top = parseInt(y);
	}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

now = new Date
	function dias_a_dias(inTime) {
		return (Math.floor(inTime.getTime() / (1000 * 60 * 60 * 24)))
	}

	function dias_hasta(inDate) {
//		if (inDate.getTime() < now.getTime()) {
//		inDate.setYear(inDate.getFullYear()+1)
//		}
	
		return  dias_a_dias(now) - dias_a_dias(inDate)
	}

	function fecha(dia, mes, anio) {
		return new Date (anio,mes-1,dia)
	}

	//Nuevo (Fecha actualizacion, dias tope)  --> muestra el icono de nuevo hasta que no se pase los dias topes.
	function Nuevo(inDate, dias) {
		var transcurridos = dias_hasta(inDate);
		if (transcurridos < dias) {
			document.write("<img src=\"http://www.mpdlc.org./MPDLC/Imagenes/nuevo.gif\" border=\"0\">");
		}
	}
	
	
	function NuevoAuxiliar(inDate, dias) {
		var transcurridos = dias_hasta(inDate);
		if (transcurridos < dias) {
			document.write("<img src=\"http://www.mpdlc.org./MPDLC/Imagenes/nuevopeq2.gif\" border=\"0\">");
		}
	}

	function Finalizado(dia, mes, anio) {
		var FechaFinal = fecha(dia, mes, anio);
		var Hoy = new Date();
		if (FechaFinal < Hoy) {
			document.write("<img src=\"http://www.mpdlc.org./MPDLC/Imagenes/finalizado.gif\" border=\"0\">");
		}
	}
	function FinalizadoMini(dia, mes, anio) {
		var FechaFinal = fecha(dia, mes, anio);
		var Hoy = new Date();
		if (FechaFinal < Hoy) {
			document.write("<img src=\"http://www.mpdlc.org./MPDLC/Imagenes/finalizado.gif\" width=\"50\" border=\"0\">");
		}
	}
	
	/*********************************************************************************
	Caduca (Fecha actualizacion, dias tope, TextoHtml)  --> 
	muestra el "TextoHtml" si no ha pasado los "dias topes" desde la "Fecha Actualizaicon"
	**********************************************************************************/
	function Caduca(inDate, dias, TextoHtml) {
		var transcurridos = dias_hasta(inDate);
		if (transcurridos < dias) {
			document.write(TextoHtml);
		}
	}

	function NoticiaCaduca(inDate, dias, Titulo, TextoHtml) {
		var transcurridos = dias_hasta(inDate);
		if (transcurridos < dias) {
			document.write(TextoHtml);
		}
	}
	


	// VerFecha (variable tipo date); ---> devuelve la fecha "27 de Septiembre de 2007"
	function VerFecha (fecha) {
		var dia_semana = fecha.getDay(); 
		var dia_mes = fecha.getDate(); 
		var mes = fecha.getMonth (); 
		var anio = fecha.getYear(); 
		if ( anio < 1900 ) {
		anio = 1900 + fecha.getYear();
		}
		mes += 1;
		if (mes < 10) {
		mes = '0' + mes;
		}
		if (dia_mes < 10) {
		dia_mes = '0' + dia_mes;
		}
		if (dia_semana == 0) { dia_semana = 'Domingo, '; }
		if (dia_semana == 1) { dia_semana = 'Lunes, '; }
		if (dia_semana == 2) { dia_semana = 'Martes, '; }
		if (dia_semana == 3) { dia_semana = 'Miércoles, '; }
		if (dia_semana == 4) { dia_semana = 'Jueves, '; }
		if (dia_semana == 5) { dia_semana = 'Viernes, '; }
		if (dia_semana == 6) { dia_semana = 'Sábado, '; }
		var nb_mes = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
		alert( ( dia_mes + ' de ' + nb_mes[mes-1] + ' de ' + anio)); 
	}

