var gaNaarWinkelmand=false;


try{toonZoekBalk();}catch(err){}
try{toonWinkelwagen();}catch(err){}



function berekenPakket()
{
 var Bedrag=0;
 var Totaal=0;
 for(i=1;i<5;i++)
 {
  if(document.getElementById("rdGarantie_"+i))
  {
  try{
   Bedrag=Bedrag+parseFloat(document.getElementById("txtBevGarantie_"+i+"_"+getRadioValue("rdGarantie_"+i) ).value );
   }catch(err){}
  }
 
 }
 
 Totaal=document.getElementById("txtBevPakketPrijs").value;
 document.getElementById("spBevPakketPrijs").innerHTML=parseFloat(Bedrag)+parseFloat(Totaal);
 document.getElementById("spBevPakketPrijs").innerHTML=document.getElementById("spBevPakketPrijs").innerHTML.replace(".",",")
 
 Totaal=document.getElementById("txtBevTotalePrijs").value;
 document.getElementById("spBevTotalePrijs").innerHTML=parseFloat(Bedrag)+parseFloat(Totaal);
 document.getElementById("spBevTotalePrijs").innerHTML=document.getElementById("spBevTotalePrijs").innerHTML.replace(".",",")
}

function addPakket(pakketId)
{   var garantie="";
	
	 
	for(i=1;i<5;i++)
    {
	   if(document.getElementById("rdGarantie_"+i))
  	   {
		 garantie=garantie+getRadioValue("rdGarantie_"+i)+"/";
	   }
	}
	
	var url="/shop/pakkettoevoeg.asp?pakketId="+pakketId+"&garantie="+garantie;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest)
		  {
			  try{ $('dvWinkelwagen').innerHTML = originalRequest.responseText;}catch(err){} 
			  if(gaNaarWinkelmand==true)
			  {location.href='/shop/webshop.asp?pagina=mijnwinkelwagen.asp';}
		  }
	});
}

function addCross(productId,crossId)
{
	var varGarantie=0;
	var variatieId=0;
	var intAantal=1;
	if($("rdGarantie")!=null)
	{
		varGarantie=getRadioValue("rdGarantie")
	}
	var url="/shop/protoevoeg.asp?variatieId="+variatieId+"&garantie="+varGarantie+"&aantal="+intAantal+"&productId="+productId+"&crossId="+crossId;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  try{ $('dvWinkelwagen').innerHTML = originalRequest.responseText;}catch(err){}
		  if(gaNaarWinkelmand==true)
		  {location.href='/shop/webshop.asp?pagina=mijnwinkelwagen.asp';}
	      }
	 });
}

function shopInfo(shopId)
{
	
	cmdCommand='fSingleGoogleMap();';
	fOverlay2();
	$('overlayinhoud').style.position="relative";
	 $('overlayinhoud').style.top=getScrollHeight()+'px';
	PaginaLaden('shopInfo2.asp?shopId='+shopId,'overlayinhoud');
}

function addToFavorites(productId)
{
	var url="shopfavoriettoevoegen.asp?productId="+productId;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  //try{ $('$$winkelwagen$$').innerHTML = originalRequest.responseText;}catch(err){}
		  try{verlanglijstUpgedate();
		  }catch(err){}
		  //}catch(err){}
	      }
	 });
}

function naToevoegenWinkelwagen(productId)
{
gaNaarWinkelmand=true;
addToShoppingCart(productId);
//location.href='webshop.asp?pagina=mijnwinkelwagen.asp';
}

function naToevoegenWinkelwagen2(productId)
{
gaNaarWinkelmand=true;
addToShoppingCart2(productId);
//location.href='webshop.asp?pagina=mijnwinkelwagen.asp';
}

function naToevoegenWinkelwagenPakket(pakketId)
{
gaNaarWinkelmand=true;
addPakket(pakketId);
}

