function stringValid(obj,size)
{
	if(size=="")
	{
		size=1;
	}
    if(obj.value.length<size || obj.value=="")
    {
        return false;
    }else
    {
        return true;
    }
}

//check if the field is numeric
function numericValid(obj)
{
	var StrValidChars = "0123456789.-,";
	var StrString;
	var StrChar;
	var error;
	var Inti;
	var blnResult = true;
	error = 10;

	StrString = obj.value;

	if (StrString != ''){
		for (i = 0; i < StrString.length && blnResult == true; i++){
		      StrChar = StrString.charAt(i);
		      if (StrValidChars.indexOf(StrChar) == -1){
		               blnResult = false;
		               error = 1;
		      }
		}
	}

	switch(error)
	{
	case 0: return false;
			break;
	case 1: return false;
			break;
	default: return true;
	}
}

function selectValid(obj)
{
	if(obj.length)
	{
		if(obj)
		{
			if ((obj.options[obj.selectedIndex].value != "") && (obj.options[obj.selectedIndex].value !=-1))
	   		{
				return true;
		   	}
			return false;
		}
		return true;
	}
	return true;
}


//check if the field is integer (the is optional)
function integerValidOpt(obj)
{
	var StrValidChars = "0123456789";
	var StrString;
	var StrChar;
	var error;
	var Inti;
	var blnResult = true;
	error = 0;

	StrString = obj.value;

	for (i = 0; i < StrString.length && blnResult == true; i++){
	      StrChar = StrString.charAt(i);
	      if (StrValidChars.indexOf(StrChar) == -1){
	               blnResult = false;
	               error = 1;
	      }
	}

	if (error == 1)
		return false;
	else
		return true;
}

function stepaction(action,i) {
	document.wizard.step_action.value = action;
	document.wizard.step_nb.value = i;
	document.wizard.submit();
}
