﻿// JScript File

function CheckForm(pPlace, pDate, pTime, dPlace, dDate, dTime, mtc, culture) {
        ClearError();
        ViewCar.CheckForm(pPlace.value, pDate.value + pTime.value.substring(10,19), dPlace.value, dDate.value + dTime.value.substring(10,19), List(document.forms[0].fm_cat), document.getElementById('cbInsurance').checked, mtc, culture, GetCallback, ErrorCall);
        return false;
    }
                  
function List(ctr){
        var str = ",";
        for (var i = 0;i < ctr.length;i++)
            {
                if (ctr[i].checked)
                {
                   str = str + ctr[i].value + ',';
                }
            }
            return str;
      }
        
function ClearError()
            {
                var errorLabel = document.getElementById('errorLabel');
                errorLabel.innerHTML = '';
            }   
            
function ErrorCall(args)
            {
                var errorLabel = document.getElementById('errorLabel');
                errorLabel.innerHTML =  args.get_message();
            }            
            
            
 function GetCallback(result, userContext, methodName)
                    {    
                        parent.location.href = result;
                    }                           

 if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();