function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if(strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for(var iParam = 0; iParam < aQueryString.length; iParam++ ){
if(aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
return strReturn;
}
return false;
} 

function cancelKey(evt) {
if (evt.preventDefault) {
evt.preventDefault();
return false;
}else{
evt.keyCode = 0;
evt.returnValue = false;
}
}

function stopRKey(evt) {
var evt=(evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if(evt.keyCode == 13 && node.type!='textarea' && node.type!='text'){
return false;
}
}

function get_base_href(){
if(window.document.getElementsByTagName('BASE')){
aBase=window.document.getElementsByTagName('BASE');
for(i=0;i<aBase.length;i++){
if(aBase[i].href)
return aBase[i].href;
}
}
return '';
}

function setCookie(NameOfCookie, value, expiredays){
expiredays=2;
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
try {
myCookie=NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + ExpireDate.toGMTString())+ ";path=/" + "";
document.cookie = myCookie;
}
catch(e){
alert('Failed to set cookie: '+e.description+ ' ('+NameOfCookie+')');
}
}

function getCookie(NameOfCookie){
if(document.cookie.length > 0){ 
begin = document.cookie.indexOf(NameOfCookie+"="); 
if(begin != -1){ 
begin += NameOfCookie.length+1; 
end = document.cookie.indexOf(";", begin);
if(end == -1) 
end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); } 
}
return null; 
}

