/* File: js/score.custom.js, Ratio: 44.7% */

var geocoder;var directionsService;var directionsDisplay;var map;var scoreLoc;var start;var marker;function calcRoute(){var request={origin:start,destination:scoreLoc,region:'nl',travelMode:google.maps.DirectionsTravelMode.DRIVING};directionsService.route(request,function(response,status){if(status==google.maps.DirectionsStatus.OK){marker.setVisible(false);directionsDisplay.setDirections(response);$(".print").show();}else{var $dialog=$('<div></div>').html('Helaas kunnen we geen routebeschrijving geven voor uw locatie. Probeer aub een locatie in de buurt.').dialog({autoOpen:true,title:'Fout bij het maken van Routebeschrijving',draggable:false,resizable:false,buttons:{"Ok":function(){$(this).dialog("close");}}});}});}
$(document).ready(function(){$('#ContactRouteForm').submit(function(event){event.preventDefault();var startPC=$('#ContactPostcode').val();if(!startPC){var $dialog=$('<div></div>').html('U heeft geen adres ingevuld.').dialog({autoOpen:true,title:'Fout bij het maken van Routebeschrijving',draggable:false,resizable:false,buttons:{"Ok":function(){$(this).dialog("close");}}});}else{var location2=geocoder.geocode({address:startPC,region:'nl'},function(results,status){if(status==google.maps.GeocoderStatus.OK){start=results[0].geometry.location;calcRoute();}else{var $dialog=$('<div></div>').html('We hebben geen geldig adres kunnen localiseren. Probeer bijvoorbeeld alleen de straatnaam en de plaats in te voeren.').dialog({autoOpen:true,title:'Fout bij het maken van Routebeschrijving',draggable:false,resizable:false,buttons:{"Ok":function(){$(this).dialog("close");}}});}});}});$.supersized({slideshow:1,autoplay:1,start_slide:1,slide_interval:12000,transition:7,transition_speed:750,new_window:0,pause_hover:0,keyboard_nav:1,performance:1,min_width:0,min_height:0,vertical_center:1,horizontal_center:1,fit_portrait:0,fit_landscape:0,navigation:1,thumbnail_navigation:1,slide_counter:1,slide_captions:1,source:1,set:'72157626285329698',user:'60170158@N07',total_slides:100,image_size:'b',api_key:'d9b2479ef569ec32c8a566edd6751668'});$("a.gallery").colorbox();$("div.hitarea").click(function(event){if(event.target.tagName==="DIV"){$(this).find("a").first().click();}});$('#footerSlideContent').hide();$('#footerSlideButton').click(function(){$('#slidebutton').attr('src','/img/label_down.png');if($('#footerSlideContent').is(':visible')){$('#slidebutton').attr('src','/img/label_up.png');}
$('#footerSlideContent').slideToggle(300,function(){});});$('.project').addClass('project_js');$('.project_js').removeClass('project');$('.project_caption').addClass('project_caption_js');$('.project_caption_js').removeClass('project_caption');$('.project_holder').removeClass();$('.project_caption_js').each(function(index,value){$(value).parent().children('.project_js').append($(value));});$('.project_js').hover(function(){$(this).children(0).animate({bottom:'0px'},{queue:false,duration:500})},function(){$(this).children(0).animate({bottom:'-205px'},{queue:false,duration:500});});$('#slide_nav').show();$('a.contact').click(function(event){event.preventDefault();$('#slidebutton').click();});jQuery.isJson=function(str){if(jQuery.trim(str)=='')return false;str=str.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);}
$.fn.clearForm=function(){  return this.each(function(){    var type=this.type,tag=this.tagName.toLowerCase();    if(tag=='form')
      return $(':input',this).clearForm();    if(type=='text'||type=='password'||tag=='textarea')
      this.value='';    else if(type=='checkbox'||type=='radio')
      this.checked=false;    else if(tag=='select')
      this.selectedIndex=-1; });};jQuery.fn.mailform=function(form_data,form){$.ajax({method:'POST',url:'/contact/ajax',data:form_data,complete:function(data){var obj=jQuery.parseJSON(data.responseText);if(obj.succes){var $logout_dialog=$('<div></div>').html('Uw bericht is verstuurd, wij proberen zo snel mogelijk antwoord te geven.').dialog({autoOpen:true,title:'Formulier verstuurd',draggable:false,resizable:false,buttons:{"Ok":function(){$(this).dialog("close");}}});form.clearForm();form.find(':submit').show();}else{var string='';for(key in obj.data)
{string+=obj.data[key];string+='<br />';}
var $logout_dialog=$('<div></div>').html('Formulier is niet verstuurd omdat het fouten bevat:<br /><br />'+string).dialog({autoOpen:true,title:'Formulier bevat fouten',draggable:false,resizable:false,buttons:{"Ok":function(){$(this).dialog("close");}}});form.find(':submit').show();}}})}
$('#ContactForm').find(':submit').click(function(event){$('#ContactForm').find(':submit').hide();event.preventDefault();$(this).mailform($('#ContactForm').serialize(),$('#ContactForm'));});$('#ContactIndexForm').find(':submit').click(function(event){$('#ContactIndexForm').find(':submit').hide();event.preventDefault();$(this).mailform($('#ContactIndexForm').serialize(),$('#ContactIndexForm'));});})
