function jva_pop_up(id){
var w = 480, h = 340;

  if (document.all || document.layers) {
    w = screen.availWidth;
    h = screen.availHeight;
  }

  var popW = 300, popH = 300;
  var leftPos = (w-popW)/2, topPos = (h-popH)/2;
  window.open(id,'pop_up','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

function jva_login()
{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "login";
	frm_form.submit(); 
}

function jva_account_toevoegen()
{
  var frm_form = document.frm_application;
  if (frm_form.str_username.value == "") { alert("Vul een username in."); return false; }
  if (frm_form.str_password.value == "") { alert("Vul een password in."); return false; }
  frm_form.bool_opslaan.value = "account_toevoegen";
  frm_form.submit(); 
}

function jva_account_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_username.value == "") { alert("Vul een username in."); return false; }
    if (frm_form.str_password.value == "") { alert("Vul een password in."); return false; }
	frm_form.bool_opslaan.value = "account_wijzigen";
	frm_form.submit(); 
}

function jva_account_verwijderen(int_id)
{
	if (window.confirm("Weet u zeker dat u deze account wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "account_verwijderen";
	frm_form.int_id.value = int_id;
	frm_form.submit(); 
	}
}

function jva_nieuws_toevoegen()
{
  var frm_form = document.frm_application;
  if (frm_form.str_nieuws_titel.value == "") { alert("Vul een titel van het bericht in."); return false; }
  if (frm_form.str_nieuws_content.value == "") { alert("Vul de inhoud van het bericht in."); return false; }
  frm_form.bool_opslaan.value = "nieuws_toevoegen";
  frm_form.submit(); 
}

function jva_nieuws_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_nieuws_titel.value == "") { alert("Vul een titel van het bericht in."); return false; }
    if (frm_form.str_nieuws_content.value == "") { alert("Vul de inhoud van het bericht in."); return false; }
	frm_form.bool_opslaan.value = "nieuws_wijzigen";
	frm_form.submit(); 
}

function jva_nieuws_verwijderen(int_id)
{
	if (window.confirm("Weet u zeker dat u dit nieuwsbericht wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "nieuws_verwijderen";
	frm_form.int_id.value = int_id;
	frm_form.submit(); 
	}
}

function jva_home_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_home_content.value == "") { alert("Vul een welkomswoord in."); return false; }
    frm_form.bool_opslaan.value = "home_wijzigen";
	frm_form.submit(); 
}

function jva_copyright_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_copyright_content.value == "") { alert("Vul een copyrighttekst in."); return false; }
    frm_form.bool_opslaan.value = "copyright_wijzigen";
	frm_form.submit(); 
}

function jva_showroom_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_showroom_content.value == "") { alert("Vul de informatie in."); return false; }
    frm_form.bool_opslaan.value = "showroom_wijzigen";
	frm_form.submit(); 
}

function jva_productpagina_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_hoofdproduct_tekst.value == "") { alert("Vul de informatie in."); return false; }
    frm_form.bool_opslaan.value = "productpagina_wijzigen";
	frm_form.submit(); 
}

function jva_contact_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_contact_gegevens.value == "") { alert("Vul de contactgegevens in."); return false; }
    frm_form.bool_opslaan.value = "contact_wijzigen";
	frm_form.submit(); 
}

function jva_bedrijfsprofiel_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_bedrijfsprofiel_content.value == "") { alert("Vul een bedrijfsprofiel in."); return false; }
    frm_form.bool_opslaan.value = "bedrijfsprofiel_wijzigen";
	frm_form.submit(); 
}