function naToevoegenWinkelwagenCross(productId,crossId)
{
gaNaarWinkelmand=true;
addCross(productId,crossId);
location.href='/shop/webshop.asp?pagina=mijnwinkelwagen.asp';
}

function pakkettBev(pakketId2)
{
	if( $('overlay').style.visibility!='visible')
	{fOverlay2();
		  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
	}
	$('overlayinhoud').style.width="400px";
	$('overlayinhoud').style.height="500px";
	var url="/shop/naToevoegenkeuze.asp?pakketId="+pakketId2;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		method: 'post',
		onComplete: function(originalRequest){

		$('overlayinhoud').innerHTML = originalRequest.responseText;
		$('overlayinhoud').style.position="relative";
	    $('overlayinhoud').style.top=getScrollHeight()+'px';
		//fScaleImage("imgNakeuzeToevoegen",150,150);
		}
	});
}


function crossBev(crossRegel,productId)
{
	if( $('overlay').style.visibility!='visible')
	{fOverlay2();
			  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
	}
	$('overlayinhoud').style.width="400px";
	$('overlayinhoud').style.height="500px";
	var url="/shop/naToevoegenkeuze.asp?productId="+productId+"&crossrule="+crossRegel;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		method: 'post',
		onComplete: function(originalRequest){
		$('overlayinhoud').innerHTML = originalRequest.responseText;
		fScaleImage("imgNakeuzeToevoegen",150,150);
		}
	});
}


function productBev(productId2)
{
	var varPromoId="";
	if( $("txtPromoCode")!=null){varPromoId=$("txtPromoCode").value;}
	
	if( $('overlay').style.visibility!='visible')
	{fOverlay2();
			  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
	}
	$('overlayinhoud').style.width="400px";
	$('overlayinhoud').style.height="500px";
	var url="/shop/naToevoegenkeuze.asp?promoCode="+varPromoId+"&productId="+productId2;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		method: 'post',
		onComplete: function(originalRequest){
		$('overlayinhoud').innerHTML = originalRequest.responseText;
		//fScaleImage("imgNakeuzeToevoegen",150,150);
		}
	});
}

function winkelwagenUpgedate(productId2)
{
	/*fOverlay();
	$('overlayinhoud').style.width="400px";
	$('overlayinhoud').style.height="200px";
	fOverlay();

	var url="naToevoegenkeuze.asp?productId="+productId2;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		method: 'post',
		onComplete: function(originalRequest){
		$('overlayinhoud').innerHTML = originalRequest.responseText;
		}
	});*/
}

function addToShoppingCart(productId)
{	
	var intAantal=0;
	var variatieId;
	var varGarantie=0;
	var varPromoCode="";
	
	if($("txtAantalProducten"+productId)==null){intAantal=1}
	else{intAantal=$("txtAantalProducten"+productId).value}
    
	if($("rdGarantie")!=null)
	{
		varGarantie=getRadioValue("rdGarantie")
	}
	
	if($("txtPromoCode")!=null)
	{
		varPromoCode=$("txtPromoCode").value;
	}
	
	if($("txtVariatieId"+productId)==null)
	{
	         variatieId="1";
	}
	else
	{
	 	if($("txtVariatieId"+productId).type=="radio")
		{
			 variatieId=getRadioValue("txtVariatieId");
		}
		else
		{
			variatieId=$("txtVariatieId"+productId).value;
		}
	}
	
    var url="/shop/protoevoeg.asp?variatieId="+variatieId+"&promocode="+varPromoCode+"&garantie="+varGarantie+"&aantal="+intAantal+"&productId="+productId;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  try{ $('dvWinkelwagen').innerHTML = originalRequest.responseText;}catch(err){}
		  if(gaNaarWinkelmand==true)
		  {
			  gaNaarWinkelmand=false;
			  location.href='/shop/webshop.asp?pagina=mijnwinkelwagen.asp';}
		  //winkelwagenUpgedate(productId);
		  //try{winkelwagenUpgedate();}catch(err){location.href="../shop/webshop.asp?pagina=mijnwinkelwagen.asp"}
	      }
	 });
}

