var FICOD = {
init : function(){
FICOD.hacerBlank();
if ($chk($('txtBuscar'))){
$('txtBuscar').addEvent('blur',function(){
if ($('txtBuscar').value == '')
$('txtBuscar').value = 'Search';
});
$('txtBuscar').addEvent('focus',function(){
if ($('txtBuscar').value == 'Search')
$('txtBuscar').value = '';
});
}
if ($chk($('emailSubs'))){
$('emailSubs').addEvent('blur',function(){
if ($('emailSubs').value == '')
$('emailSubs').value = 'Insert your email';
});
$('emailSubs').addEvent('focus',function(){
if ($('emailSubs').value == 'Insert your email')
$('emailSubs').value = '';
});
}
if ($chk($('contentHem'))){
$hemeroteca = new Fx.Slide($('contentHem')).hide();
$('lnkContentHem').addEvent('click',function(){
$hemeroteca.toggle();
return false;
});
}
if ($chk($('contentCat'))){
$categoria = new Fx.Slide($('contentCat')).hide();
$('lnkContentCat').addEvent('click',function(){
$categoria.toggle();
return false;
});
}
if ($chk($('listCommentss'))){
$each($$('#listCommentss li a'),function(element){
texto = element.innerHTML;
textoDv = '';
salida = (texto != '') ? 'no' : 'si';
if (salida == 'si')
textoDv = texto;
pos = 0;
sigPos = 0;
while (salida == 'no'){
sigPos = texto.indexOf(" ",pos);
if (sigPos < 0){
salida = 'si';
textoDv += texto.substring(pos,texto.length);
}
else{
++sigPos;
distancia = parseInt(sigPos) - parseInt(pos);
if (distancia > 31){
textoDv += texto.substring(pos,parseInt(pos)+30)+'
';
sigPos = parseInt(pos)+30;
}
else{
textoDv += texto.substring(pos,sigPos);
}
pos = sigPos;
}
}
element.innerHTML = textoDv;
});
}
},
hacerBlank : function(){
$$('a.hacerblank').each(function(element){
element.addEvent('click',function(e){
window.open(this.href,"Ficod");
return false;
});
});
}
}
/* LOAD */
function addLoadEvent(fn)
{
var old = window.onload;
if(typeof window.onload != 'function')
window.onload = fn;
else
window.onload = function()
{
old();
fn();
}
}
addLoadEvent( function() { FICOD.init(); } );