c = ['#0399da','#179aaa','#64970e','#789300','#789300','#849000','#a2a228','#968b00','#a58600','#b38100','#c27c00','#cd7800','#d67500','#e27000','#f26a00','#fb6700'];
d=document;
addEv(window, 'load', init);

function init () {
	els = d.getElementsByTagName('P');
	for (j=0; j<els.length; j++) if (els[j].className=='colorize'|els[j].className=='colorize_big') fc(els[j]);
	goodInputs();
}

function addEv(el,ev,fn) {if ((/MSIE/i).test(navigator.appVersion)) el.attachEvent('on'+ev,fn); else el.addEventListener(ev,fn,false);}

function fc(el) {
	txt=el.innerHTML; res=''; x=0; fl=0;
	for (i=0; i<txt.length; i++) {
		s=txt.charAt(i);
		res+='<span style="color:'+c[x%16]+'; ';
		if (!fl) res+='font-size:16px;';
		res+='">'+s+'</span>';
		if (s!=' ') x++;
		if (s=='9') fl=1;
	}
	el.innerHTML=res;
}

function goodInputs() {
	df = document.forms;
	function myonfocus(el,elval) {
		el.onblur  = function fun() {if (el.value == "") el.value = elval};
		el.onfocus = function fun() {if (el.value == elval) el.value=""};
	}
	for (i=0; i<=df.length-1; i++) {
		dfe=df[i].elements;
		for (j=0; j<=dfe.length-1; j++) {
			if (dfe[j].type == 'text') myonfocus(dfe[j], dfe[j].value);
			if (dfe[j].type == 'textarea') myonfocus(dfe[j], dfe[j].value);
		}
	}
}