function addToShoppingCart2(productId)
{	
	var intAantal=0;
	var variatieId;
	var varGarantie=0;
	var varPromoCode="";
	
	if($("txtAantalProducten"+productId)==null){intAantal=1}
	else{intAantal=$("txtAantalProducten"+productId).value}
    
	if($("rdGarantie")!=null)
	{
		varGarantie=getRadioValue("rdGarantie")
	}
	
	if($("txtPromoCode")!=null)
	{
		varPromoCode=$("txtPromoCode").value;
	}
	
	if($("txtVariatieId"+productId)==null)
	{
	         variatieId="1";
	}
	else
	{
	 	if($("txtVariatieId"+productId).type=="radio")
		{
			 variatieId=getRadioValue("txtVariatieId");
		}
		else
		{
			variatieId=$("txtVariatieId"+productId).value;
		}
	}
	
    var url="/shop/protoevoeg2.asp?variatieId="+variatieId+"&promocode="+varPromoCode+"&garantie="+varGarantie+"&aantal="+intAantal+"&productId="+productId;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  try{ $('dvWinkelwagen').innerHTML = originalRequest.responseText;}catch(err){}
		  if(gaNaarWinkelmand==true)
		  {
			  gaNaarWinkelmand=false;
			  location.href='/shop/webshop.asp?pagina=mijnwinkelwagen.asp';}
		  //winkelwagenUpgedate(productId);
		  //try{winkelwagenUpgedate();}catch(err){location.href="../shop/webshop.asp?pagina=mijnwinkelwagen.asp"}
	      }
	 });
}


function fScaleImage(imagetagid,hoogte,breedte){
	//scale image
	var img = $(imagetagid);
	
	var imgH = img.clientHeight;
	var imgW = img.clientWidth;
	
	var scaleH = hoogte / img.clientHeight;
	var scaleW = breedte / img.clientWidth;
	
	if (scaleH < scaleW){
		img.style.height = hoogte + "px";
		img.style.width = Math.round(imgW*scaleH) + "px";
		}
	else{
		img.style.width = breedte + "px";
		img.style.height = Math.round(imgH * scaleW) + "px";
		}
	
	}
function centerWindow(element) {
     if($(element) != null) {
          if(typeof window.innerHeight != 'undefined') {
               $(element).style.top = 
                    Math.round(document.viewport.getScrollOffsets().top + 
                    ((window.innerHeight - $(element).getHeight()))/2)+'px';
               $(element).style.left = 
                    Math.round(document.viewport.getScrollOffsets().left + 
                    ((window.innerWidth - $(element).getWidth()))/2)+'px';
          } else {
               $(element).style.top = 
                    Math.round(document.body.scrollTop + 
                    (($$('body')[0].clientHeight - $(element).getHeight()))/2)+'px';
               $(element).style.left = 
                    Math.round(document.body.scrollLeft + 
                    (($$('body')[0].clientWidth - $(element).getWidth()))/2)+'px';
          }
     }
}

function productInfoPromo(productId,promocode)
{
	$('overlayinhoud').innerHTML="";
	fOverlay2();
	var url = "/shop/productdetail.asp?productId="+productId+"&promocode="+promocode;
	var pars = "dummy="+Math.random(); 
	var MyAjaxNewCustSave = new Ajax.Request(url,{
		  method: 'post',
		  timeout:2000,
		  postBody: pars,
		  onComplete: function(originalRequest)
		  {
		  
		  
		  $('overlayinhoud').innerHTML = originalRequest.responseText;
		  $('overlayinhoud').style.width="750px";
		  $('overlayinhoud').style.height=($("tblProductDetail").getHeight()+50)+'px';
		  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
		  //minibezocht();
		   
		  if( originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="2"')>0 )
		  {
			if( originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="1"')>0 )
			{var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 2});}
			else
			{var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 1});}
		  }
		  else if(originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="1"')>0)
		  {
			 var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 1}); 
		  }
		  else
		  {
		  var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail");
		  //var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 2});
		  }
		  
		  //fScaleImage("imgDetailPic",200,200);
		 },
		 onFailure: function(transport)
		 {
			fOverlay2(); 
		 },
		 onTimeOut: function(transport)
		 {
			fOverlay2(); 
		 }
		});
}

