//var gtype = ".gif";
var loc = "images/";

		function writeButton(name,action,path, gtype)
		{
			
			reg(name,path,gtype);

			if (action == 0)
				turn_on(name);
			else
				turn_off(name);
		}

		function turn_on(name)
		{
				document[name].src = document[name+"_on"].src;
		}

		function turn_off(name)
		{
				document[name].src = document[name+"_off"].src;
		}

		function reg(name,path,gtype)
		{
			if (document.images)
			{
				document[name+"_off"] = new Image();
				document[name+"_off"].src = loc+path+"/"+name+"_off"+gtype;
				document[name+"_on"] = new Image();
				document[name+"_on"].src = loc+path+"/"+name+"_on"+gtype;
			}
		}