var Anand = new Image(); Anand.src = "../../images/champs/Anand.jpg";
var Hug = new Image(); Hug.src = "../../images/champs/Hug.jpg";
var Karpov = new Image(); Karpov.src = "../../images/champs/Karpov.jpg";
var Kortschnoj = new Image(); Kortschnoj.src = "../../images/champs/Kortschnoj.jpg";
var Kramnik = new Image(); Kramnik.src = "../../images/champs/Kramnik.jpg";
var Polgar = new Image(); Polgar.src = "../../images/champs/Polgar.jpg";
var Ponomarjow = new Image(); Ponomarjow.src = "../../images/champs/Ponomarjow.jpg";
var Topalov = new Image(); Topalov.src = "../../images/champs/Topalov.jpg"; 

//function activatet onmouseover and onmouseout
function new_champ( name )
{	
	//<td> with tab belonging to image onmouseover
	var tab = document.getElementById( name + "Tab" );
	
	//active tab of chosen player
	var tabActiv = document.getElementById( activTab );
	
	//onmouseover-image
	var img = document.getElementsByName( name )[0];
	
	//change cursor
	img.style.cursor = "pointer";
	
	//show/hide tab
	tab.firstChild.attributes['class'].nodeValue = ( tab.firstChild.attributes['class'].nodeValue == "showIt" )? tab.firstChild.attributes['class'].nodeValue = "showNone" : tab.firstChild.attributes['class'].nodeValue = "showIt";
	
	//shows tab of chosen player
	tabActiv.firstChild.attributes['class'].nodeValue = "showIt";
}

//onclick: change image and text
function change_champ( name )
{
	//tab of last chosen player
	var tabActiv = document.getElementById( activTab );
	
	//hides tab of last chosen player
	tabActiv.firstChild.attributes['class'].nodeValue = "showNone";
	
	//id of new activ tab/player
	activTab = name + "Tab";
	
	//new tab of chosen player
	tabActiv = document.getElementById( activTab );
	
	//show tab of new chosen player
	tabActiv.firstChild.attributes['class'].nodeValue = "showIt";
}