function delCookie(NameOfCookie){
if(getCookie(NameOfCookie)){
document.cookie = NameOfCookie + "=" +"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}

function checkCookie(){
Set_Cookie('test','none','','/','','');
if(!Get_Cookie('test')){
errorDialog.setTitle('');
errorDialog.doShow('');
}else{

}

}

function image_swap(id,image){
if(document.getElementById(id))
document.getElementById(id).src=image;
}

function CurrencyFormatted(a){var i=parseFloat(a);if(isNaN(i)){i=0.00;}var m='';if(i<0){m='-';}i=Math.abs(i);i=Math.round(i*1000)/1000;i=Math.round(i*100)/100;s=new String(i);if(s.indexOf('.')<0){s+='.00';}if(s.indexOf('.')==(s.length-2)){s+='0';}s=s.replace('.',',');n=s.indexOf(',');if(n>3&&n<6){return m+s.substr(0,(n-3))+'.'+s.substr((n-3));}return m+s;}
function IsNumeric(T){var V="0123456789.";var C;for(_i=0;_i<T.length;_i++){C=T.charAt(_i);if(V.indexOf(C)==-1){return false;}}return true;}
function inArray(s,a){_f=false;_k=new Array(false,0);if(a.length==0)return false;for(_i=0;_i<a.length;_i++){_v=a[_i].toString();if(_v==s){_f=true;_k[1]++;if(_k[0]===false)_k[0]=_i;}}if(_f===true)return _k;return false;}
function sortNumber(a,b){return a-b;}
function preload_image(href){image=new Image();image.src=href;}

errorDialog=function(){
this.prefix='<li>';
this.suffix='</li>';
this.selector='#errorDialog';
this.msg=null;
this.returnURL=false;
this.set=function(msg){
this.msg=msg;
$(this.selector+" .content").append(this.prefix+msg+this.suffix);
}
this.setTitle=function(Title){
$(this.selector+" h2").html(Title);
}
this.reset=function(){
$(this.selector+" .content").empty();
}
this.show=function(){
var _this=this
$(function(){
$(_this.selector+" .ui-dialog-content").css('height',$(_this.selector+" .content").height());
var buttons=[];
buttons.push( {text:"OK",click:function(){$(this).dialog("close");}} );
if(_this.returnURL!=false){
buttons.push( {text:"Terug",click:function(){document.location.href=_this.returnURL}} );
}
$(_this.selector).dialog({
closeOnEscape: true,
dialogClass: "classError",
draggable: false,
resizable: false,
width:475,
buttons:buttons,
position: 'top'
});

$(_this.selector).dialog("open");
$('.ui-dialog').css('position','absolute').center();
});
}
this.doShow=function(msg){
this.reset();
this.set(msg);
this.show();
}

}
var errorDialog=new errorDialog();

// AF20100312: try to parse a XMLHttpRequest into a DOM parser
// BF20111216: fixed, http://www.w3schools.com/dom/dom_parser.asp 
function XMLDOM(xmlRpc){
if(window.DOMParser){
  parser=new DOMParser();
  xmlDoc=parser.parseFromString(xmlRpc.responseText,"text/xml");
}else{ // Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(xmlRpc.responseText);
} 
// backward comp, we just need an object with the responseXML as xmldoc  
var rpc=new Object();
rpc.responseXML=xmlDoc;
return rpc;
}

// AF20100407: get scroll height 
function getScrollHeight() {
var scrollHeight,
offsetHeight;
// handle IE 6
if ($.browser.msie && $.browser.version < 7) {
scrollHeight = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
);
offsetHeight = Math.max(
document.documentElement.offsetHeight,
document.body.offsetHeight
);

if (scrollHeight < offsetHeight) {
return $(window).height();
} else {
return scrollHeight;
}
// handle "good" browsers
} else {
return $(document).height();
}
}

// mostly used for radio groups
var inputGroups={
items:[],
add:function(radio){
radio.data={};
this.items.push(radio);
},
set:function(name,property,value){
for(i=0;i<this.items.length;i++){
if(this.items[i].name==name){
this.items[i].data[property]=value;
}
}
},
get:function(name,property){
for(i=0;i<this.items.length;i++){
if(this.items[i].name==name && this.items[i].data[property]!==undefined){
return this.items[i].data[property];
}
}
return false;
}
}

// AF20100407: get scroll width
function getScrollWidth() {
var scrollWidth,
offsetWidth;
// handle IE 6
if ($.browser.msie && $.browser.version < 7) {
scrollWidth = Math.max(
document.documentElement.scrollWidth,
document.body.scrollWidth
);
offsetWidth = Math.max(
document.documentElement.offsetWidth,
document.body.offsetWidth
);

if (scrollWidth < offsetWidth) {
return $(window).width();
} else {
return scrollWidth;
}
// handle "good" browsers
} else {
return $(document).width();
}
}

function set_id_values(prefix,object){
if(typeof(object)=='object'){
for(key in object){
if(document.getElementById(prefix+key)){
document.getElementById(prefix+key).innerHTML=object[key];
}
}
}
}

function set_form_values(id,object){
if(document.getElementById(id) && typeof(object)=='object'){
form=document.getElementById(id);
for(key in object){
if(form.elements[key]){
form.elements[key].value=object[key];
}
}
}
}
function getUrlVars(){var a=[],hash;var b=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i<b.length;i++){hash=b[i].split('=');a.push(hash[0]);a[hash[0]]=hash[1]}return a}
function fieldOnFocus(element){if(element.value==element.defaultValue){element.value='';}}
function fieldOnBlur(element){if(element.value==''){element.value=element.defaultValue;}}
function array_key_exists(a,b){if(!b||(b.constructor!==Array&&b.constructor!==Object)){return false}return a in b}
function urldecode(a){return decodeURIComponent((a+'').replace(/\+/g,'%20'))}
function implode(g,p){var i,r,G='';if(arguments.length===1){p=g;g='';}if(typeof(p)==='object'){if(p instanceof Array){return p.join(g);}else{for(i in p){r+=G+p[i];G=g;}return r;}}else{return p;}}

