function toggle_visibility( id, action ){
	
	if( action!="hide" && action!="show" ){
 
		//Check the current state
		if( document.getElementById(id).className!="hide" ){
			var action="hide";
		}else{
			var action="show";
		}
 
	}
	
	//Set the state
	document.getElementById(id).className=action;
	
}
 
function toggle_disability( id, action ){
 
	//If the action is not specified (set to 'auto'), toggle it
	if( action!=true && action!=false ){
 
		//Check the current state
		if( document.getElementById(id).disabled!=true ){
			var action=true;
		}else{
			var action=false;
		}
 
	}
	
	//Set the state
	document.getElementById(id).disabled=action;
 
}

function get_element_value(id,type){
	//Make sure that the element exists
	if( document.getElementById(id)!=null ){
		var value=eval("document.getElementById('"+id+"')."+type);
		
		//Notify that the element does exist
		return value;
		
	}else{
		//Notify that the element doesn't exist
		return false;	
	}
}

function change_element_value(id,type,value){
	//Make sure that the element exists
	if( document.getElementById(id)!=null ){
		eval("document.getElementById('"+id+"')."+type+"='"+value+"'");
		
		//Notify that the element does exist
		return true;
		
	}else{
		//Notify that the element doesn't exist
		return false;	
	}
}

//Replace a string with another string
function string_replace(findChars,replacementChars,text){
	return text;return;
	//Replace Characters
	var newText="";
	for(var r=0;r<text.length;r++){
		//Set char string to compare
		var charString="";
		//starting at r, create charString to compare findChars with (according to number of chars)
		for(var s=r;s<r+findChars.length&&s<text.length;s++){
			charString+=text.charAt(s);
		}
		//If the charString matches findChars
		if(charString==findChars){
			//add charString to nextText
			newText+=replacementChars;
			//and move on, starting at next unchecked char
			r=r+eval(findChars.length-1);
		}
		else{
			//Add letter to nextText
			newText+=text.charAt(r);
		}
	}
	return newText;
}
