function showHideGroupFrame(divId){div=document.getElementById(divId);
if(isShown(div)){hideDiv(div)
}else{showDiv(div)
}}function isShown(div){return(div.style.display!="none")
}function showHideGroupSelection(){combo=document.getElementById("comboForGroups");
value=combo.value;
parentDiv=document.getElementById("divsContainer");
childs=getElementsChildsByName(parentDiv,"groupDiv");
toShow=document.getElementById(value);
hideDivs(filterByParent(childs,parentDiv));
showDiv(toShow);
window.focus()
}function getElementsChildsByName(parent,name){results=new Array();
childs=parent.childNodes;
for(i=0;
i<childs.length;
i++){if(childs[i].attributes.name.nodeValue==name){results.push(childs[i])
}}return results
}function filterByParent(childs,parentWithId){results=new Array();
for(i=0;
i<childs.length;
i++){if(childs[i].parentNode.id==parentWithId.id){results.push(childs[i])
}}return results
}function hideDivs(childs){for(i=0;
i<childs.length;
i++){hideDiv(childs[i])
}}function showDiv(div){div.style.display="block"
}function hideDiv(div){div.style.display="none"
}function searchByConcept(concept){form=document.buscadorForm;
form.texto.value=concept;
form.submit()
}function doSearch(form,target){check=document.getElementById("especificos");
if(check.checked){if(!existTextSelection(form)){alert("Debe seleccionar al menos un tipo de contenido.");
return
}}form.submit()
}function setAdvancedSearch(form,value){form.avanzada.value=value
}function setRadioButtonsByParams(form){params=getArgs();
if(params.clase!="off"){document.getElementById("todos").checked=true
}else{document.getElementById("especificos").checked=true;
form.institucional.checked=params.institucional=="on";
form.productos.checked=params.productos=="on";
form.casos.checked=params.casos=="on";
form.noticias.checked=params.noticias=="on"
}}function setRadioButtons(form,value){document.getElementById("especificos").checked=value;
form.institucional.checked=value;
form.productos.checked=value;
form.casos.checked=value;
form.noticias.checked=value
}function existTextSelection(form){return(form.institucional.checked||form.productos.checked||form.casos.checked||form.noticias.checked)
}function ManagerPublicityIterators(){this.iterators=new Array();
this.newIterator=newIterator;
this.getIterator=function(id){return this.iterators[id]
}
}function newIterator(imgObjId,iterator){this.iterators[imgObjId]=iterator;
setupObjectSource(imgObjId,publicity,"onTimeOut");
setTimeout("onTimeOut('"+imgObjId+"')")
}function PublicityIterator(imgUris,linkUris,internals,types,timeOut,order){if(timeOut==""){timeOut=5
}this.timeout=timeOut*1000;
this.order=getOrderValue(order);
this.index=0;
this.publicitys=new Array();
this.initializeIterator=initializeIterator;
this.addPublicity=addPublicity;
this.getPublicity=getPublicity;
this.getTimeOut=function getTimeOut(){return this.timeout
};
this.getOrder=function getOrder(){return this.order
};
this.count=function count(){return this.publicitys.length
};
this.getPublicityByIndex=getPublicityByIndex;
this.getActualPublicity=getActualPublicity;
this.getActualIndex=function getActualIndex(){return this.index
};
this.getPublicitys=function(){return this.publicitys
};
this.initializeIterator(imgUris,linkUris,internals,types)
}function obtainHref(name){aElements=document.getElementsByName(name);
var result="";
var i;
for(i=0;
i<aElements.length;
i++){result=result+aElements.item(i).href+"*"
}return result
}function getActualPublicity(){index=this.index-1;
if(this.index==0){index=this.count()-1
}return this.publicitys[index]
}function initializeIterator(imgUris,linkUris,internals,types){images=smartSplit(imgUris,"&");
links=smartSplit(linkUris,"*");
internals=smartSplit(internals,"&");
types=smartSplit(types,"&");
for(c=0;
c<images.length;
c++){this.addPublicity(images[c],links[c],internals[c],types[c])
}}function getOrderValue(order){result="lista";
if(order==""||order=="por orden de lista"){result="lista"
}else{if(order=="al azar"){result="azar"
}}return result
}function getPublicity(){index=Math.floor(Math.random()*(this.count()));
result=this.publicitys[index];
if(this.getOrder()!="azar"){result=this.publicitys[this.index];
if(this.index==this.count()-1){this.index=0
}else{this.index++
}}else{this.index=index
}return result
}function getPublicityByIndex(index){return this.publicitys[index]
}function addPublicity(imgUri,linkUri,internal,type){publicity=new Publicity(imgUri,linkUri,internal,type);
this.publicitys.push(publicity)
}function Publicity(imgUri,linkUri,internal,type){this.imgUri=imgUri;
this.linkUri=encodeURL(linkUri);
this.internal=internal;
this.type=type;
this.getImageUri=function(){return this.imgUri
};
this.getLinkUri=function(){return this.linkUri
};
this.getInternalPage=function(){return this.internal
};
this.getObjectType=function(){return this.type
};
this.isImageObject=function(){return this.type=="foto"
};
this.isFlashObject=function(){return this.type=="flash"
}
}globalManagerPublicityIterator=new ManagerPublicityIterators();
function openLocation(imgObjId){iterator=globalManagerPublicityIterator.getIterator(imgObjId);
publicity=iterator.getActualPublicity();
link=publicity.getLinkUri();
internal=publicity.getInternalPage();
openTarget(link,internal)
}function onTimeOut(imgObjId){iterator=globalManagerPublicityIterator.getIterator(imgObjId);
publicity=iterator.getPublicity();
source=publicity.getImageUri();
setupObjectSource(imgObjId,publicity,"onTimeOut");
setTimeout("onTimeOut('"+imgObjId+"')",iterator.getTimeOut())
}function selectRandomImageOnTimeOut(imgObjectId,imagesUris,imgLinks,internals,types,timeOut,order){iterator=new PublicityIterator(imagesUris,imgLinks,internals,types,timeOut,order);
globalManagerPublicityIterator.newIterator(imgObjectId,iterator)
}globalOnLoadIteratorManager=new OnLoadManagerPublicityIterators();
function OnLoadManagerPublicityIterators(){this.iterators=new Array();
this.newIterator=function(id,imagesUris,imgLinks,internals,types){images=smartSplit(imagesUris,"&");
links=smartSplit(imgLinks,"*");
internals=smartSplit(internals,"&");
types=smartSplit(types,"&");
index=Math.floor(Math.random()*(images.length));
publicity=new Publicity(images[index],links[index],internals[index],types[index]);
this.iterators[id]=publicity;
setupObjectSource(id,publicity,"onLoad")
};
this.getPublicity=function(id){return this.iterators[id]
}
}function setupObjectSource(id,publicity,event){element=document.getElementById(id);
parentElement=element.parentNode;
if(publicity.isImageObject()){newImageElement=getNewImageObject(element,publicity,event);
element.src=newImageElement.src;
parentElement.href=publicity.getLinkUri()
}else{insertNewFlashObject(parentElement,element,id,publicity)
}}function getNewImageObject(element,publicity,event){newImage=document.createElement("img");
newImage.setAttribute("id",element.id);
newImage.setAttribute("src",publicity.getImageUri());
onClick="javascript: openLocation('"+element.id+"');";
if(event=="onLoad"){onClick="javascript:onLoadOpenLocation('"+element.id+"');"
}newImage.setAttribute("onclick",onClick);
return newImage
}function insertNewFlashObject(parent,element,id,publicity){result=null;
parent.removeChild(element);
if(navigator.appName.indexOf("Microsoft")!=0){result=newFlashObjectForFireFox(id,publicity);
parent.appendChild(result)
}else{result=newFlashObjectForExplorer(id,publicity);
parentElement.innerHTML=result
}}function newFlashObjectForExplorer(id,publicty){idParam=' id="'+id+'" ';
widthParam=' width="'+publicity.getInternalPage()+'" ';
paramSrc='<param name="src" value="'+publicity.getImageUri()+'"/>';
paramScale='<param name="scale" value="exactfit"/>';
result='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" quality="high"'+idParam+widthParam+">"+paramSrc+paramScale;
return result+"</object>"
}function newFlashObjectForFireFox(id,publicity){newFlash=document.createElement("embed");
newFlash.setAttribute("id",id);
newFlash.setAttribute("pluginspage","http://www.macromedia.com/shockwave/download/");
newFlash.setAttribute("type","application/x-shockwave-flash");
newFlash.setAttribute("width",publicity.getInternalPage());
newFlash.setAttribute("quality","high");
newFlash.setAttribute("src",publicity.getImageUri());
newFlash.setAttribute("scale","exactfit");
return newFlash
}function setPointerOverImage(aRefElement,link){if(link=="none"){aRefElement.style.cursor="default"
}else{aRefElement.style.cursor="pointer"
}}function onLoadOpenLocation(id){publicity=globalOnLoadIteratorManager.getPublicity(id);
link=publicity.getLinkUri();
internal=publicity.getInternalPage();
openTarget(link,internal)
}function selectRandomImageOnLoadPage(imgObjectId,imagesUris,imgLinks,internals,types){globalOnLoadIteratorManager.newIterator(imgObjectId,imagesUris,imgLinks,internals,types)
}function removeLastSeparator(imagesUris,separator){if(imagesUris.charAt(imagesUris.length-1)==separator){imagesUris=imagesUris.substring(0,imagesUris.length-1)
}return imagesUris
}function openPopup(link,wName,wParams){link=encodeURL(link);
if(link.indexOf("?")!=-1){window.open(link+"&html=true&vista=detalle&contorno=true",wName,wParams)
}else{window.open(link+"?html=true&vista=detalle&contorno=true",wName,wParams)
}return false
}function openTarget(link,internal){if(link=="none"){return
}if(internal=="_self"){encodeURL(link);
window.location=link
}else{if(internal=="_blank"){window.open(encodeURL(link));
return false
}else{wName=getPopupWindowsName(internal);
Params=getPopupWindowsParameters(internal);
return openPopup(link,wName,wParams)
}}}function encodeURL(link){link=unescape(link);
tempArray=link.split("?");
urlArray=tempArray[0].split("/");
link="";
for(i=0;
i<urlArray.length;
i++){var hostname=false;
if(link=="http://"){hostname=true
}if(hostname||(i==0&&(urlArray[i].substring(0,"http:".length)=="http:"||urlArray[i].substring(0,"file:".length)=="file:"))){link+=urlArray[i]
}else{link+=escape(urlArray[i])
}if(i+1<urlArray.length){link+="/"
}}if(tempArray.length>1){query=escapeQuery(tempArray[1]);
link+="?"+query
}return link
}function escapeQuery(text){var scapedText="";
var queryArray=text.split("&");
for(var i=0;
i<queryArray.length;
i++){scapedText+=escapeParameter(queryArray[i]);
if(i+1<queryArray.length){scapedText+="&"
}}return scapedText
}function escapeParameter(text){var scapedText="";
var parameterArray=text.split("=");
for(var i=0;
i<parameterArray.length;
i++){scapedText+=escape(parameterArray[i]);
if(i+1<parameterArray.length){scapedText+="="
}}return scapedText
}function getPopupWindowsName(params){sepIndex=params.indexOf(",");
return params.substring(0,sepIndex)
}function getPopupWindowsParameters(params){sepIndex=params.indexOf(",");
return params.substring(sepIndex,params.length)
}function writeFileName(relativeUri){if(relativeUri!=""){tokens=relativeUri.split("/");
if(tokens.length>=0){document.write(tokens[tokens.length-1])
}}}function smartSplit(string,separator){string=removeLastSeparator(string,separator);
string=string.split(separator);
return string
}function getArgs(){var args=new Object();
var query=location.search.substring(1);
var pairs=query.split("&");
for(var i=0;
i<pairs.length;
i++){var pos=pairs[i].indexOf("=");
if(pos==-1){continue
}var argname=pairs[i].substring(0,pos);
var value=pairs[i].substring(pos+1);
args[argname]=unescape(value)
}return args
}function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if(restore){selObj.selectedIndex=0
}}function setShadow(){for(i=0;
i<document.images.length;
i++){if(document.images[i].name=="shadowImage"){height=document.images[i].height;
width=document.images[i].width;
div=document.images[i].name;
if(width>=height){document.div.className="shadowHor"
}else{document.div.className="shadowVert"
}}}}function MM_callJS(jsStr){return eval(jsStr)
}function setImagesSize(height,width){for(i=0;
i<document.images.length;
i++){if(document.images[i].name=="cartel"){imageHeight=document.images[i].height;
imageWidth=document.images[i].width;
heightPorcent=height/imageHeight;
widthPorcent=width/imageWidth;
if(heightPorcent>=widthPorcent){document.images[i].height=height;
document.images[i].width=document.images[i].width*heightPorcent
}else{document.images[i].width=width;
document.images[i].height=document.images[i].height*widthPorcent
}}}}function MM_swapImgRestore(){var i,x,a=document.MM_sr;
for(i=0;
a&&i<a.length&&(x=a[i])&&x.oSrc;
i++){x.src=x.oSrc
}}function MM_preloadImages(){var d=document;
if(d.images){if(!d.MM_p){d.MM_p=new Array()
}var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0;
i<a.length;
i++){if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i]
}}}}function MM_findObj(n,d){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&&d.getElementById){x=d.getElementById(n)
}return x
}function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;
document.MM_sr=new Array;
for(i=0;
i<(a.length-2);
i+=3){if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;
if(!x.oSrc){x.oSrc=x.src
}x.src=a[i+2]
}}}function MM_jumpMenuGo(selName,targ,restore){var selObj=MM_findObj(selName);
if(selObj){MM_jumpMenu(targ,selObj,restore)
}}function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;
i<(args.length-2);
i+=3){if((obj=MM_findObj(args[i]))!=null){v=args[i+2];
if(obj.style){obj=obj.style;
v=(v=="show")?"visible":(v=="hide")?"hidden":v
}obj.visibility=v
}}}function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features)
}function MM_callJS(jsStr){return eval(jsStr)
}function ventanadetalle(url){window.open(encode(url),"detalle","scrollbars=yes,resizable=yes,width=480")
}function ventanaimprimir(url){window.open(encode(url),"imprimir","scrollbars=yes,resizable=yes,width=450")
}function showHide(id){var object=$(id);
if(object){if(object.visible()){object.hide()
}else{object.show()
}}}function showHideAreas(id){var objects=document.getElementsByName(id);
for(j=0;
j<objects.length;
j++){object=objects[i];
if(object.style.display=="block"){object.style.display="none"
}else{object.style.display="block"
}}}function hideAreas(id){var objects=document.getElementsByName(id);
for(j=0;
j<objects.length;
j++){obj=objects[j];
if(obj.style){obj=obj.style;
v="hidden"
}obj.visibility="hidden"
}}function updateQuerySearch(pname,pvalue){var search=window.location.search;
if(search.indexOf("?")>=0){search=search.substring(1,search.length)
}var newSearch="";
var updated=false;
var parameters=search.split("&");
for(var i=0;
i<parameters.length;
i++){var param=parameters[i].split("=");
if(param[0]==pname){if(!updated){if(newSearch.length>0){newSearch=newSearch+"&"
}newSearch=newSearch+pname+"="+pvalue;
updated=true
}}else{if(newSearch.length>0){newSearch=newSearch+"&"
}newSearch=newSearch+param[0]+"="+param[1]
}}if(!updated){if(newSearch.length>0){newSearch=newSearch+"&"
}newSearch=newSearch+pname+"="+pvalue
}return newSearch
}function isChecked(buttonGroup){if(buttonGroup[0]){for(var i=0;
i<buttonGroup.length;
i++){if(buttonGroup[i].checked){return true
}}}else{if(buttonGroup.checked){return true
}}return false
}function mouseover(which){which.style.backgroundColor="#6C83FF";
which.style.color="#FFFFFF"
}function mouseout(which){which.style.backgroundColor="#FFFFFF";
which.style.color="#6C83FF"
}function mouseoutGrisClaro(which){which.style.backgroundColor="#F4F4F4";
which.style.color="#6C83FF"
}function epigrafeSize(){var objects=document.getElementsByName("epigrafe");
for(j=0;
j<objects.length;
j++){var object=objects[i];
if(object!=null){var img=object.firstChild;
if(img!=null){object.style.width=img.width
}}}}function getOtherArgs(blockNameIni,prev,blockNameFin,next,pagName,pag){var args=new Object();
var urlComplete=location.href;
var urlVector=urlComplete.split("?");
var url=urlVector[0];
var query=urlVector[1];
var pairs=query.split("&");
for(var i=0;
i<pairs.length;
i++){var pos=pairs[i].indexOf("=");
if(pos==-1){continue
}var argname=pairs[i].substring(0,pos);
var value=pairs[i].substring(pos+1);
args[argname]=unescape(value)
}args[blockNameIni]=prev;
args[blockNameFin]=next;
args[pagName]=pag;
var parameters;
parameters="?";
for(var i in args){parameters=parameters+i+"="+args[i]+"&"
}url=url+parameters;
location.href=url
}function mouseovermail(which){which.style.backgroundColor="#6C83FF";
which.style.color="#FFFFFF"
}function mouseoutmail(which){which.style.backgroundColor="#F4F4F4";
which.style.color="#6C83FF"
}function trim(str){text=new String(str);
i=0;
while(text.charAt(i)==" "){i++
}j=text.length-1;
while(text.charAt(j)==" "){j--
}return text.substring(i,j+1)
}var max=26;
var min=8;
function upSize(){if(document.getElementById("textCuerpo").style.fontSize!=""){size=parseInt(document.getElementById("textCuerpo").style.fontSize)
}else{size=9
}if(size<max){size=size+2
}document.getElementById("textCuerpo").style.fontSize=size+"pt"
}function downSize(){if(document.getElementById("textCuerpo").style.fontSize!=""){size=parseInt(document.getElementById("textCuerpo").style.fontSize)
}else{size=9
}if(size>min){size=size-2
}document.getElementById("textCuerpo").style.fontSize=size+"pt"
};
