function checkOnSubmit(paket){
    var errs=0;

        if (!validateTextNoLocal('first_name', 'first_name_s',true))		errs += 1;
        if (!validateTextNoLocal('last_name','last_name_s',true))	        errs += 1;
        if (!preveriTel('phone','phone_s', true))                 		errs += 1;
        if (!preveriTel('fax','fax_s', false))                 			errs += 1;
        if (!preveriMail('email','email_s',true))                    		errs += 1;

	if(paket == "DomenaPro"){
		if (!preveriOrg('org_name','org_name_s',true))			errs += 1;
		if (!preveriMat('mat_num','mat_num_s',true))			errs += 1;
		if (!preveriVat('dav_num','dav_num_s',true))			errs += 1;
	}
	if (!validateTextNoLocal('address1','address1_s',true))    		errs += 1;
	if (!preveriPostal('postal_code', 'postal_code_s', true))		errs += 1;
        if (!validateTextNoLocal('city','city_s',true))          		errs += 1;

	if (errs!=0) {
		alert("NAPAKA!\n\nPopravite podatke pri poljih oznacenih z rdecimi opombami.\n ");
        	return false;
    	}
    	else {
    		return true;
    	}
}

function checkOnSubmit3(paket){
    var errs=0;
  if(document.choose_form.choose[0]){
    if(document.choose_form.choose[0].checked){
        var tt = document.choose_form.choose[0].value;
    }else{
        var tt = document.choose_form.choose[1].value;
    }
  }else{
	var tt = document.choose_form.choose.value;
  }

  if(tt == "new"){
        if (!validateTextNoLocal('first_name', 'first_name_s',true))            errs += 1;
        if (!validateTextNoLocal('last_name','last_name_s',true))               errs += 1;
        if (!preveriTel('phone','phone_s', true))                               errs += 1;
        if (!preveriTel('fax','fax_s', false))                                  errs += 1;
        if (!preveriMail('email','email_s',true))                               errs += 1;

        if(paket == "DomenaPro"){
                if (!preveriOrg('org_name','org_name_s',true))                  errs += 1;
                if (!preveriMat('mat_num','mat_num_s',true))                    errs += 1;
                if (!preveriVat('dav_num','dav_num_s',true))                    errs += 1;
        }
        if (!validateTextNoLocal('address1','address1_s',true))                 errs += 1;
        if (!preveriPostal('postal_code', 'postal_code_s', true))               errs += 1;
        if (!validateTextNoLocal('city','city_s',true))                         errs += 1;
  }

        if (errs!=0) {
                alert("NAPAKA!\n\nPopravite podatke pri poljih oznacenih z rdecimi opombami.\n ");
                return false;
        }
        else {
                return true;
        }
}


function submit_form(id)
{
  document.getElementById(id).submit();
  return false;
}
function kartica(){
  if(document.getElementById('id_p').checked){
	document.getElementById('kartica').style.display = 'none';
//	document.getElementById('id_m').style.margin = '20px 0 0 0';
  }else if(document.getElementById('id_k').checked){
	document.getElementById('kartica').style.display = 'block';
//	document.getElementById('id_m').style.margin = '0px 0 0 0';
  }else{ }

}