/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */
(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'style/images/jquery/lightbox/lightbox-ico-loading.gif',imageBtnPrev:'style/images/jquery/lightbox/lightbox-btn-prev.gif',imageBtnNext:'style/images/jquery/lightbox/lightbox-btn-next.gif',imageBtnClose:'style/images/jquery/lightbox/lightbox-btn-close.gif',imageBlank:'style/images/jquery/lightbox/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);
$(function(){
$.fn.center=function(){
H=$(this).height();
W=$(this).width();
wT=$(document).scrollTop();
wL=$(document).scrollLeft();
wH=$(window).height();
wW=$(window).width();
if(wH <= H){
$(this).css('top',wT+'px');
}else{
$(this).css('top',Math.max((wH-H)/2 + wT)+'px');
}
if(wW <= W ){
$(this).css('left',wL+'px');
}else{
$(this).css('left',Math.max((wW-W)/2 + wL)+'px');
}
return this;
}

$.fn.hoverImage=function(i,j){$(this).hover(function(){this.src=i;},function(){this.src=j;});return this;}
$('a.navigation-item').each(function(){
$(this).hover(
function(){
src=$(this).children('img').attr('src');
if(src)
$(this).children('img').attr('src',src.substr(0,src.length-4)+'_active.gif');
}, 
function(){
src=$(this).children('img').attr('src');
if(src)
$(this).children('img').attr('src',src.substr(0,src.length-11)+'.gif');
}
);
});
$('a.navigation-item-active').each(function(){
$(this).hover(
function(){
src=$(this).children('img').attr('src');
if(src)
$(this).children('img').attr('src',src.substr(0,src.length-11)+'.gif');
}, 
function(){
src=$(this).children('img').attr('src');
if(src)
$(this).children('img').attr('src',src.substr(0,src.length-4)+'_active.gif');
}
);
});
$('li.navigation-left-item').each(function(){
$(this).hover(
function(){
$(this).css('background-image','url(style/images/bg_navigation_left_active.gif)');
}, 
function(){
$(this).css('background-image','url(style/images/bg_navigation_left.gif)');
}
);
})

$('#quick-search input-image').click(function(){
document.forms.quick_find.submit();
});
$('#quick-login-button').hoverImage('style/images/button_login_active.jpg','style/images/button_login.jpg').click(function(){
this.form.submit();
});
$('.ui-dialog').center();
$('div.categorie').each(function(){
$(this).hover(
function(){$(this).children('div.category-description').slideDown(200); },
function(){$(this).children('div.category-description').fadeOut(100);}
);
})

/*
$('#shoppingcart_box_img').hover(
function(){
this.src='style/images/bestelknop-active.gif';
},
function(){
this.src='style/images/bestelknop-passive.gif';
}
);
*/

//AF20101105 Added tabbed slider for productpage
//BC20110113 onClick behaviour
/* http://www.gayadesign.com/diy/animated-tabbed-content-with-jquery/ */
var TabbedContent = {
active: 1,
init: function() {
var me=this;
$("span.sld_tab_item").click(function() {
if (me.active !=  $(this).index()){
me.active = $(this).index();
$("div.sld_moving_bg").stop().animate({
left: $(this).position()['left']
}, {
duration: 250
});

TabbedContent.slideContent((me.active-1));

}
});
},
slideContent: function(tab) {
var numMargin = $("div.sld_slide_content").width() * (tab+1);
$("div.sld_tabslider").children().hide().eq(tab).css({'margin-left':numMargin}).show();
numMargin = numMargin * -1;
numHeight =$("div.sld_tabslider").children().eq(tab).height();
$("div.sld_tabslider").stop().animate({
marginLeft: numMargin + "px",
height: numHeight + "px"
}, {
duration: 250
});

}
}
TabbedContent.init();
$('#hvrbtn_lft_afrekenen').hoverImage('images/buttons/dutch/btn_afrekenen_act_trans.png','images/buttons/dutch/btn_afrekenen_trans.png');
$('#hvrbtn_afrekenen').hoverImage('images/buttons/dutch/btn_afrekenen_act_trans.png','images/buttons/dutch/btn_afrekenen_trans.png');
$('#hvrbtn_lft_offerte').hoverImage('images/buttons/dutch/btn_offerte_act_trans.png','images/buttons/dutch/btn_offerte_trans.png');
$('#hvrbtn_fact_opslaan').hoverImage('images/buttons/dutch/btn_opslaan_act_trans.png','images/buttons/dutch/btn_opslaan_trans.png');
$('#hvrbtn_verz_opslaan').hoverImage('images/buttons/dutch/btn_opslaan_act_trans.png','images/buttons/dutch/btn_opslaan_trans.png');
$('#hvrbtn_fact_annuleren').hoverImage('images/buttons/dutch/btn_annuleren_act_trans.png','images/buttons/dutch/btn_annuleren_trans.png');
$('#hvrbtn_verz_annuleren').hoverImage('images/buttons/dutch/btn_annuleren_act_trans.png','images/buttons/dutch/btn_annuleren_trans.png');
$('#couponValidate').hoverImage('style/images/shop/buttons/dutch/btn_voucherinleveren_act_trans.png','style/images/shop/buttons/dutch/btn_voucherinleveren_trans.png');
$('#hvrbtn_offerteaanvragen').hoverImage('images/buttons/dutch/btn_offerteaanvragen_act_trans.png','images/buttons/dutch/btn_offerteaanvragen_trans.png');
$('#hvrbtn_fact_adresboek').hoverImage('images/buttons/dutch/btn_adresboek_act_trans.png','images/buttons/dutch/btn_adresboek_trans.png');
$('#hvrbtn_verz_adresboek').hoverImage('images/buttons/dutch/btn_adresboek_act_trans.png','images/buttons/dutch/btn_adresboek_trans.png');
$('#hvrbtn_fact_wijzigen').hoverImage('images/buttons/dutch/btn_wijzigen_act_trans.png','images/buttons/dutch/btn_wijzigen_trans.png');
$('#hvrbtn_verz_wijzigen').hoverImage('images/buttons/dutch/btn_wijzigen_act_trans.png','images/buttons/dutch/btn_wijzigen_trans.png');
$('#hvrbtn_toevoegen').hoverImage('images/buttons/dutch/btn_toevoegen_act_trans.png','images/buttons/dutch/btn_toevoegen_trans.png');
$('#hvrbtn_inschrijven').hoverImage('images/buttons/dutch/btn_inschrijven_act_trans.png','images/buttons/dutch/btn_inschrijven_trans.png');
$('#hvrbtn_terug').hoverImage('style/images/shop/buttons/dutch/btn_terug_act_trans.png','style/images/shop/buttons/dutch/btn_terug_trans.png');
$('#hvrbtn_verder').hoverImage('style/images/shop/buttons/dutch/btn_verder_act_trans.png','style/images/shop/buttons/dutch/btn_verder_trans.png');
$('#hvrbtn_zoeken').hoverImage('style/images/shop/buttons/dutch/btn_zoeken_act_trans.png','style/images/shop/buttons/dutch/btn_zoeken_trans.png');
$('#hvrbtn_bevestigen').hoverImage('style/images/shop/buttons/dutch/btn_bevestigen_act_trans.png','style/images/shop/buttons/dutch/btn_bevestigen_trans.png');
$('#hvrbtn_registreren').hoverImage('style/images/shop/buttons/dutch/btn_registreren_act_trans.png','style/images/shop/buttons/dutch/btn_registreren_trans.png');
$('#hvrbtn_verderwinkelen').hoverImage('style/images/shop/buttons/dutch/btn_verderwinkelen_act_trans.png','style/images/shop/buttons/dutch/btn_verderwinkelen_trans.png');
$('#hvrbtn_klantgegevenswijzigen').hoverImage('style/images/shop/buttons/dutch/btn_klantgegevenswijzigen_act_trans.png','style/images/shop/buttons/dutch/btn_klantgegevenswijzigen_trans.png');
$('#hvrbtn_wachtwoordwijzigen').hoverImage('style/images/shop/buttons/dutch/btn_wachtwoordwijzigen_act_trans.png','style/images/shop/buttons/dutch/btn_wachtwoordwijzigen_trans.png');
$('#hvrbtn_adresboek').hoverImage('images/buttons/dutch/btn_adresboek_act_trans.png','images/buttons/dutch/btn_adresboek_trans.png');
$('#hvrbtn_wijzigen').hoverImage('images/buttons/dutch/btn_wijzigen_act_trans.png','images/buttons/dutch/btn_wijzigen_trans.png');
$('#hvrbtn_offerteverwijderen').hoverImage('images/buttons/dutch/btn_offerteverwijderen_act_trans.png','images/buttons/dutch/btn_offerteverwijderen_trans.png');
$('#hvrbtn_offerteverwijderen').hoverImage('images/buttons/dutch/btn_offerteverwijderen_act_trans.png','images/buttons/dutch/btn_offerteverwijderen_trans.png');



if( $('td.messageStackError').length >0){
var table=$('td.messageStackError').parent().parent();
$('td.messageStackError').each(function(){
$("div#errorDialog ul.content").append('<li>'+$(this).html()+'</li>');
});
errorDialog.show();
$(table).empty().css({'display':'none'});
}
/*if( $('div.osc_error_msg').length>0 ){
$('div.osc_error_msg td').each(function(){
$("div#errorDialog ul.content").append('<li>'+$(this).html()+'</li>');
});
errorDialog.show();
$('div.osc_error_msg').empty();
}
*/
$('a.product_image').lightBox({containerResizeSpeed:100});

$('.attribute').each(function(){
switch(this.type){
case 'select-one':
var value=parseFloat(attributes[this.id.substr(9)][this.value]);
if(value!==0){
$(this).attr('data',value);
}
$(this).change(function(){
value=parseFloat(attributes[this.id.substr(9)][this.value]);
if($(this).attr('data')!==undefined){
basePrice=parseFloat(basePrice)-( parseFloat($(this).attr('data')) *  document.cart_quantity.cart_quantity.value);
}
$(this).attr('data',value);
basePrice=parseFloat(basePrice)+( parseFloat(value) * document.cart_quantity.cart_quantity.value);
$("#price").html("&euro; "+CurrencyFormatted(basePrice));
});
break;
case 'checkbox':
$(this).click(function(a){
if($(this).attr('checked')==false){
basePrice=basePrice-( parseFloat(attributes[this.id.substr(9)][this.value]) * document.cart_quantity.cart_quantity.value);
}else{
basePrice=basePrice+( parseFloat(attributes[this.id.substr(9)][this.value]) * document.cart_quantity.cart_quantity.value);
}
$("#price").html("&euro; "+CurrencyFormatted(basePrice));
});
break;
case 'radio':
var value=parseFloat(attributes[this.id.substr(9)][this.value]);
inputGroups.add(this);
if(this.checked==true){
inputGroups.set(this.name,'price',value);
}
$(this).click(function(){
$('.license_reset').trigger('click');
this.checked=true;
var value=parseFloat(attributes[this.id.substr(9)][this.value]);
previousPrice=inputGroups.get(this.name,'price');
if(previousPrice!==false){
basePrice=parseFloat(basePrice) - parseFloat(previousPrice * document.cart_quantity.cart_quantity.value) + parseFloat(value * document.cart_quantity.cart_quantity.value);
}else{
basePrice=parseFloat(basePrice) + parseFloat(value * document.cart_quantity.cart_quantity.value );
}
inputGroups.set(this.name,'price',value);
$("#price").html("&euro; "+CurrencyFormatted(basePrice));
});
break;
}
});
$('input.product_quantity').each(function(){
basePrice=basePrice*$(this).val();
$("#price").html("&euro; "+CurrencyFormatted(basePrice));
}).change(function(){
basePrice=basePrice/product_quantity;
basePrice=basePrice*$(this).val();
product_quantity=$(this).val();
$("#price").html("&euro; "+CurrencyFormatted(basePrice));
});
$("form#productInfoAdd :input").each(function(){
if(this.type=='select-one'){
//TODO 
//if($(this).text()=="Maak hier uw keuze.."){
//console.log($(this).text());
//}
}
});

// AF20110921: add field info to forms based on url
var params=getUrlVars();
$('form.dynamicForm :input').each(function(){
name='field'+$(this).attr('name');
if(array_key_exists(name,params)){
this.value=urldecode(params[name]);
}
})

})

