// uridavis common JavaScript

var tdColl=document.getElementsByTagName("TD");

function mover(but){
if( (document.all &&  but.style.color!="#b7033e" ) || (navigator.appName=="Netscape" && but.style.color!="rgb(183, 3, 62)")) {

for (i=0;i<=tdColl.length-1;i++) {
	if(tdColl[i]==but){
		mozlaempchenTDIndex=i-2; // this recognises the TD with one space in it between the laempchen and the text button
		//alert(tdColl[i].innerHTML+"\n"+tdColl[mozlaempchenTDIndex].innerHTML)			
		}
}

//var laempchen = document.all ? but.parentNode.childNodes[0].childNodes[0] : but.parentNode.childNodes[1].childNodes[0];
var laempchen =  tdColl[mozlaempchenTDIndex].childNodes[0];

	laempchen.src="pix/touched_but.gif"
	but.style.color="#999966";
}
if(document.all){but.style.cursor='hand'}
else{but.style.cursor='pointer'}
}

function mout(but){
//alert(but.style.color)
if( (document.all &&  but.style.color!="#b7033e" ) || (navigator.appName=="Netscape" && but.style.color!="rgb(183, 3, 62)")) {
	if(document.all){but.style.cursor='hand'}else{but.style.cursor='pointer'}
	but.style.color="#0A47B1"


for (i=0;i<=tdColl.length-1;i++) {
	if(tdColl[i]==but){
		mozlaempchenTDIndex=i-2; // this recognises the TD with one space in it between the laempchen and the text button
		//alert(tdColl[i].innerHTML+"\n"+tdColl[mozlaempchenTDIndex].innerHTML)			
		}
}

var laempchen =  tdColl[mozlaempchenTDIndex].childNodes[0];


//var laempchen = document.all ? but.parentNode.childNodes[0].childNodes[0] : but.parentNode.childNodes[1].childNodes[0];
	laempchen.src="pix/normal_but.gif"
}
}

function clickMe(but){



// first normalize buttons and lamps in other control panel

var otherPanelPageIndex = (self.location.href.match(/top/) ) ? "2" : "1";
//var thisPanelPageIndex = (self.location.href.match(/top/) ) ? 1 : 2;

//alert("otherPanelPageIndex: "+otherPanelPageIndex)

var otherImgColl=parent.frames[otherPanelPageIndex].document.getElementsByTagName("IMG");
for (i=0;i<=otherImgColl.length-1;i++) {if(!otherImgColl[i].id){otherImgColl[i].src="pix/normal_but.gif"} }

var otherTdColl=parent.frames[otherPanelPageIndex].document.getElementsByTagName("TD");
for (i=0;i<=otherTdColl.length-1;i++) {otherTdColl[i].style.color="#0A47B1"}



var imgColl=document.getElementsByTagName("IMG");
for (i=0;i<=imgColl.length-1;i++) {if(!imgColl[i].id){imgColl[i].src="pix/normal_but.gif"} }

for (i=0;i<=tdColl.length-1;i++) {
	tdColl[i].style.color="#0A47B1";
	if(tdColl[i]==but){
		mozlaempchenTDIndex=i-2; // this recognises the TD with one space in it between the laempchen and the text button
		//alert(tdColl[i].innerHTML+"\n"+tdColl[mozlaempchenTDIndex].innerHTML)			
		}
	}

if(document.all){but.style.cursor='hand'}else{but.style.cursor='pointer'}but.style.color="#B7033E"

var laempchen =  tdColl[mozlaempchenTDIndex].childNodes[0];

//var laempchen = document.all ? but.parentNode.childNodes[0].childNodes[0] : but.parentNode.childNodes[1].childNodes[0];

if(but!='search'){
	laempchen.src="pix/clicked_but.gif"
	zielSeite=but.id+".htm";
	//alert(zielSeite)
	parent.frames[3].location=zielSeite
	}
}

