﻿// -- get all the input elements in the document

var x=document.getElementsByTagName('input')           

for (i=0; i<x.length;i++) {
	
	if (x[i].getAttribute('type')=='checkbox') {
		
		x[i].className='myCheck';

	}

	if (x[i].getAttribute('type')=='radio') {

		x[i].className='myRadio';

	}

	if (x[i].getAttribute('type')=='text') {

		x[i].className='myText';

	}

	if (x[i].getAttribute('type')=='password') {

		x[i].className='myPassword';

	}

	if (x[i].getAttribute('type')=='submit')
	{
		if (x[i].className == '')
			x[i].className='mySubmit';
	}

	if (x[i].getAttribute('type')=='reset') {

		x[i].className='myReset';

	}

	if (x[i].getAttribute('type')=='button') {

		x[i].className='myButton';

	}

}
