
/* - ++resource++Products.PDC.javascripts/pdc.js - */
// http://www.gezondreizen.nl/portal_javascripts/++resource++Products.PDC.javascripts/pdc.js?original=1
var pdc={initCentsToEuros: function(){jq(".datagridwidget-table-view td.prijs div").each( function(){cents=jq(this).html()
euros=parseInt(cents)/100;jq(this).html("&euro; "+euros.toFixed(2).replace('.',','))})},initTextCounters: function(){if(jq("form#pdcproduct-base-edit input#title").val()!=undefined){var maxTitleLength=max=jq("input#title").attr('maxlength');var titleCharsToGo=maxTitleLength-jq("input#title").val().length;jq("div#title_help").append('<span id="pn_counter"> ('+titleCharsToGo+' te gaan)</span>');var descrLen=jq("textarea#description").val().length;jq("div#description_help").append('<span id="descr_counter"> ('+descrLen+')</span>');jq("input#title").keyup(function(event){curlength=jq(this).val().length;jq("span#pn_counter").text(' ('+(maxTitleLength-curlength)+' te gaan)')})
jq("textarea#description").keyup(function(event){curlength=jq(this).val().length;jq("span#descr_counter").text(" ("+curlength+")")})
jq("textarea#text").keyup(function(event){curlength=jq(this).val().length;charstogo=maxTextLength-curlength;if(charstogo<0){jq("span#t_counter").addClass('toomanychars')} else{jq("span#t_counter").removeClass('toomanychars')}
jq("span#t_counter").text(' ('+(charstogo)+' te gaan)')})}},initPDC: function(){jq(".pdc-header .char").click(function(){jq(".pdc-header .selected").removeClass("selected");jq(this).toggleClass("selected")
jq(".pdc-products:visible").hide();jq(".pdc-products#part-"+jq(this).text()).show()});jq(".pdc-header .char").eq(0).click();jq("#archetypes-fieldname-kosten input").each(function(){var inputId=""+jq(this).attr("id");if(inputId.indexOf("ingangsdatum_kosten")===0){jq(this).datepicker({dateFormat:'dd-mm-yy'})} else if(inputId.indexOf("einddatum_kosten")===0){jq(this).datepicker({dateFormat:'dd-mm-yy'})}})}}
jq(document).ready(function(){pdc.initTextCounters();pdc.initCentsToEuros();pdc.initPDC()})


