
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - referencebrowser.js - */
// http://www.auditorionacional.mcu.es/portal_javascripts/referencebrowser.js?original=1
function referencebrowser_openBrowser(path,fieldName,at_url,fieldRealName){atrefpopup=window.open(path+'/referencebrowser_popup?fieldName='+fieldName+'&fieldRealName='+fieldRealName+'&at_url='+at_url,'referencebrowser_popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=550')}
function referencebrowser_setReference(widget_id,uid,label,multi){if(multi==0){element=document.getElementById(widget_id)
label_element=document.getElementById(widget_id+'_label')
element.value=uid
label_element.value=label} else{list=document.getElementById(widget_id)
for(var x=0;x<list.length;x++){if(list[x].value==uid){return false}}
theLength=list.length;list[theLength]=new Option(label);list[theLength].selected='selected';list[theLength].value=uid}}
function referencebrowser_removeReference(widget_id,multi){if(multi){list=document.getElementById(widget_id)
for(var x=list.length-1;x>=0;x--){if(list[x].selected){list[x]=null}}
for(var x=0;x<list.length;x++){list[x].selected='selected'}} else{element=document.getElementById(widget_id);label_element=document.getElementById(widget_id+'_label');label_element.value="";element.value=""}}


/* - uploadreference.js - */
// http://www.auditorionacional.mcu.es/portal_javascripts/uploadreference.js?original=1
function addUploadReferenceInput(field){var place=document.getElementById(field+'_inputs');var br=document.createElement('br');place.appendChild(br);var input=document.createElement('input');input.size='30';input.type='file';input.name=field+'_file:list';place.appendChild(input);return false}
function showUploadReference(field){document.getElementById('box_'+field+'_select').style.display='none';document.getElementById('box_'+field+'_upload').style.display='block'}
function hideUploadReference(field){document.getElementById('box_'+field+'_upload').style.display='none';document.getElementById('box_'+field+'_select').style.display='block'}

