// JavaScript Document
var d=document;

// last edit 01.11.2008
// change css class
function roll( a ) 
{
	a.style.cursor = 'pointer';
	if( a.className.substr( (a.className.length-1),1 ) == 'n' ) b = 'o';
	else b = 'n';
	a.className = a.className.substr( 0, (a.className.length-1) )+b;
}

// last edit 05.12.2008
// Chek form
function checkFields( form ) {
	var obj = checkFields.arguments;
	for( var i = 0; i < form.elements.length; i++ ) {
		form.elements[i].style.borderColor = '#d6dce1';
	}
	
	for( var i = 1; i < obj.length; i++ ) {
	
		var object = form.elements[obj[i]];
		var objType = object.type;
		var objValue = object.value;
		
		if( objType == 'text' || objType == 'password' || objType == 'textarea' ) {
			if( objValue == '' || objValue == '?' ) {
				alert("Моля попълнете всички полета!");
				object.value = '?';
				object.style.borderColor = '#e07219';
				object.select();
				object.focus();
				return false;
			}
		}
		if( objType == 'select-one' ) {
			if( objValue == '--' || objValue == '' ) {
				alert("Моля попълнете всички полета!");
				object.focus();
				object.style.borderColor = '#e07219';
				return false;
			}
		}
	}
	return true;
}

