var CurrentDB='/sf/sf_bdfde.nsf/';
function SelectCat(){
var obj = SelectCat.arguments[0];
var idx = obj.selectedIndex;
var val = obj.options[idx].value;
var vista = (obj.name == "lib_cmb") ? "vLibrosxCat" : (obj.name == "rev_cmb" ) ? "vRevistasxCat" : "";
if ( idx != "0" ) {
window.document.location.href = CurrentDB + vista + "?OpenView&RestrictToCategory=" + val;
}
}
function SetValues(){
var vista = SetValues.arguments[0];
selobj = (vista == "vLibrosxCat") ? window.document.cmbox.lib_cmb : (vista == "vRevistasxCat") ? window.document.cmbox.rev_cmb : "";
var setval = false; var i = 0;
var optsel = SetValues.arguments[1];
while ( !setval && selobj.length > i ) {
if ( selobj.options[i].value == optsel ) { setval = true; }
i = i +1; }
if ( setval ) { selobj.selectedIndex = i-1; }
else { selobj.selectedIndex = 0; }
}
function doSpacer(){
var level = eval( doSpacer.arguments[0].split('.').length ) - 1; var w = 0; var spacer = ""; var vista = window.document.forms[0].vista.value;
if ( vista == "vRevistasxCat" || vista=="vLibrosxCat" ) { if ( level >= 2 ) { level = level - 1; } }
w = level * 5;
spacer = '
 | ';
return spacer;
}
function changeLevel(){
var vista = window.document.forms[0].vista.value;
if ( vista == "vRevistasxCat" || vista== "vLibrosxCat" ) {
var opt_array = changeLevel.arguments[0].split('.'); var doclevel = opt_array.length; var newopt = '';
for ( var j=0; j<=doclevel-1; j++ ) {
newopt = newopt + opt_array[j] + '.';
}
newopt = newopt.substring(0, newopt.lastIndexOf('.') ); // elimina ultimo punto
newopt = newopt.substring( newopt.indexOf('.')+1 ); // elimina primer rubro
}
return newopt;
}
function rtrParent(){
var aux = rtrParent.arguments[0].lastIndexOf('.'); var b = rtrParent.arguments[0]; b = b.substring(0,aux); return b;
}
function changeExpColl( opt , currentSel ) {
var fg =false ; // true: expand , false : collapse
var opt1 = opt.split('.'); var cs1 = currentSel.split('.'); var urltxt = window.location.href;
if ( currentSel == "" || currentSel == null ) { if ( urltxt.indexOf( 'ExpandView' ) >=0 ) { return false; } else { return true; } }
else {
if ( opt1.length > cs1.length ) { if ( opt.indexOf( currentSel ) == 0 ) { fg = true; } }
if ( opt1.length == cs1.length ) {
if ( opt == currentSel ) {
if ( urltxt.indexOf( '&Expand=' ) >=0 ) { fg = false; }
else { fg = true; }
}
else { fg = true; }
}
if ( opt1.length < cs1.length ) {
if ( currentSel.indexOf( opt ) == 0 ) { fg = false; }
else { fg = true; }
}
}
return fg;
}
function ExpColl(){
var vista = window.document.forms[0].vista.value;
var opt = changeLevel( ExpColl.arguments[0] );
var currentSel = window.document.forms[0].currentSel.value;
var urlstr = window.document.location.href;
var sw_exp = changeExpColl( opt , currentSel ) ? "&Expand=" : "&Collapse=";
var db = ExpColl.arguments[1] == null || ExpColl.arguments[1] == "" ? CurrentDB : ExpColl.arguments[1];
var pathinfo1 = "";
var rtc = "";
if ( vista == "vRevistasxCat" || vista=="vLibrosxCat") { pathinfo1 = "&RestrictToCategory=" + escape( ExpColl.arguments[1] ); db = CurrentDB; }
var bookmark = sw_exp == "&Collapse=" ? opt.split('.').length > 1 ? "#bm_" + rtrParent( ExpColl.arguments[0] ) : "" : "#bm_" + ExpColl.arguments[0];
window.document.location.href = db + vista + "?OpenView" + pathinfo1 + sw_exp + opt + bookmark;
}
function replaceBullets(){
var opt = window.document.forms[0].currentSel.value;
var currentSel = window.document.forms[0].currentSel.value;
var currentSelp2 = currentSel.substring(0, currentSel.lastIndexOf('.'));
var hs = window.document.location.hash.substr(4);
var urlstr = window.document.location.href;
var level = currentSel.split('.').length;
var vista = window.document.forms[0].vista.value
var r_tmp_txt = urlstr.indexOf('&Expand=') >=0 ? hs : hs != '' ? hs + '.' + currentSelp2 : '';
var i = 0;
var r_image = urlstr.indexOf('&Expand=') >=0 ? 'expand.gif' : 'collapse.gif';
if ( urlstr.indexOf( 'ExpandView' ) >= 0 ) {
while ( document.images.length -1>= i ) {
if ( document.images[i].name.indexOf( 'bt_' ) >=0 ) { // encuentra las viņetas
document.images[i].src = CurrentDB + "imagenes/fde/" + "expand.gif" + "?OpenImageResource"; }
i++
}}
else {
while ( document.images.length -1 >= i && currentSel != "" ) {
if ( document.images[i].name.indexOf( 'bt_' ) >=0 ) { // encuentra las viņetas
tmp_txt = ( vista == "vRevistasxCat" || vista == 'vLibrosxCat' ) ? 'bt_' + r_tmp_txt : 'bt_' + opt;
if ( document.images[i].name == tmp_txt ) {
if ( level == 1 ) { document.images[i].src = CurrentDB + "imagenes/fde/" + r_image + "?OpenImageResource"; }
}
if ( tmp_txt.indexOf( document.images[i].name ) == 0 ) {
if ( tmp_txt.length > document.images[i].name.length ) {
if ( compara( document.images[i].name.substr(3) , tmp_txt.substr(3) ) ) { document.images[i].src = CurrentDB + "imagenes/fde/" + 'expand.gif' + "?OpenImageResource"; }
}
else { document.images[i].src = CurrentDB + "imagenes/fde/" + r_image + "?OpenImageResource";
}
}
}
i++;
}}
}
function printCat(){
var vista = window.document.forms[0].vista.value;
var selobj = vista == "vLibrosxCat" ? window.document.cmbox.lib_cmb : vista == "vRevistasxCat" ? window.document.cmbox.rev_cmb : "";
var idx = selobj.selectedIndex;
var txt = selobj.options[idx].text ;
document.write( '' + txt + '' );
}
function AbrirFichaB(){
var url = AbrirFichaB.arguments[0];
window.document.location.href = url;
}