function toggleclass(objID,class1,class2){
	if(document.getElementById(objID)){
		obj=document.getElementById(objID);
		if (	obj.className == class1)
			obj.className =  class2;
		else	obj.className =  class1;
		}
	}
function Aclass(className){ //Add
	// check if this class does exist already!
	if(this.Cclass(className)) return true;
	// ifnot, proceed adding this className
	classNames=this.className.split(" ");
	classNames[classNames.length]=className;
	this.className=classNames.join(" ");
	}
function Rclass(className){ //Remove
	// check if this class is missing already!
	if(!this.Cclass(className)) return true;
	// ifnot, proced removing this class
	classNames=this.className.split(" ");
	for(i in classNames)
		if(classNames[i]==className)
			classNames[i]='';
	this.className=classNames.join(" ");
	}
function Cclass(className){ //Check
	classNames=this.className.split(" ");
	var i; for(i in classNames)
		if(classNames[i]==className)
			return true;
	return false;
	}
function Tclass(className){ //Toggle
	if(this.Cclass(className))
		this.Rclass(className);
	else	this.Aclass(className);
	}
function switchFormAction(input){	//this function must be called by a switcher input
	if(!(form=input.parentNode)) alert('can not determine parent node');	//let's say
	while(form.tagName.toLowerCase()!='form')
		if(form.tagName.toLowerCase()=='body') {alert('reached to body');return;} // no form to act on
		else form=form.parentNode; //go upwards
	//disable all existing action inputs
	var actions=form.getElementsByName('action');
	alert(actions.length+' action inputs found');
	for(var i=0;i<actions.length;i++)
		if(actions[i]==input)	actions[i].disabled=false; // except this one
		else			actions[i].disabled=true;
	return false;
	}
