function verkoop(){
	/* class */
accordion = new Accordion('h1.categorie', 'h2.categorie', {
	opacity: true,
	onActive: function(toggler, element){
		toggler.setStyle('color', ' #F71B14');
		toggler.setStyle('font-style', ' italic');
	},


	onBackground: function(toggler, element){
		toggler.setStyle('color', '#0D0058');
		toggler.setStyle('font-style', ' normal');
	}
}, $('content_content'));	


var modeldivs=$$('.modeldiv');
modeldivs.each(function(mdiv) {
	/*onmouseover=\"this.setStyle('background', 'url(../images/verkoop/bgmodel.gif)');\" onmouseout=\"this.setStyle('background', '#f2f2f2');\"*/
	mdiv.addEvent('mouseenter', function(){     	
	mdiv.setStyle('background', 'url(../images/verkoop/bgmodel.gif)')	
	//alert();
	});
	
	mdiv.addEvent('mouseleave', function(){     	
	mdiv.setStyle('background', '#f2f2f2');			
  	});
	
});

}


var accordion='';

function uitrusting(){
accordion = new Accordion('button#categorie', 'h2.categorie', {
	start:'all-closed',
	opacity: true,
	show:0,
	alwaysHide: true,
	onActive: function(toggler, element){
		//toggler.setStyle('color', ' #F71B14');
		toggler.setStyle('font-style', ' italic');
		element.setStyle('border-bottom', '2px solid #F71B14');
	},


	onBackground: function(toggler, element){
		//toggler.setStyle('color', '#0D0058');
		toggler.setStyle('font-style', ' normal');
		element.setStyle('border-bottom', '0px solid red');
	}
}, $('content_content'));


}

extraClass='';
var Extras = new Class( { ////bij opstarten alle blokken automatisch een mouseover geven met de coordinaten naar centered
initialize: function(options){
	this.options = Object.extend({
		classnaam: '',
		transport: 0
		}, options || {});
		this.classnaam	=this.options.classnaam;
		this.transport	=this.options.transport;
		
		//$('totalen').setStyle("opacity", 0.9);
		this.rijen=$$('.rij');
		extraClass=this;
		
		
		
		this.rijen.each(function(rij) {
		rij.setStyle("cursor","pointer");
	
		
		rij.addEvent('click', function(event){	
		
		
		
		rij_checkbox 	= $E('input[type=checkbox]', rij.id) 
		extraClass.onOff(rij, rij_checkbox, event);
		
		
		new somExtras({classnaam:'.prijsbox'});
		});		
		
		});
		
		new somExtras({classnaam:'.prijsbox'});
		
		},

onOff: function(rij, checkbox, event){	
		
		rijcheckboxc 	= checkbox.checked;
		rcheck		= (rijcheckboxc==false)? true : false;
		event = new Event(event);
		if(event.target.tagName!="INPUT"){
		checkbox.checked=rcheck;
		}
		
		var fx = new Fx.Styles(rij, {duration:350, wait:false});
		
		if(rij_checkbox.checked){
		
		fx.start({
			'background-color': '#f71b14',
			'color': '#ffff'
		});		
				
		}else{
		
		fx.start({
			'background-color': '#f2f2f2',
			'color': '#000059'
		});
			
		}	
		
	
	
		}


});


var somExtras = new Class( { 
initialize: function(options){
	this.options = Object.extend({
		classnaam: '',
		transport: 0,
		afwerf:0	
		}, options || {});
		this.som='0';
		this.classnaam	=this.options.classnaam;
		this.transport	=this.options.transport;
		this.afwerf	=this.options.afwerf;
		this.inputtype	=this.options.inputtype;
		//window.status=this.classnaam;
		//this.cshecks=$ES('input', this.options.classnaam) 
		var inputtype= '';
		inputtype= this.inputtype;
		
		var totaalprijs=parseFloat(0);
		this.schecks='';
		
		//this.checks=$ES('input', this.classnaam);//denk dit is een foute selector..... classnaam wordt niet meegenomen
		this.checks= $$('.prijs_box');
		//alert(this.checks);
		//window.status=this.checks.length;
		c=0;
		
		this.checks.each(function(cbox) {
		//window.status=  (cbox.checked==true) ? window.status+", "+cbox.value; || cbox.type=="hidden"
		//window.status=window.status+", "+cbox.value
		totaalprijs = (cbox.checked==true) ? parseFloat(totaalprijs)+parseFloat(cbox.value) : totaalprijs;
		totaalprijs = (inputtype=="hidden") ? parseFloat(totaalprijs)+parseFloat(cbox.value) : totaalprijs;
		//if(inputtype=="hidden"){//alert(parseFloat(totaalprijs)+" | "+parseFloat(cbox.value));	}
		
		});
		
		
		//totaalprijs = (this.transport==1) ? totaalprijs+parseFloat($('trprijs').innerHTML) : totaalprijs;
		if(this.transport==1){
		this.transportkosten=parseFloat($('trprijs').innerHTML);
		totaalprijs = (this.transportkosten>0) ? totaalprijs+this.transportkosten : totaalprijs;
		}
		
		if(this.afwerf==1){
		this.afwerfkosten=parseFloat($('awprijs').innerHTML);
		//alert(this.afwerfkosten);
		totaalprijs = (this.afwerfkosten>0) ? totaalprijs+this.afwerfkosten : totaalprijs;
		
		}
		
		totaalprijs= this.CurrencyFormatted(totaalprijs);
		//totaalprijs.round(2); 
		//$('scrolldiv').setStyle("height", window.getHeight()-350);
		$('subtotaal').innerHTML=totaalprijs;
},

CurrencyFormatted: function (amount){
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}
		
});





function afleveren(fe, xkm, ppk){
var xkm	= $(xkm);
var ppk	= $(ppk);
	
if(fe.checked==true){
xkm.disabled=false;	
aflevertotaal(xkm);
}else{
xkm.disabled=true;	
$('trprijs').innerHTML="0.00";	
$('transportkosten').value="0.00";	
var e=new somExtras({classnaam:'.prijs_box', transport:1, afwerf:1, inputtype: 'hidden'});
}	



}

function aflevertotaal(fe){

(function(){
var ssom=parseFloat(fe.value)*parseFloat($('ppk').value)
var ssom=ssom.toFixed(2);
$('trprijs').innerHTML=ssom;
$('transportkosten').value=ssom;
var e=new somExtras({classnaam:'.prijs_box', transport:1, afwerf:1, inputtype: 'hidden'});
}).delay(200);

}