function jva_vacature_toevoegen()
{
  var frm_form = document.frm_application;
  if (frm_form.str_vacature_functie.value == "") { alert("Vul de functie voor de vacature in."); return false; }
  if (frm_form.str_vacature_dienstverband.value == "") { alert("Vul het dienstverband voor de vacature in."); return false; }
  if (frm_form.str_vacature_contractduur.value == "") { alert("Vul de contractduur voor de vacature in."); return false; }
  if (frm_form.str_vacature_functie_omschrijving.value == "") { alert("Vul de functieomschrijving voor de vacature in."); return false; }
  if (frm_form.str_vacature_functie_korte_samenvatting.value == "") { alert("Vul de samenvatting van de functie voor de vacature in."); return false; }
  if (frm_form.str_vacature_opleidingsniveau.value == "") { alert("Vul het opleidingsniveau voor de vacature in."); return false; }
  if (frm_form.str_vacature_ervaring.value == "") { alert("Vul de ervaring voor de vacature in."); return false; }
  if (frm_form.str_vacature_primaire_arbeidsvoorwaarden.value == "") { alert("Vul de primaire arbeidsvoorwaarden voor de vacature in."); return false; }
  if (frm_form.str_vacature_secundaire_arbeidsvoorwaarden.value == "") { alert("Vul de secundaire arbeidsvoorwaarden voor de vacature in."); return false; }
  if (frm_form.str_vacature_aanvullende_eisen.value == "") { alert("Vul de aanvullende eisen voor de vacature in."); return false; }
  if (frm_form.str_vacature_sollicitatie.value == "") { alert("Vul de sollicitatiemethode voor de vacature in."); return false; }
  frm_form.bool_opslaan.value = "vacature_toevoegen";
  frm_form.submit(); 
}

function jva_vacature_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_vacature_functie.value == "") { alert("Vul de functie voor de vacature in."); return false; }
    if (frm_form.str_vacature_dienstverband.value == "") { alert("Vul het dienstverband voor de vacature in."); return false; }
    if (frm_form.str_vacature_contractduur.value == "") { alert("Vul de contractduur voor de vacature in."); return false; }
    if (frm_form.str_vacature_functie_omschrijving.value == "") { alert("Vul de functieomschrijving voor de vacature in."); return false; }
    if (frm_form.str_vacature_functie_korte_samenvatting.value == "") { alert("Vul de samenvatting van de functie voor de vacature in."); return false; }
    if (frm_form.str_vacature_opleidingsniveau.value == "") { alert("Vul het opleidingsniveau voor de vacature in."); return false; }
    if (frm_form.str_vacature_ervaring.value == "") { alert("Vul de ervaring voor de vacature in."); return false; }
    if (frm_form.str_vacature_primaire_arbeidsvoorwaarden.value == "") { alert("Vul de primaire arbeidsvoorwaarden voor de vacature in."); return false; }
    if (frm_form.str_vacature_secundaire_arbeidsvoorwaarden.value == "") { alert("Vul de secundaire arbeidsvoorwaarden voor de vacature in."); return false; }
    if (frm_form.str_vacature_aanvullende_eisen.value == "") { alert("Vul de aanvullende eisen voor de vacature in."); return false; }
    if (frm_form.str_vacature_sollicitatie.value == "") { alert("Vul de sollicitatiemethode voor de vacature in."); return false; }
    frm_form.bool_opslaan.value = "vacature_wijzigen";
	frm_form.submit(); 
}

function jva_vacature_verwijderen(int_id)
{
	if (window.confirm("Weet u zeker dat u deze vacature wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "vacature_verwijderen";
	frm_form.int_id.value = int_id;
	frm_form.submit(); 
	}
}

function jva_zoek()
{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "zoek";
	frm_form.submit(); 
}

function jva_stats()
{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "stats";
	frm_form.submit(); 
}

function jva_product_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_product_informatie.value == "") { alert("Vul de informatie over de productgroep in."); return false; }
	frm_form.bool_opslaan.value = "product_wijzigen";
	frm_form.submit(); 
}

function jva_productgroep_toevoegen()
{
  var frm_form = document.frm_application;
  if (frm_form.str_productgroep_naam.value == "") { alert("Vul een naam voor de productgroep in."); return false; }
  frm_form.bool_opslaan.value = "productgroep_toevoegen";
  frm_form.submit(); 
}

