//Por si la abren en un frame
if (top.location != self.location)top.location = self.location;

function cargaFondo(capa,fondo,propiedades){
//cuerpoPagina
	cp = MM_findObj(capa)
	cp.style.background = "url(" + fondo +") " + propiedades
}

function aleatorio(inferior,superior){ 
    numPosibilidades = superior - inferior 
    aleat = Math.random() * numPosibilidades 
    aleat = Math.floor(aleat) 
    return parseInt(inferior) + aleat 
} 

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function imprimePagina(){	
	browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) < 4 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) < 4 )))
	
	if (browser) alert('La opción de imprimir sólo esta disponible a partir de la versión 4 de los Navegadores.')
	else window.print()
}

function enviaPagina(){
	Url = window.document.location;
	tituloPagina = window.document.title;

	Url = Url.toString()	
	if( (posAlmohada = Url.indexOf("#")) > 0) Url = Url.substring(0,posAlmohada)
	
	if(document.all) {
	  window.document.location="mailto:?subject=" + tituloPagina +"&body=Un%20amigo%20te%20envía%20esta%20página%20del%20Sitio%20Web%20de%20la%20Empresa%20Pública%20de%20Gestión%20de%20Programas%20Culturales: "+escape(Url)
	}
	else if(document.layers) {
	  window.document.location="mailto:?subject=" + tituloPagina +"&body=Un%20amigo%20te%20envía%20esta%20página%20del%20Sitio%20Web%20de%20la%20Empresa%20Pública%20de%20Gestión%20de%20Programas%20Culturales: "+ Url
	}
	else{
		alert('Tu navegador no soporta esta opción')
	}
	return void(0); 
}

function Toggle (obj)
{
  if (obj.style.display == "") obj.style.display = "none";
		          else obj.style.display= "";
  return false;
}


function campoEnfoque(campo,valor){
	if(campo.value == valor) campo.value = ""
}

function campoBlur(campo,valor){
	if(campo.value == "" ) campo.value = valor
}