function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function _CF_onError(form_object, input_object, object_value, error_message)
    {
	alert(error_message);
	return false;	
    }

function _CF_hasValue(obj, obj_type)
    {
    if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
    	if (obj.value.length == 0) 
   		return false;
    	else 
   		return true;
    	}
    else if (obj_type == "SELECT")
	{
        for (i=0; i < obj.length; i++)
	    	{
		if (obj.options[i].selected)
			return true;
		}

       	return false;	
	}
    else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{

		if (obj.checked)
			return true;
		else
       		return false;	
	}
    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{

        for (i=0; i < obj.length; i++)
	    	{
		if (obj[i].checked)
			return true;
		}

       	return false;	
	}
	}



function _CF_checkinteger(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is an integer defined as
    //   having an optional leading + or -.
    //   otherwise containing only the characters 0-9.
	var decimal_format = ".";
	var check_char;

    //The first character can be + -  blank or a digit.
	check_char = object_value.indexOf(decimal_format)
    //Was it a decimal?
    if (check_char < 1)
	return _CF_checknumber(object_value);
    else
	return false;
    }



function _CF_numberrange(object_value, min_value, max_value)
    {
    // check minimum
    if (min_value != null)
	{
        if (object_value < min_value)
		return false;
	}

    // check maximum
    if (max_value != null)
	{
	if (object_value > max_value)
		return false;
	}
	
    //All tests passed, so...
    return true;
    }



function _CF_checknumber(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks

		}
	        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	
    //All tests passed, so...
    return true
    }



function _CF_checkrange(object_value, min_value, max_value)
    {
    //if value is in range then return true else return false

    if (object_value.length == 0)
        return true;


    if (!_CF_checknumber(object_value))
	{
	return false;
	}
    else
	{
	return (_CF_numberrange((eval(object_value)), min_value, max_value));
	}
	
    //All tests passed, so...
    return true;
    }


function  _CF_checkform2(_CF_this)
    {
    if  (!_CF_hasValue(_CF_this.car_price, "TEXT" )) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.car_price, _CF_this.car_price.value, "Nezadali jste cenu"))
            {
            return false; 
            }
        }
 if  (!_CF_checkrange(_CF_this.car_price.value, 1, 10000000)) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.car_price, _CF_this.car_price.value, "Nezadali jste cenu"))
            {
            return false; 
            }
        }
    if  (!_CF_checkinteger(_CF_this.car_price.value))
        {
        if  (!_CF_onError(_CF_this, _CF_this.car_price, _CF_this.car_price.value, "Nezadali jste cenu"))
            {
            return false; 
            }
        }
    return true;
    }

function  _CF_checkemail(_CF_this)

    {

    if  (!_CF_hasValue(_CF_this.name, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.name, _CF_this.name.value, "Nezadali jste vaše jméno"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.contact, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.contact, _CF_this.contact.value, "Nezadali jste email nebo telefonní číslo"))

            {

            return false; 

            }

        }


    return true;

    }
	