function productInfoPakket(productId)
{
	$('overlayinhoud').innerHTML="";
	fOverlay2();
	var url = "/shop/productdetail.asp?productId="+productId;
	var pars = "dummy="+Math.random(); 
	var MyAjaxNewCustSave = new Ajax.Request(url,{
		  method: 'post',
		  timeout:2000,
		  postBody: pars,
		  onComplete: function(originalRequest)
		  {
		  
		  
		  $('overlayinhoud').innerHTML = originalRequest.responseText;
		  $('overlayinhoud').style.width="750px";
		  $('overlayinhoud').style.height=($("tblProductDetail").getHeight()+50)+'px';
		  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
		  //minibezocht();
		  
		  
		  if( originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="2"')>0 )
		  {
			if( originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="1"')>0 )
			{var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 2});}
			else
			{var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 1});}
		  }
		  else if(originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="1"')>0)
		  {
			 var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 1}); 
		  }
		  else
		  {var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail");}
		  
		  //var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab:1});
		  //fScaleImage("imgDetailPic",200,200);
		 },
		 onFailure: function(transport)
		 {
			fOverlay2(); 
		 },
		 onTimeOut: function(transport)
		 {
			fOverlay2(); 
		 }
		});
}

function productInfo(productId)
{
	$('overlayinhoud').innerHTML="";
	fOverlay2();
	var url = "/shop/productdetail.asp?productId="+productId;
	var pars = "dummy="+Math.random(); 
	var MyAjaxNewCustSave = new Ajax.Request(url,{
		  method: 'post',
		  timeout:2000,
		  postBody: pars,
		  onComplete: function(originalRequest)
		  {
		  
		  $('overlayinhoud').innerHTML = originalRequest.responseText;
		  $('overlayinhoud').style.width="750px";
		  $('overlayinhoud').style.height=($("tblProductDetail").getHeight()+50)+'px';
		  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
		  
		  

		  
		  //minibezocht();
		  
		  if( originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="2"')>0 )
		  {
			if( originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="1"')>0 )
			{var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 2});}
			else
			{var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 1});}
		  }
		  else if(originalRequest.responseText.indexOf('class="TabbedPanelsTab" tabindex="1"')>0)
		  {
			 var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail",{defaultTab: 1}); 
		  }
		  else
		  {var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanelsProductDetail");}
		  
			 
			 try{
			  if(originalRequest.responseText.indexOf("/eldi/shop/images/philips.gif")>0)
			  {
			    if(document.getElementById("divflixmedia"+rnd))
			    {
			     var x=document.getElementById("divflixmedia"+rnd).getElementsByTagName('img');
			     for( i=0;i<x.length;i++)
			     {
				  x[i].src="/accounts/113/images/fixmedia-tour.gif";
			     }
			   }
			   else
			   {
				   //$("flixmediaframe").style.display="none";
			   }
			  }
			  }catch(err){}
			 // 
		  
		 },
		 onFailure: function(transport)
		 {
			fOverlay2(); 
		 },
		 onTimeOut: function(transport)
		 {
			fOverlay2(); 
		 }
		});
}

