function check_form(form)
{
  return_boolean = true;
  obj = eval(form)
  for(i=0;i<obj.length;i++)
  {
    field_name = obj.elements[i].name;
      if (obj.elements[i].value == "")
      {
        obj.elements[i].style.backgroundColor = "#fff2bf";
        return_boolean = false;
      }
      else
      {
        obj.elements[i].style.backgroundColor = "white";
      }
  } 
return return_boolean;
}

function check_reservation(form)
{
 	var indice = 0;
  return_boolean = false;
  obj = eval(form);
  for(i=0;i<obj.length;i++)
  {
    field_name = obj.elements[i].name;
    if (field_name.indexOf("_ck") != -1)
    {
      if (obj.elements[i].value == "")
      {
        obj.elements[i].style.backgroundColor = "#FFF1C9";
    	}
    	else
    	{
       	obj.elements[i].style.backgroundColor = "#FFFFFF";
				indice++;
    	}
  	}
	}
  if (!checkEmailAddress(obj.elements[1]))
 	{
   	obj.elements[1].style.backgroundColor = "#FFF1C9";
		indice--;		
	}	
 	else
 	{
   	obj.elements[i].style.backgroundColor = "#FFFFFF";
  }
	if ((indice>5)&&(obj.elements[3].value != "")&&(obj.elements[0].value !==""))
	{
	return_boolean = true;
 	}
return return_boolean;
}

function check_contact(form)
{
 	var indice = 0;
  return_boolean = false;
  obj = eval(form);
  for(i=0;i<obj.length;i++)
  {
    field_name = obj.elements[i].name;
    if (field_name.indexOf("_ck") != -1)
    {
      if (obj.elements[i].value == "")
      {
        obj.elements[i].style.backgroundColor = "#FFF1C9";
    	}
    	else
    	{
       	obj.elements[i].style.backgroundColor = "#FFFFFF";
				indice++;
    	}
  	}
	}
  if (!checkEmailAddress(obj.elements[1]))
 	{
   	obj.elements[1].style.backgroundColor = "#FFF1C9";
		indice--;		
	}	
 	else
 	{
   	obj.elements[i].style.backgroundColor = "#FFFFFF";
  }
	if ((indice>2)&&(obj.elements[3].value != "")&&(obj.elements[0].value !==""))
	{
	return_boolean = true;
	}
return return_boolean;
}

function check_plate(form)
{
 	var indice = 0;
  return_boolean = false;
  obj = eval(form)
  for(i=0;i<obj.length;i++)
  {
    field_name = obj.elements[i].name;
    if (field_name.indexOf("_ck") != -1)
    {
      if (obj.elements[i].value == "")
      {
        obj.elements[i].style.backgroundColor = "#fff2bf";				
    	}
    	else
    	{
       	obj.elements[i].style.backgroundColor = "white";
				indice++;
    	}
  	}
	}
	if (indice>3)
	{
	 	return_boolean = true;		
	}		
return return_boolean;	
}

function check(form)
{
 	var indice = 0;
 	var ck = 0;	
  return_boolean = false;
  obj = eval(form)
  for(i=0;i<obj.length;i++)
  {
    field_name = obj.elements[i].name;
    if (field_name.indexOf("_ck") != -1)
    {
		 	ck++;
      if (obj.elements[i].value == "")
      {
        obj.elements[i].style.backgroundColor = "#fff2bf";				
    	}
    	else
    	{
       	obj.elements[i].style.backgroundColor = "white";
				indice++;
    	}
  	}
	}
	if (indice==ck)
	{
	 	return_boolean = true;		
	}		
return return_boolean;	
}


function move(index,to) {
var list = document.form.list;
var total = list.options.length-1;
if (index == -1) return false;
if (to == +1 && index == total) return false;
if (to == -1 && index == 0) return false;
var items = new Array;
var values = new Array;
for (i = total; i >= 0; i--) {
items[i] = list.options[i].text;
values[i] = list.options[i].value;
}
for (i = total; i >= 0; i--) {
if (index == i) {
list.options[i + to] = new Option(items[i],values[i + to], 0, 1);
list.options[i] = new Option(items[i + to], values[i]);
i--;
}
else {
list.options[i] = new Option(items[i], values[i]);
   }
}
list.focus();
}

function submitForm() {
var list = document.form.list;
var theList = "&";
var begtext = "";
for (i = 0; i <= list.options.length-1; i++) {
begtext = list.options[i].text;
begtext = begtext.substring(0,2);
theList += "list" + list.options[i].value + "=" + begtext;
if (i != list.options.length-1) theList += "&";
}
location.href = document.form.action + theList;
}

