/*aanpassen bij live gaan!*/
var url = "http://www.airvisie.nl/website/";

var myimages=new Array()
	function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
	myimages[i]=new Image()
	myimages[i].src=preloadimages.arguments[i]
	}
}

//preloaden images zodat dat geflikker weg blijft
preloadimages(
url+"img/b_particulier.gif",
url+"img/b_particulier_o.gif",
url+"img/b_zakelijk.gif",
url+"img/b_zakelijk_o.gif",
url+"img/buttons_quickmenu_nl.gif",
url+"img/buttons_quickmenu_nl_o.gif",
url+"img/buttons_quickmenu_service.gif",
url+"img/buttons_quickmenu_service_o.gif",
url+"img/buttons_quickmenu_air.gif",
url+"img/buttons_quickmenu_air_o.gif",
url+"img/buttons_quickmenu_bel.gif",
url+"img/buttons_quickmenu_bel_o.gif",
url+"img/buttons_quickmenu_nl_s.gif",
url+"img/buttons_quickmenu_nl_o_s.gif",
url+"img/buttons_quickmenu_service_s.gif",
url+"img/buttons_quickmenu_service_o_s.gif",
url+"img/buttons_quickmenu_air_s.gif",
url+"img/buttons_quickmenu_air_o_s.gif",
url+"img/buttons_quickmenu_bel_s.gif",
url+"img/buttons_quickmenu_bel_o_s.gif",
url+"img/stap1.png",
url+"img/stap2.png",
url+"img/stap3.png",
url+"img/stap4.png",
url+"img/stap5.png",
url+"img/stap1_disabled.png",
url+"img/stap2_disabled.png",
url+"img/stap3_disabled.png",
url+"img/stap4_disabled.png",
url+"img/stap5_disabled.png",
url+"img/z_kantoor.gif",
url+"img/z_kantoor_o.gif",
url+"img/z_retail.gif",
url+"img/z_retail_o.gif",
url+"img/z_server.gif",
url+"img/z_server_o.gif",
url+"img/bottommenu.jpg",
url+"img/product_selector_bg.png"
);


function geturl(addr) {   
 var r = $.ajax({   
  type: 'GET',   
  url: addr,
  async: false
 }).responseText;   
 return r;   
}   

function ProductSelector(stap,keuze,id)
{
	url = "./productselector.handler.php?stap="+stap+"&keuze="+keuze+"&id="+id+"&rnd="+Math.random();
	
	 $('#productselector').hide();
	 $('#productselector').html(geturl(url)).show("slow");   
}

function GoToStap(stap,id)
{
	url = "./productselector.stephandler.php?stap="+stap+"&id="+id+"&rnd="+Math.random();
	
	 $('#productselector').hide();
	 $('#productselector').html(geturl(url)).show("slow");   
}

function checkInfoAanvraag(){
	
	if(
		document.getElementById('naam').value.length>1 &&
		document.getElementById('adres').value.length>1 &&
		document.getElementById('postcode_n').value.length>1 &&
		document.getElementById('woonplaats').value.length>1 &&
		document.getElementById('telefoon').value.length>1 &&
		document.getElementById('email').value.length>1)
		{
			return true;	
		} else {
			return false;
		}
}

function procesareForm()
{
	if(checkInfoAanvraag()==true){
	
	var post = $("#informatieaanvraag").serialize();

		$.post("productselector.post.php",
        post, 
        function(result) { 
//            $('#formSubmit').hide();
        	$('#formSubmit').html('<b>Bedankt</b> voor uw informatie aanvraag, wij nemen zo spoedig mogelijk contact met u op!').show("slow");
        	
        });
        return true;
	} else {
		
		alert('Vul alle velden met een * in.');
		return false;
	}
}

function submitStoring()
{
	if(
		document.getElementById('naam').value >"" &&
		document.getElementById('adres').value >"" &&
		document.getElementById('plaats').value >"" &&
		document.getElementById('email').value >"" &&
		document.getElementById('telefoon').value >""
	) {
		
		document.getElementById('frmStoring').submit();
	} else {
		
		alert('Vul a.u.b alle velden gemarkeerd met een * in.');
		return false;	
	}
}

function submitContact()
{
	if(
		document.getElementById('naam').value >"" &&
		document.getElementById('email').value >"" &&
		document.getElementById('bericht').value >"" 
	) {
		document.getElementById('frmContact').submit();
	} else {
		
		alert('Vul a.u.b alle velden gemarkeerd met een * in.');
		return false;
	}
}
