function roll_over(img_name,img_src)
{
	document[img_name].src=img_src;
}


/**************************************************************
Texto navegador inferior
****************************************************************/

var text1=" w w w . c i r m a d . e s "
comeback=0
cometo=0
function dis(){
window.status=text1.substring(0,cometo)
if(comeback==1){
cometo--;
if(cometo==0){comeback=0}
} else {cometo++;if(cometo==text1.length){comeback=1}}
window.status=text1.substring(0,cometo)+"|"
if(cometo==text1.length){window.setTimeout("dis()",500);} else {window.setTimeout("dis()",50);}
}
dis()


/************* 
**** <config> 
**/ 
startColor = "#CCCCCC"; // MouseOut link color 
endColor = "#FFFFFF"; // MouseOver link color 

stepIn = 20; // delay when fading in 
stepOut = 20; // delay when fading out 

/* 
** set to true or false; true will 
** cause all links to fade automatically 
***/ 
autoFade = false; 
/* 
** set to true or false; true will cause all CSS 
** classes with "fade" in them to fade onmouseover 
***/ 
sloppyClass = true; 
/** 
**** </config> 
**************/ 
/************* 
**** <install> 
** 
** 
**** </install> 
**************/ 

hexa = new makearray(16); 
for(var i = 0; i < 10; i++) 
hexa[i] = i; 
hexa[10]="a"; hexa[11]="b"; hexa[12]="c"; 
hexa[13]="d"; hexa[14]="e"; hexa[15]="f"; 

document.onmouseover = domouseover; 
document.onmouseout = domouseout; 

startColor = dehexize(startColor.toLowerCase()); 
endColor = dehexize(endColor.toLowerCase()); 

var fadeId = new Array(); 

function dehexize(Color){ 
var colorArr = new makearray(3); 
for (i=1; i<7; i++){ 
for (j=0; j<16; j++){ 
if (Color.charAt(i) == hexa[j]){ 
if (i%2 !=0) 
colorArr[Math.floor((i-1)/2)]=eval(j)*16; 
else 
colorArr[Math.floor((i-1)/2)]+=eval(j); 
} 
} 
} 
return colorArr; 
} 

function domouseover() { 
if(document.all){ 
var srcElement = event.srcElement; 
if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1)) 
fade(startColor,endColor,srcElement.uniqueID,stepIn); 
} 
} 

function domouseout() { 
if (document.all){ 
var srcElement = event.srcElement; 
if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1)) 
fade(endColor,startColor,srcElement.uniqueID,stepOut); 
} 
} 

function makearray(n) { 
this.length = n; 
for(var i = 1; i <= n; i++) 
this[i] = 0; 
return this; 
} 

function hex(i) { 
if (i < 0) 
return "00"; 
else if (i > 255) 
return "ff"; 
else 
return "" + hexa[Math.floor(i/16)] + hexa[i%16];} 

function setColor(r, g, b, element) { 
var hr = hex(r); var hg = hex(g); var hb = hex(b); 
element.style.color = "#"+hr+hg+hb; 
} 