function productVergelijk()
{
	var productId="";
	
	varAantal=0
	$('overlayinhoud').innerHTML="loading...";
	var x=document.getElementsByName("chkProductId");
	for(var i=0;i<x.length;i++)
	{
	 if(x[i].checked==true)
	 {
	  if(productId=="")
	  {
	   productId=productId+x[i].value
	  }
	  else
	  {
	  productId=productId+","+x[i].value
	  }
	  varAantal+=1
	 }
	}
	
	//aantal producten mag niet groter zijn dan 5
	if(varAantal>5 )
	{
	 if($("txtCurTaal").value=="nl")
	 {
	 alert("U kan maximaal 5 producten vergelijken.");
	 }
	 else
	 {
	  alert("Vous pouvez comparer 5 produits maximum..");
	 }
	}
	else if(varAantal==0)
    {

    }
	else{fOverlay2();
	$('overlayinhoud').style.overflow="visible";
	var url = "/shop/shopvergelijk.asp?chkProductId="+productId;
	var pars = "dummy="+Math.random(); 
	var MyAjaxNewCustSave = new Ajax.Request(url,{
		  method: 'post',
		  postBody: pars,
		  onComplete: function(originalRequest){
		 // $('overlayinhoud').style.width=(250+(varAantal*150))+"px";
		  $('overlayinhoud').innerHTML = originalRequest.responseText;
		  $('overlayinhoud').style.overflow="visible";
		  $('overlayinhoud').style.width="950px";
		  $('overlayinhoud').style.position="relative";
		  $('overlayinhoud').style.top=getScrollHeight()+'px';
		}
		});
	}
}


function miniwinkelwagen()
{
	var url = "/shop/miniwinkelwagen.asp";
	var pars = "dummy="+Math.random(); 
	var MyAjaxNewCustSave = new Ajax.Request(url,{
		  method: 'post',
		  postBody: pars,
		  onComplete: function(originalRequest){
			$('dvMiniWinkelmand').innerHTML = originalRequest.responseText;
		}
		});
}

function fOverlay2(){
                var el = $('overlay');
				$('overlay').style.height=$$('body')[0].clientHeight+"px";
				selects = document.getElementsByTagName('select');
				for(i = 0; i < selects.length; i++) {
        			selects[i].style.visibility = el.style.visibility;
    			}
                el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
				

				$('overlayinhoud').style.position="relative";
		  		$('overlayinhoud').style.top=getScrollHeight()+'px';	
				
}
function minibezocht()
{
	var url = "/shop/minibezocht.asp";
	var pars = "dummy="+Math.random(); 
	var MyAjaxNewCustSave = new Ajax.Request(url,{
		  method: 'post',
		  postBody: pars,
		  onComplete: function(originalRequest){
			$('dvMiniBezocht').innerHTML = originalRequest.responseText;
		}
		});
}