function jva_productgroep_verwijderen(int_id)
{
	if (window.confirm("Weet u zeker dat u deze productgroep wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "productgroep_verwijderen";
	frm_form.int_id.value = int_id;
	frm_form.submit(); 
	}
}

function jva_productgroep_wijzigen()
{
	var frm_form = document.frm_application;
	if (frm_form.str_productgroep_naam.value == "") { alert("Vul een naam voor de productgroep in."); return false; }
    frm_form.bool_opslaan.value = "productgroep_wijzigen";
	frm_form.submit(); 
}

function jva_afbeelding_toevoegen()
{
  var frm_form = document.frm_image;
  frm_form.image_opslaan.value = "afbeelding_toevoegen";
  frm_form.submit(); 
}

function jva_afbeelding_wijzigen()
{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "afbeelding_wijzigen";
	frm_form.submit(); 
}

function jva_afbeelding_verwijderen(int_id)
{
	if (window.confirm("Weet u zeker dat u deze afbeelding wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "afbeelding_verwijderen";
	frm_form.int_id.value = int_id;
	frm_form.submit(); 
	}
}

function jva_offerte_verwijderen(int_id)
{
	if (window.confirm("Weet u zeker dat u dit offerte-onderdeel wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "offerte_verwijderen";
	frm_form.int_id.value = int_id;
	frm_form.submit(); 
	}
}

function jva_offerte_wijzigen()
{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "offerte_wijzigen";
	frm_form.submit(); 
}

function jva_offerte_aanvragen()
{
  var frm_form = document.frm_offerte;
  if (frm_form.naam.value == "") { alert("Vul uw naam in."); return false; }
  if (frm_form.adres.value == "") { alert("Vul uw adres in."); return false; }
  if (frm_form.postcode.value == "") { alert("Vul uw postcode in."); return false; }
  if (frm_form.plaatsnaam.value == "") { alert("Vul uw plaatsnaam in."); return false; }
  if (frm_form.telefoonnummer.value == "") { alert("Vul uw telefoonnummer in."); return false; }
  
  if (frm_form.nieuwbouw.checked == false && frm_form.renovatie.checked == false) 
  { 
  	alert("Maak een keuze tussen nieuwbouw en renovatie"); 
	return false; 
  }
  
  if (frm_form.standaard_dubbelglas.checked == false && frm_form.hr_dubbelglas.checked == false) 
  { 
  	alert("Maak een keuze tussen standaard dubbelglas en HR++ dubbelglas"); 
	return false; 
  }
  
  frm_form.kunststof.checked = true;
  
  frm_form.str_aanvraag.value = "aanvraag";
  frm_form.submit(); 
  window.alert("Bedankt voor uw aanvraag. Deze zal zo spoedig mogelijk worden verwerkt.");
}

function jva_offerte_aanvraag_verwijderen(klant_id)
{
	if (window.confirm("Weet u zeker dat u deze aanvraag wilt verwijderen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "offerte_aanvraag_verwijderen";
	frm_form.klant_id.value = klant_id;
	frm_form.submit(); 
	}
}

function jva_offerte_aanvraag_archief(klant_id)
{
	if (window.confirm("Weet u zeker dat u deze aanvraag naar het archief wilt verplaatsen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "offerte_aanvraag_archief";
	frm_form.klant_id.value = klant_id;
	frm_form.submit(); 
	}
}

function jva_offerte_aanvraag_uit_archief(klant_id)
{
	if (window.confirm("Weet u zeker dat u deze aanvraag uit het archief wilt halen?"))
	{
	var frm_form = document.frm_application;
	frm_form.bool_opslaan.value = "offerte_aanvraag_uit_archief";
	frm_form.klant_id.value = klant_id;
	frm_form.submit(); 
	}
}
