
///pintar un flash y evitar EOLAS

function put_flash(movie,width,height){
//var param=(arguments[3]) ? '<param name="'+arguments[3]+'" value="'+arguments[4]+'"/>' : ''; 
//var embed=(arguments[3]) ? arguments[3]+'="'+ arguments[4]+'"' : ''; 
var param=(arguments[3]) ? arguments[3] : ''; 
var embed=(arguments[4]) ? arguments[4] : ''; 


contenido='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'">'+
'<param name="allowScriptAccess" value="sameDomain"/>'+
'<param name="movie" value="'+movie+'"/>'+
'<param name="wmode" value="transparent"/>'+
'<param name="quality" value="best"/>'+
'<param name="scale" value="exactfit"/>'+ param +
'<embed scale="exactfit" wmode="transparent" src="'+movie+'" width="'+width+'" height="'+height+'"  quality="best" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '+ embed +
'/></object>';

if(arguments[5]) arguments[5].innerHTML=contenido; else document.write(contenido);
//return contenido;
}


///pintar un applet y evitar EOLAS



function put_applet(jar,code,width,height){
if(arguments[4]) param=arguments[4];else param='';
contenido='<applet archive="'+jar+'" code="'+code+'" width='+width+' height='+height+'>'+arguments[4]+'</applet>';
if(arguments[5]) arguments[5].innerHTML=contenido; else document.write(contenido);
}

/*******************************
utils
*******************************/

//escribir direcciones de correo evitando a los robots spam

function mail(user,domain){
if(arguments[2]) arguments[2].innerHTML=user+unescape('%40')+domain;
else document.write(user+unescape('%40')+domain);
}

/// borrar registros

function borrar(seccion,id){
if (arguments[2]) arg=arguments[2];else arg='';
if(confirm('¿Seguro que quieres eliminar este elemento?'))
getURL(seccion+'&ver=borrar&id='+id +arg);
}


/**********************************
  album de fotos
**********************************/

function rows_number(){
width=document.body.clientWidth;
if(width>1050) width=1050;
if(width<750) width=750;
if(width<925){
document.getElementById('lista').className='three_rows';
}else{
document.getElementById('lista').className='four_rows';
}
}

function browse(path){
path=encodeURIComponent(path);
getURL('album&path='+path);
}


/**********************************
  capas y formularios
**********************************/

function formulario(form,action,div){
var send;
send=form.elements[0].id+"="+encodeURIComponent(form.elements[0].value.replace(/€/g,"&euro;"));
for(var i=1;i<form.elements.length;i++){
if (form.elements[i].type=='checkbox') {if (form.elements[i].checked==1) send+="&"+form.elements[i].id+"="+encodeURIComponent(form.elements[i].value);}
else send+="&"+form.elements[i].id+"="+encodeURIComponent(form.elements[i].value.replace(/€/g,"&euro;"));
}
if(arguments[3]) for(i=0;i<form.elements.length;i++) form.elements[i].disabled=true;
post(action,div,send);
}

function resetForm(formId){
var form=document.getElementById(formId);
for(i=0;i<form.elements.length;i++) form.elements[i].disabled=false;
if(arguments[1]) document.getElementById(arguments[1]).value='';
}


function muestra(div){
document.getElementById(div).style.height='';
}

function oculta(div){
document.getElementById(div).style.height='0px';

}

function vacia(div){
var layer=document.getElementById(div);
var output=layer.innerHTML;
layer.innerHTML='';
layer.style.height='0px';
return output;
}

function rellena(div,content){
var layer=document.getElementById(div);
layer.innerHTML=content;
layer.style.height='';
}

function copia(div){
return document.getElementById(div).innerHTML;
}

var currentSection="portada";

function getURL(seccion){
get("xmlhttp.php?ir="+seccion,document.getElementById("central"));
frames[0].location="js/historial.htm?"+seccion;
currentSection=seccion;
scroll(0,0);
}