//validation functions----------------------------------------------
function checkSelection(o,n,s) {
	if ( o.attr('selectedIndex') == 0 ) {
		o.addClass('validationError');
		o.focus();
		$(s).html(n);
		return (false);
	}
	return (true);
} 

function checkLength(o,n,min,max,s) {
	if ( o.val().length > max || o.val().length < min ) {
		o.addClass('validationError');
		o.focus();
		$(s).html(n);
		return false;
	} else {
		return true;
	}
} 

function validValue(o,_o, n, s){
	if ( o.val() != _o.val() ){
		o.addClass('validationError');
		o.focus();
		$(s).html(n);
		return false;
	} else {
		return true;
	}
}


function checkRegexp(o,regexp,n,s) {
	if ( !( regexp.test( o.val() ) ) ) {
		if ( n && s ){
			o.addClass('validationError');
			o.focus();
			$(s).html(n);
		}
		return false;
	} else {
		return true;
	}
}

function checkCcVendor(o, n, s){
	cstr = o.val().replace(/[^0-9]/g, "");
	if ( cstr.charAt(0) == "5" || cstr.charAt(0) == "4" || cstr.length>12 ) {
		return (true);
	}else{
		o.addClass('validationError');
		o.focus();
		$(s).html(n);
	}
}


