function show_elem(id)
{
	if(document.getElementById(id))
	{
		document.getElementById(id).style.visibility = "visible";
	}
}
function hide_elem(id)
{
	if(document.getElementById(id))
	{
		document.getElementById(id).style.visibility = "hidden";
	}
}	
		
function css_klasse(id,css_klasse)
{
	if(document.getElementById(id))
	{
		document.getElementById(id).className = css_klasse;
	}
}

function autostart()
{
	form_colorchanger();
}

// form colorchanger
function form_colorchanger(color_1,color_2,use_tags,input_types)
{
	var color_1 =  color_1 || "#ededed";
	var color_2 =  color_2 || "#ffffff";
	
	function set_active_status()
	{
		this.style.backgroundColor = color_1;
	};
	function set_passive_status()
	{
		this.style.backgroundColor = color_2;
	};
	
	// define elements & attributes 
	var use_tags = use_tags || "input,select,textarea";
	var use_inputtypes = input_types || "text,password,file";
	
	var tags = use_tags.split(",");
	var inputtypes = use_inputtypes.split(",");
	
	for(var i=0;i<tags.length;i++)
	{
		var elem = document.getElementsByTagName(tags[i]);
		
		for(var a=0;a<elem.length;a++)
		{
			for(var b=0;b<inputtypes.length;b++)
			{
				if((elem[a].tagName == "INPUT" && elem[a].type == inputtypes[b]) || elem[a].tagName != "INPUT")
				{
					elem[a].onfocus = set_active_status;
					elem[a].onblur = set_passive_status;	
				}
			}
		}
	}
}

