function changeState(){
	var i, x, tB, j=0, tA=new Array(), arg = changeState.arguments;
 
	if(document.getElementsByTagName){
		for(i=4;i<arg.length;i++){
		
			//alert('arg[i] =' + arg[i]);
		
			tB=document.getElementsByTagName(arg[i]);
			for(x=0;x<tB.length;x++){
				tA[j]=tB[x];
				
				//alert('tA[j].id =' + tA[j].id + '; className = ' + tA[j].className + '; tagName = ' + tA[j].tagName);
				
				j++;
			}
		}
		for(i=0;i<tA.length;i++){
			if(tA[i].className){ // Class name is specified
				if(tA[i].id == arg[1]){
					if(arg[0]==1){
						//alert('OLD: tA[i].id =' + tA[i].id + '; className = ' + tA[i].className + '; tagName = ' + tA[i].tagName);
						tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
						//alert('NEW: tA[i].id =' + tA[i].id + '; className = ' + tA[i].className + '; tagName = ' + tA[i].tagName);
					} else { 
						tA[i].className=arg[2];
					}
				} else if(arg[0]==1 && arg[1]=='none'){
					if(tA[i].className==arg[2] || tA[i].className==arg[3]){
						tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
					}
				} else if(tA[i].className==arg[2]){
					//tA[i].className=arg[3];
				}
				
			} else {
				if(tA[i].id == arg[1]){
					//tA[i].className=arg[2];
				//	alert('tA[i].className =' + tA[i].className);
				}
				
			} 
			//alert('tA[i].id =' + tA[i].id + '; className = ' + tA[i].className + '; tagName = ' + tA[i].tagName);
		}
	}
}

function initState(){
	var x, tB, arg = changeState.arguments;
	
	if(document.getElementsByID){
		tB=document.getElementsByID(arg[0]);
		for(x=0;x<tB.length;x++){
				tB[x].className = arg[1];
		}
	}
}