function  _CF_checkhlaseni(_CF_this)

    {

    if  (!_CF_hasValue(_CF_this.poj_jmeno, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.poj_jmeno, _CF_this.poj_jmeno.value, "Nevyplnili jste pole > Pojistník > Jméno a příjmení"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.poj_adresa, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.poj_adresa, _CF_this.poj_adresa.value, "Nevyplnili jste pole > Pojistník > Adresa"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.poj_psc, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.poj_psc, _CF_this.poj_psc.value, "Nevyplnili jste pole > Pojistník > PSČ"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.poj_kontakt, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.poj_kontakt, _CF_this.poj_kontakt.value, "Nevyplnili jste pole > Pojistník > Tel / fax"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.poj_smlouva, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.poj_smlouva, _CF_this.poj_smlouva.value, "Nevyplnili jste pole > Pojistník > Pojistná smlouva číslo"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.poj_ico, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.poj_ico, _CF_this.poj_ico.value, "Nevyplnili jste pole > Pojistník > IČO (RČ)"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.rid_jmeno, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.rid_jmeno, _CF_this.rid_jmeno.value, "Nevyplnili jste pole > Řidič automobilu > Jméno a příjmení"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.rid_adresa, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.rid_adresa, _CF_this.rid_adresa.value, "Nevyplnili jste pole > Řidič automobilu > Adresa"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.rid_psc, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.rid_psc, _CF_this.rid_psc.value, "Nevyplnili jste pole > Řidič automobilu > PSČ"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.rid_kontakt, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.rid_kontakt, _CF_this.rid_kontakt.value, "Nevyplnili jste pole > Řidič automobilu > Tel / fax"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.rid_prukaz, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.rid_prukaz, _CF_this.rid_prukaz.value, "Nevyplnili jste pole > Řidič automobilu > Číslo řidičského průkazu"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.rid_vydan, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.rid_vydan, _CF_this.rid_vydan.value, "Nevyplnili jste pole > Řidič automobilu > Vydán dne"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.neh_misto, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.neh_misto, _CF_this.neh_misto.value, "Nevyplnili jste pole > Datum a místo nehody > Místo nehody"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.neh_okres, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.neh_okres, _CF_this.neh_okres.value, "Nevyplnili jste pole > Datum a místo nehody > Okres / Kraj"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.neh_stat, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.neh_stat, _CF_this.neh_stat.value, "Nevyplnili jste pole > Datum a místo nehody > Stát"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.neh_hod, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.neh_hod, _CF_this.neh_hod.value, "Nevyplnili jste pole > Datum a místo nehody > Hodina nehody"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.neh_datum, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.neh_datum, _CF_this.neh_datum.value, "Nevyplnili jste pole > Datum a místo nehody > Datum nehody"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_spz, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_spz, _CF_this.voz_spz.value, "Nevyplnili jste pole > Vozidlo > SPZ"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_typ, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_typ, _CF_this.voz_typ.value, "Nevyplnili jste pole > Vozidlo > Značka a typ vozidla"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_rok, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_rok, _CF_this.voz_rok.value, "Nevyplnili jste pole > Vozidlo > Rok výroby"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_km, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_km, _CF_this.voz_km.value, "Nevyplnili jste pole > Vozidlo > Ujeto kilometrů"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_tp, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_tp, _CF_this.voz_tp.value, "Nevyplnili jste pole > Vozidlo > Číslo technického průkazu"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_otp, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_otp, _CF_this.voz_otp.value, "Nevyplnili jste pole > Vozidlo > Číslo OTP"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_vin, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_vin, _CF_this.voz_vin.value, "Nevyplnili jste pole > Vozidlo > VIN - číslo karoserie"))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.voz_motor, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.voz_motor, _CF_this.voz_motor.value, "Nevyplnili jste pole > Vozidlo > Číslo motoru"))

            {

            return false; 

            }

        }

    if  (!_CF_hasValue(_CF_this.podpis_misto, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.podpis_misto, _CF_this.podpis_misto.value, "Nevyplnili jste pole > V"))

            {

            return false; 

            }

        }
		
    if  (!_CF_hasValue(_CF_this.podpis_dne, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.podpis_dne, _CF_this.podpis_dne.value, "Nevyplnili jste pole > Dne"))

            {

            return false; 

            }

        }

    if  (!_CF_hasValue(_CF_this.podpis_podpis, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.podpis_podpis, _CF_this.podpis_podpis.value, "Nevyplnili jste pole > Podpis"))

            {

            return false; 

            }

        }
		
    return true;

    }

function  _CF_checkzmena_spz(_CF_this)
    {
    if  (!_CF_hasValue(_CF_this.poj_smlouva, "TEXT" )) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.poj_smlouva, _CF_this.poj_smlouva.value, "Nevyplnili jste pole > Pojistná smlouva c."))
            {
           return false; 
           }
        }
    if  (!_CF_hasValue(_CF_this.poj_vozidlo, "TEXT" )) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.poj_vozidlo, _CF_this.poj_vozidlo.value, "Nevyplnili jste pole > Pojištené vozidlo"))
            {
            return false; 
            }
        }
    if  (!_CF_hasValue(_CF_this.pojistnik, "TEXT" )) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.pojistnik, _CF_this.pojistnik.value, "Nevyplnili jste pole > Pojistník"))
            {
            return false; 
            }
       }
    if  (!_CF_hasValue(_CF_this.datum, "TEXT" )) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.datum, _CF_this.datum.value, "Nevyplnili jste pole > Datum pridelení SPZ"))
            {
            return false; 
            }
        }
    if  (!_CF_hasValue(_CF_this.spz, "TEXT" )) 
        {
        if  (!_CF_onError(_CF_this, _CF_this.spz, _CF_this.spz.value, "Nevyplnili jste pole > SPZ"))
            {
            return false; 
            }
        }
    return true;
    }