/* Copyright (c) 2005 - 2009 Dacon, http://www.dacon.nl */$(function () {$(function() {var tabs = $('#tabs').tabs();tabs.tabs( 'rotate' , 6000 , true );$('#tablist').prepend('<li id="fragment-prev"><\/li>');$('#tablist').append('<li id="fragment-next"><\/li>');$('#fragment-prev').click(function() { prev = (tabs.tabs('option', 'selected') > 0) ? (tabs.tabs('option', 'selected')-1) : ($(".ui-tabs-panel").size()-1);tabs.tabs( 'rotate' , 0);tabs.tabs('select', prev );return false;});$('#fragment-next').click(function() { prev = (tabs.tabs('option', 'selected') < ($(".ui-tabs-panel").size()-1)) ? (tabs.tabs('option', 'selected')+1) : 0;tabs.tabs( 'rotate' , 0);tabs.tabs('select', prev );return false;});$('.fragment').click(function() {tabs.tabs( 'rotate' , 0);});});$('#telefoon_wrapper').children().hide();var shown_tel = false;$('#telefoon_img').click(function(){if(shown_tel == false){$('#telefoon_box').show();$('#telefoon_wrapper').show(); $('#telefoon_box').animate({width:"120px"},'slow','swing',function(){$('#telefoon_wrapper').children().fadeIn('fast',function(){shown_tel = true;});});}else{$('#telefoon_wrapper').children().fadeOut('fast',function(){$('#telefoon_wrapper').hide();$('#telefoon_box').animate({width:'0px'},'slow','swing',function(){ $('#telefoon_wrapper').children().hide();$('#telefoon_box').hide(); shown_tel = false}); });}});setButtons();$("#menu").children("ul").children("li").children("a").children("img:not(.active)").each(function(){$(this).mouseover(function(){new_src = $(this).attr("src").replace(".png","_hover.png");$(this).attr("src",new_src);});$(this).mouseout(function(){new_src = $(this).attr("src").replace("_hover.png",".png");$(this).attr("src",new_src);});});setClearImput();$("a.group").fancybox({'hideOnContentClick': false,'zoomOpacity': true,'overlayShow': true,'zoomSpeedIn': 500,'zoomSpeedOut': 500});$(".portfolio_element").children("a").children("img").mouseover(function(){ $(this).animate({opacity:'1'});});$(".portfolio_element").children("a").children("img").mouseout(function(){$(this).animate({opacity:'0.5'});});$(".referentie_element").children("a").children("img").mouseover(function(){ $(this).animate({opacity:'1'});});$(".referentie_element").children("a").children("img").mouseout(function(){$(this).animate({opacity:'0.5'});});$('#dialog').dialog({autoOpen: false,title: 'Oeps!',draggable: false,modal: true});$("#scroller_holder").daconScroller({speed:4000,default_margin:0});$("#accordion").accordion({ autoHeight: false,active: false });updateSkypeStatus(); });function replaceT(obj){var newO=document.createElement('input');newO.setAttribute('type','password');newO.setAttribute('name',obj.getAttribute('name'));obj.parentNode.replaceChild(newO,obj);newO.focus();}function showAlert(text){$('#dialog').text(text);$('#dialog').dialog( 'open' );}function setButtons(){$('#btnBelme').children("img").click(function(){belme();});$('#btnGo').children("img").click(function(){checkdomain();});$('#btnAanmelden').children("img").click(function(){nieuwsbrief();});$('#btnStarten').children("img").click(function(){$(this).parents('form').submit();});$('#btnContact').children("img").click(function(){$(this).parents('form').submit();});}function setClearImput(){$('.autoClear').each(function(){$(this).click(function(){if($(this).attr('value') == $(this).attr('alt')){ $(this).attr('value',''); $(this).focus() }});$(this).blur(function(){if($(this).attr('value') == ''){ $(this).attr('value',$(this).attr('alt'));}});});}var trobler = '<img src="inc/img/ajax-loader.gif" alt="" />';var trobler2 = '<img src="inc/img/ajax-loader2.gif" alt="" />';var belme_content = "";var belme_btn= "";var checkdomain_content = "";var nieuwsbrief_content= "";var nieuwsbrief_btn= "";var webmail_content = "";var option_url= "";var option_ext= "";function belme(){ form_challenge = $('#frmBelterug').attr('action');form_name = 'callback';option_name = $('#frmBelterug').find('input[name=naam]').val();option_tel = $('#frmBelterug').find('input[name=telefoon]').val();var oTelNr=new TelNr(option_tel); if(option_name == "" || option_name == $('#frmBelterug').find('input[name=naam]').attr('alt') ||option_tel == "" || option_tel == $('#frmBelterug').find('input[name=telefoon]').attr('alt')){showAlert('Ontbrekende naam en/of telefoonnummer');}else if(!oTelNr.validated){showAlert('Ongeldig telefoonnummer: '+oTelNr.error);}else{belme_content = $('#telefoon_wrapper').children('p').html();$('#telefoon_wrapper').children('p').html(trobler2);$('#btnBelme').hide();$.post("ajax.php",{form:form_name, response:form_challenge, name:option_name, tel:oTelNr.toString('KG')+oTelNr.toString('NR')},function(data){setBelme(data)}, "json");}} function setBelme(data){switch(data.nr){case 1:$('#telefoon_wrapper').children('p').html("Wij nemen zo<br /> spoedig mogelijk<br /> contact met u op");break;default:showAlert('Er ging iets mis bij het versturen van de gegevens\r\n`'+data.message+'`');$('#telefoon_wrapper').children('p').html(belme_content);$('#btnBelme').show();break;}}function checkdomain(){form_challenge = $('#frmDomeincheck').attr('action');form_name = 'domaincheck';option_url= $('#frmDomeincheck').find('input[name=url]').val();option_ext= $('#frmDomeincheck').find('select[name=extention]').val();if(option_url == "" || option_url == $('#frmDomeincheck').find('input[name=url]').attr('alt')){showAlert('U dient een domeinnaam op te geven!');}else if(!isUrl(option_url+option_ext)){showAlert('De opgegeven domeinnaam is niet geldig!');}else{checkdomain_content = $('#block1').html();$('#block1').html(trobler);$.post("ajax.php",{form:form_name, response:form_challenge, get_url:option_url+option_ext},function(data){setCheckDomain(data);}, "json");}} function setCheckDomain(data){switch(data.nr){case 1:break;case -3:showAlert('Het domein `'+option_url+option_ext+'` is reeds geregistreerd!');$('#block1').html(checkdomain_content);setButtons();setClearImput();break;default:showAlert('Er ging iets mis bij het versturen van de gegevens\r\n`'+data.message+'`');$('#block1').html(checkdomain_content);setButtons();setClearImput();break;}}function isUrl(theUrl){if(theUrl.indexOf('http://') != 0){theUrl = "http://"+theUrl;}if (theUrl.match(/^(http)\:\/\/[a-z0-9]+([\-][a-z0-9]+)*\.[co\.]*[a-z]{2,6}$/i)) {return true;}}function nieuwsbrief(){form_challenge = $('#frmNieuwsbrief').attr('action');form_name = 'newsletter';option_email = $('#frmNieuwsbrief').find('input[name=email]').val();if(option_email == "" || option_email == $('#frmNieuwsbrief').find('input[name=email]').attr('alt')){showAlert('U dient een e-mailadres op te geven');}else if(!isEmail(option_email)){showAlert('U dient een geldig e-mailadres op te geven');}else{nieuwsbrief_content = $('#frmNieuwsbrief').children('p').html();$('#frmNieuwsbrief').children('p').html(trobler);$('#frmNieuwsbrief').find('input[name=email]').hide();$('#btnAanmelden').hide();$.post("ajax.php",{form:form_name, response:form_challenge, email:option_email},function(data){setNieuswbrief(data);}, "json");}}function setNieuswbrief(data){switch(data.nr){case 1:$('#btnAanmelden').hide();$('#frmNieuwsbrief').append('<p style="color:white; padding-left:3px;">U bent aangemeld voor onze nieuwsbrief!</p>');break;default:showAlert('Er ging iets mis bij het versturen van de gegevens\r\n`'+data.message+'`');$('#frmNieuwsbrief').children('p').html(nieuwsbrief_content);$('#frmNieuwsbrief').find('input[name=email]').show();$('#btnAanmelden').show();break;}}function isEmail(str){var at="@";var dot=".";var lat=str.indexOf(at);var lstr=str.length;var ldot=str.indexOf(dot);if (str.indexOf(at)==-1){ return false;}if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false;}if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){return false;} if (str.indexOf(at,(lat+1))!=-1){return false; } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false; } if (str.indexOf(dot,(lat+2))==-1){return false; } if (str.indexOf(" ")!=-1){return false; }return true;} function set_particulier_bedrijf(obj){if(obj.options[obj.selectedIndex].value == 'bedrijf'){$('#comp').css('display','inline');$('#part').css('display','none');}else{$('#comp').css('display','none');$('#part').css('display','inline');}}function set_contact(obj){if (obj.options[obj.selectedIndex].value == 'telefoon') {$('#tel').css('display','inline');$('#post').css('display','none');}else{$('#tel').css('display','none');$('#post').css('display','inline');}}var skypeGroupsTypes = { 0:'web', 1:'it' };function updateSkypeStatus(){for(type in skypeGroupsTypes){getSkypeStatus(skypeGroupsTypes[type]);}}function getSkypeStatus(skypeGroupType){$.ajax({success: function(data, textStatus, XMLHttpRequest){ status = data.status;if(status !== 'offline'){$('#status-' + skypeGroupType).append('<a href="skype:'+status+'?chat&amp;topic='+skypeGroupType+'" title="Start chat"><img src="inc/img/skype/'+skypeGroupType+'-online.png" alt="Online" /></a>');}else{$('#status-' + skypeGroupType).append('<img src="inc/img/skype/'+skypeGroupType+'-offline.png" alt="Offline" />');}},error: function(data, textStatus, XMLHttpRequest){ $('#status-' + skypeGroupType).append('<img src="inc/img/skype/'+skypeGroupType+'-offline.png" alt="Offline" />');},url: 'getSkypeStatus.php',dataType: 'json', type:'get',data: { 'skypeGroupType': skypeGroupType }});}