function fade(s,e, element,step){ 
var sr = s[0]; var sg = s[1]; var sb = s[2]; 
var er = e[0]; var eg = e[1]; var eb = e[2]; 

if (fadeId[0] != null && fade[0] != element){ 
setColor(sr,sg,sb,eval(fadeId[0])); 
var i = 1; 
while(i < fadeId.length){ 
clearTimeout(fadeId[i]); 
i++; 
} 
} 

for(var i = 0; i <= step; i++) { 
fadeId[i+1] = setTimeout("setColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" + 
step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+ 
")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step); 
} 
fadeId[0] = element; 
}


/**************************************************************
Función enlaces degradado transparencia
****************************************************************/

function high(which2)
	{
	theobject=which2;
	highlighting=setInterval("highlightit(theobject)",70);
	}
	function low(which2)
	{
	clearInterval(highlighting);
	which2.filters.alpha.opacity=70;
	}
	function highlightit(cur2)
	{
	if(cur2.filters.alpha.opacity<100)
	cur2.filters.alpha.opacity+=9
	else if(window.highlighting)
	clearInterval(highlighting)
	}


function high2(which2)
	{
	theobject=which2;
	highlighting=setInterval("highlightit(theobject)",10);
	}
	function low(which2)
	{
	clearInterval(highlighting);
	which2.filters.alpha.opacity=70;
	}
	function highlightit(cur2)
	{
	if(cur2.filters.alpha.opacity<100)
	cur2.filters.alpha.opacity+=9
	else if(window.highlighting)
	clearInterval(highlighting)
	}



var highlightcolor="#FFFFFF"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

/**************************************************************
Imágenes rotación
****************************************************************/


<!-- // BannerAD

   var bannerAD=new Array();
   var bannerADlink=new Array();
   var adNum=0;

   bannerAD[0]="images/fotoindextexte5.jpg";
   bannerADlink[0]="#";
   bannerAD[1]="images/fotoindextexte1.jpg";
   bannerADlink[1]="#";
   bannerAD[2]="images/fotoindextexte2.jpg";
   bannerADlink[2]="#";
   bannerAD[3]="images/fotoindextexte3.jpg";
   bannerADlink[3]="#";
   bannerAD[4]="images/fotoindextexte4.jpg";
   bannerADlink[4]="#";

   var preloadedimages=new Array();
   for (i=1;i<bannerAD.length;i++){
      preloadedimages[i]=new Image();
      preloadedimages[i].src=bannerAD[i];
   }

function setTransition(){
   if (document.all){
      bannerADrotator.filters.revealTrans.Transition=4;
      bannerADrotator.filters.revealTrans.apply();
   }
}

function playTransition(){
   if (document.all)
      bannerADrotator.filters.revealTrans.play()
}

function nextAd(){
   if(adNum<bannerAD.length-1)adNum++ ;
      else adNum=0;
   setTransition();
   document.images.bannerADrotator.src=bannerAD[adNum];
   playTransition();
   theTimer=setTimeout("nextAd()", 6000);
}

function jump2url(){
   jumpUrl=bannerADlink[adNum];
   jumpTarget='_self';
   if (jumpUrl != ''){
      if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
      else location.href=jumpUrl;
   }
}
function displayStatusMsg() { 
   window.status=bannerADlink[adNum];
   document.returnValue = true;
}

window.defaultStatus="";

//-->

/*************No tocar a partir de aquí*****************/
var sec
var iexTun=document.appName=='Microsoft Internet Explorer'?true:false;
if(iexTun){var cursorcillo='hand'}
else{var cursorcillo='pointer'}
function inicioMenu(){
with(document){
	write('<div id="Menu">')
	write('<table id="tablaMenu" cellspacing="0">')
	}
for(m=0; m<secciones; m++){ 
	with(document){
		write('<tr><td class="secciones" id="menu_' + m +'">' )
		write(eval('Menu_' + m + '[0]') + '</td>')
		write('</tr>')
		}
	
	sec = eval('Menu_' + m)
	document.getElementById('menu_' + m).onmouseover=function(){
		this.className = 'seccionesHover'
		}
	document.getElementById('menu_' + m).onmouseout=function(){
		this.className = 'secciones'
		}
		if(sec[3]>0){
			document.getElementById('menu_' + m).onclick=function(){
			abreMenu(this.id)
			}
		subMenu('Menu_' + m,sec[3],m)
		}
		else{
		document.write('<tr><td class="cerrado"></td></tr>')
			if(sec[1]!=null){
				document.getElementById('menu_' + m).onclick=function(){
				ir(this.id)
				}
			}
		}
		
}
with(document){
	write('</table>')
	write('</div>')
	}

}
function subMenu(n,cant,nm){
with(document){
	write('<tr><td id="' + n + 'B" class="cerrado">')
	write('<table class="subMeTabla" cellspacing="0" cellpadding="0">')
	}
	for(s=0; s<cant; s++){
	subMe=eval(n+"_"+s)
		with(document){
			writeln('<tr><td style="cursor:' +cursorcillo+'"onmouseover="this.className=\'subSeccionesHover\'"  onmouseout="this.className=\'subSecciones\'" class="subSecciones" onclick="ir(\'Menu_'+nm+'_'+s+'\')">' + subMe[0] + '</td></tr>')
			}
		}
document.write('</table><br>')
document.write('</td></tr>')
}
function abreMenu(cual){
clase = cual
cual = cual.replace(/m/,"M")
cua = eval("'" + cual + "B'")

if(document.getElementById(cual+'B').className == 'abierto'){
	document.getElementById(cual+'B').className = 'cerrado'
	document.getElementById(clase).className = 'secciones'
	document.getElementById(clase).onmouseout=function(){
		this.className = 'secciones'
		}
	document.getElementById(clase).onmouseover=function(){
		this.className = 'seccionesHover'
		}
	}
else{
	document.getElementById(cual+'B').className = 'abierto'
	document.getElementById(clase).className = 'seleccionado'
	document.getElementById(clase).onmouseout=function(){
	return false
		}
	document.getElementById(clase).onmouseover=function(){
	return false
		}
	}
}
function ir(donde){
donde = eval(donde.replace(/m/,"M"))
if(donde[1] != null){
marco = donde[2]
if(marco == 'Nueva'){
	window.open(donde[1])
	}
else if(marco == null){
	location.href=donde[1]
	}
else{
	eval('parent.' + marco + '.location.href="' + donde[1] + '"')
	}}
}


/**************************************************************
Banner rotación con enlace
****************************************************************/


   var bannerAD=new Array();
   var bannerADlink=new Array();
   var adNum=0;

   bannerAD[0]="images/fotos/foto1.jpg";
   bannerADlink[0]="#";
   bannerAD[1]="images/fotos/foto2.jpg";
   bannerADlink[1]="#";

   var preloadedimages=new Array();
   for (i=1;i<bannerAD.length;i++){
      preloadedimages[i]=new Image();
      preloadedimages[i].src=bannerAD[i];
   }

function setTransition(){
   if (document.all){
      bannerADrotator.filters.revealTrans.Transition=12;
      bannerADrotator.filters.revealTrans.apply();
   }
}

function playTransition(){
   if (document.all)
      bannerADrotator.filters.revealTrans.play()
}

function nextAd(){
   if(adNum<bannerAD.length-1)adNum++ ;
      else adNum=0;
   setTransition();
   document.images.bannerADrotator.src=bannerAD[adNum];
   playTransition();
   theTimer=setTimeout("nextAd()", 6000);
}

function jump2url(){
   jumpUrl=bannerADlink[adNum];
   jumpTarget='';
   if (jumpUrl != ''){
      if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
      else location.href=jumpUrl;
   }
}
function displayStatusMsg() { 
   window.status=bannerADlink[adNum];
   document.returnValue = true;
}

window.defaultStatus="";