function addVerlanglijst()
{
	var url="shopfavoriettoevoegen.asp?productId="+productId;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  //try{ $('$$winkelwagen$$').innerHTML = originalRequest.responseText;}catch(err){}
		  try{verlanglijstUpgedate();
		  }catch(err){}
		  //}catch(err){}
	      }
	 });
	
}
function closeMenu()
{
			Effect.toggle('nav1','slide');
			$('overlayContent').style.display='none';
			selects = document.getElementsByTagName('select');
		    for(i = 0; i < selects.length; i++) {
        			selects[i].style.visibility = "visible";
    		}
			//alle flash ellementen verbergen 
			selects = document.getElementsByTagName('embed');
		    for(i = 0; i < selects.length; i++) {
        			selects[i].style.visibility = "visible";
    		}
			
			//$("nav1").innerHTML="";
}

  function openMenu(varId,varSubcat,groep)
  { 
    if($('nav1').style.display=="none")
	{
	//Effect.toggle('nav1','appear');
	
	//$('nav1').style.display="block";
	$('nav1').innerHTML="laden...";
	$('overlayContent').style.display="block";
	$('overlayContent').style.background = "url(/accounts/113/images/overlay.gif)";
	$('overlayContent').style.position="absolute";
	$('overlayContent').style.zIndex="200";
	//$('overlayContent').style.left=$('content').style.left;
	$('overlayContent').style.height=$('content').getHeight()+"px";
	$('overlayContent').style.width="960px";
	$('overlayContent').style.marginLeft="50px";
	self.scrollTo(0, 0);
	//if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion == 7 )
    if(navigator.appName == "Microsoft Internet Explorer")
	{ 	
	$('overlayContent').style.marginLeft="0px";}
	//$('overlayContent').style.width=$('content').getWidth()+"px";
	//$('overlayContent').style.paddingLeft="50px";
	$('overlayContent').style.top=$('content').style.top;
	}
	
    var url="/shop/shopmenu.asp?categorieId="+varId+"&groep="+groep+"&subcategorieId="+varSubcat;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  
		  try{ $('nav1').innerHTML = originalRequest.responseText;}catch(err){}
		  if(varSubcat!=''){aantalProducten();}
		   if($('nav1').style.display=="none")
		   {
			   
			   
		    Effect.toggle('nav1','slide');
			
			//alle comboboxen verbergen ie6 bug
			selects = document.getElementsByTagName('select');
		    for(i = 0; i < selects.length; i++) {
        			selects[i].style.visibility = "hidden";
    		}
			
			//alle flash ellementen verbergen 
			selects = document.getElementsByTagName('embed');
		    for(i = 0; i < selects.length; i++) {
        			selects[i].style.visibility = "hidden";
    		}
			
			
			
		   }
	      }
	 });
  
  }
  function aantalProducten()
  {
   try{$('dvTotaalProductenFilter').innerHTML='<span style="font-size:9px;"></span>';}catch(err){}
   var varCategorieId=$("categorieId").value;
   var varPrijzen="";
   var varMerken="";
   var varOpties="";
   if($("chkDirectLeverbaar").checked==true){var varDirect=$("chkDirectLeverbaar").value;}
   else{var varDirect="";}
   var x=document.getElementsByName("chkPrijs");
   for(var i=0;i<x.length;i++)
   {
     if(x[i].checked==true)
	 { 
	  if(varPrijzen=="")
	  {
	   varPrijzen=varPrijzen+x[i].value;
	  }
	  else
	  {
	   varPrijzen=varPrijzen+","+x[i].value;
	  }
	 }
   }
   
   var x=document.getElementsByName("chkOpties");
   for(var i=0;i<x.length;i++)
   {
     if(x[i].checked==true)
	 { 
	  if(varOpties=="")
	  {
	   varOpties=varOpties+x[i].value;
	  }
	  else
	  {
	   varOpties=varOpties+","+x[i].value;
	  }
	 }
   }
   
      
   var x=document.getElementsByName("chkMerk");
   for(var i=0;i<x.length;i++)
   {
     if(x[i].checked==true)
	 { 
	  if(varMerken=="")
	  {
	   varMerken=varMerken+x[i].value;
	  }
	  else
	  {
	   varMerken=varMerken+","+x[i].value;
	  }
	 }
   }
   
    var url="/shop/productcount.asp?chkDirectLeverbaar="+varDirect+"&categorieId="+varCategorieId+"&chkMerk="+varMerken+"&chkOpties="+varOpties+"&chkPrijs="+varPrijzen;
	var MyAjaxNewCustSave = new Ajax.Request(url,
	{
		  method: 'post',
		  onComplete: function(originalRequest){
		  try{ $('dvTotaalProductenFilter').innerHTML = originalRequest.responseText;}catch(err){}
		  
	      }
	 });
   
    
  }
function emailToevoegen()
{
	if(isEmail($("email").value))
	{$("frmProfileMail").submit();}
	else
	{
	$("dvEmailTekst").style.display="block";
	 if($("txtCurTaal").value=="nl")
	 {
	  $("dvEmailTekst").innerHTML="het opgegeven emailadres is niet geldig";
	 }
	 else
	 {
	  $("dvEmailTekst").innerHTML= "l&rsquo;adresse e-mail indiqu&eacute;e n&rsquo;est pas valable. "
	 }
   }
}
