<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Plaatje(url){
	var w = 800, h = 400;
	
	if (document.all) {
   /* the following is only available after onLoad */
  	w = document.body.clientWidth;
  	h = document.body.clientHeight;
	}
	else if (document.layers) {
  	w = window.innerWidth;
 	h = window.innerHeight;
	}
	popW = 800;
	popH = 400;
	leftPos=(w)?(w-popW)/2:0;
	topPos=(h)?(h-popH)/2-130:0;

	window.open('popup.php?image='+url,'popup','width=500,height=400,left='+leftPos+',top='+topPos+',toolbar=no,resizable=no,scrollbars=yes')
}

function print_view() {

if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)>3) {
	self.print();
} else if (navigator.appName=="Microsoft Internet Explorer" && parseInt(navigator.appVersion)>3) {
	if (navigator.appVersion.indexOf("MSIE 5.")>=0 || navigator.appVersion.indexOf("MSIE 6.")>=0) { 
		self.print(); 
	} else { 
		window.alert("Uw browser kan dit niet...\n\nGebruik CTRL+P");
	}
} else { 
	window.alert("Uw browser kan dit niet...\n\nGebruik CTRL+P");
}

}



function deleteProduct(id) {
	if (confirm('Product verwijderen?')) {
		window.location = 'winkelwagen.php?action=delete&id=' + id;
	}
}

function select(id, no, prod){
	//alert(pict);
	document.getElementById('kleur'+no).selectedIndex=prod;
	element = no+'color'+id;
	foto = document.getElementById(element).value;
	MM_swapImage('prodFoto'+no,'','thumb.php?image=uploads/'+foto,1);
	document.getElementById('product_id'+no).value = id;
	veldje = document.getElementById('product_id'+no).value;
	//alert(veldje);
}
function view(afb){

	window.open('popup.php?image='+afb+'?w=400&h=600','popup','width=450,height=650,toolbar=no,resizable=yes,scrollbars=yes')
}

function viewpic(afb){

	window.open('popup.php?image=klanten/'+afb+'?w=400&h=600','popup','width=450,height=650,toolbar=no,resizable=yes,scrollbars=yes')
}

function selectbox(id, no){
	//alert(id);
	element = no+'color'+id;
	foto = document.getElementById(element).value;
	//alert(foto);
	MM_swapImage('prodFoto'+no,'','thumb.php?image=uploads/'+foto,1);
	document.getElementById('product_id'+no).value = id;
	veldje = document.getElementById('product_id'+no).value;
	//alert(veldje);
}

var AutoPrint = true; // Indien 'false' wordt de pagina niet automatisch uitgeprint 

function printDiv(){ 
if (document.getElementById != null){ 
var html = '<HTML>\n<HEAD>\n'; 
//if (document.getElementsByTagName != null){ 
//var headTags = document.getElementsByTagName("head"); 
//if (headTags.length > 0) 
//html += headTags[0].innerHTML;} 
html += '\n<title>Mijnbedel.nl</title>\n<link href="../styles/style.css" rel="stylesheet" type="text/css">\n<style type="text/css"><!-- body { font-family: Arial; font-size: 12px; margin: 20px; overflow:auto;background-image:none; background-color:#FFFFFF;} td {font-family: Arial; font-size: 12px;} .kopActive, .kop {font-family: Arial; font-size: 18px;font-weight:bold;} .print img {display:none;} .kalTabel {border-left:solid 1px #999999;border-top:solid 1px #999999;width:648px;} .kalTabel td {border-right:solid 1px #999999;border-bottom:solid 1px #999999;padding:2px;font-size: 11px;} --></style>\n</HE' + 'AD>\n<BODY scroll="yes">\n<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="top" height="130" bgcolor="#FFFFFF"><img src="../images/logo.jpg" /></td></tr></table>'; 
var PrintKlaarElem = document.getElementById("print"); 
if (PrintKlaarElem != null){ 
html += PrintKlaarElem.innerHTML;} 
html += '\n</BO' + 'DY>\n</HT' + 'ML>'; 
var printWin = window.open("","PrintPagina"); 
printWin.document.open(); 
printWin.document.write(html); 
printWin.document.close(); 
if (AutoPrint)printWin.print();}} 

var scrollerDirection = "none";
var scrollerCurrentX = 0;
var scrollerMaxLength = 0;
var scrollerMaxScroll = 0;
var scrollerMaxScrollLeft = 0;
var scrollerScrollWidth = 720;
var scrollerDisableScroll = false;

Event.observe(window, 'load', function() {
	/*Event.observe($('scrollerScrollLeft'), 'mouseOver', scrollerScrollLeftStart);
	Event.observe($('scrollerScrollLeft'), 'mouseOut', scrollerScrollLeftStop);
	Event.observe($('scrollerScrollRight'), 'mouseOver', scrollerScrollRightStart);
	Event.observe($('scrollerScrollRight'), 'mouseOut', scrollerScrollRightStop);*/
	scrollerMaxLength = $F('totalImageLength');
	scrollerMaxScroll = (scrollerMaxLength - scrollerScrollWidth) * -1;
	if (scrollerMaxScroll > 0) scrollerMaxScroll = 0;
	
	scrollerMaxScrollLeft = scrollerScrollWidth - scrollerMaxLength;
	if (scrollerMaxScrollLeft > 0) {
		$('scrollerScrolldiv').style.left = Math.round(scrollerMaxScrollLeft / 2) + "px";
		scrollerDisableScroll = true;
	}
});

function scrollerScrollLeftStart() {
	$('scrollerScrollLeftImg').src = "images/scroll_left_active.gif";
	if (scrollerDirection != "left" && !scrollerDisableScroll) {
		scrollerDirection = "left";
		scrollerLoop();
	}
}

function scrollerScrollLeftStop() {
	scrollerDirection = "none";
	$('scrollerScrollLeftImg').src = "images/scroll_left_inactive.gif";
}

function scrollerScrollRightStart() {
	$('scrollerScrollRightImg').src = "images/scroll_right_active.gif";
	if (scrollerDirection != "right"  && !scrollerDisableScroll) {
		scrollerDirection = "right";
		scrollerLoop();
	}
}

function scrollerScrollRightStop() {
	scrollerDirection = "none";
	$('scrollerScrollRightImg').src = "images/scroll_right_inactive.gif";
}

function scrollerLoop() {
	switch (scrollerDirection) {
		case "none":
			return false;
		break;
		
		case "left":
			scrollerCurrentX += 6;
			if (scrollerCurrentX > 0) { 
				scrollerCurrentX = 0;
				scrollerDirection = "none";
			}
			$('scrollerScrolldiv').style.left = scrollerCurrentX.toString() + "px";;
		break;
		
		case "right":
			scrollerCurrentX -= 6;
			if (scrollerCurrentX < scrollerMaxScroll) {
				scrollerCurrentX = scrollerMaxScroll;
				scrollerDirection = "none";
			}
			$('scrollerScrolldiv').style.left = scrollerCurrentX.toString() + "px";
		break;
	}
	
	setTimeout("scrollerLoop();", 60);
}

function SelectMenu (x) {
	for (i = 1; i <= 6; i++) {
		if (i == x){
				top.menu.document.getElementById("knop" + i).className='menuActive';
			} else{
				top.menu.document.getElementById("knop" + i).className='menuOff';
		}
	}
}
function menuover (which){
	if (top.menu.document.getElementById(which).className == 'menuActive');
	else top.menu.document.getElementById(which).className='menuOn';
}
function menuout (which){
	if (top.menu.document.getElementById(which).className == 'menuActive' | top.menu.document.getElementById(which).className == 'menuTemp');
	else top.menu.document.getElementById(which).className='menuOff';
}
function showMenu (y) {
	var subitem = y + "";
	for (i = 1; i > 0; i++) {
		var productElement = document.getElementById("knop" + i);
		if (productElement != null){
			if (top.menu.document.getElementById("knop" + i).className == 'menuActive');
			else top.menu.document.getElementById("knop" + i).className='menuOff';
			if (i == y){
				MM_showHideLayers('sub' + i + '?main','','show');
			} else{
				MM_showHideLayers('sub' + i + '?main','','hide');
			}
		}else{
			i = -1;
		}
	}
	var productElement = document.getElementById("knop" + subitem);
	if (productElement != null){
		if (top.menu.document.getElementById("knop" + subitem).className == 'menuActive');
		else top.menu.document.getElementById("knop" + subitem).className='menuTemp';
	}
}


function caseActie (which){
	if (document.getElementById(which).className == 'caseTD foto1'){
		document.getElementById(which).className='caseTD foto0';
	}else{
		document.getElementById(which).className='caseTD foto1';
	}
}




function show (id) {
if (document.getElementById) 
document.getElementById(id).style.visibility = "visible";
else if (document.all) 
document.all[id].style.visibility ="visible";
else if (document.layers) 
document.layers[id].visibility = "show";
}

function hide (id) {
if (document.getElementById)
document.getElementById(id).style.visibility = "hidden";
else if (document.all)
document.all[id].style.visibility ="hidden";
else if (document.layers)
document.layers[id].visibility = "hide";
}

function menuActie (which) {
	var klaar=0;
	var i=1;
	while (klaar!=1){
		var productElement = document.getElementById('hoofdMenu' + i);
		if (productElement != null){
			if(document.getElementById(which) == document.getElementById('hoofdMenu' + i)){
				if (document.getElementById('hoofdMenu' + i).className == 'menuActive'){
					document.getElementById('hoofdMenu' + i).className = 'menuActive';
				}else{
					document.getElementById('hoofdMenu' + i).className = 'menuOn';
				}
				show ('sub' + i);
			}else{
				if (document.getElementById('hoofdMenu' + i).className == 'menuOn'){
					document.getElementById('hoofdMenu' + i).className = 'menuOff';
				}
				hide ('sub' + i);
			}
			
		}else{
			klaar = 1;
		}
		i=i+1;
	}
//	resetTimer(180000,i,0);
}

function menuActieOff (which) {
	var klaar=0;
	var i=1;
	while (klaar!=1){
		var productElement = document.getElementById('hoofdMenu' + i);
		if (productElement != null){
			if(document.getElementById(which) == document.getElementById('hoofdMenu' + i)){
				if (document.getElementById(which).className == 'menuActive'){
					document.getElementById(which).className = 'menuActive';
				}else{
					document.getElementById(which).className = 'menuOff';
				}
			}else{
				if (document.getElementById('hoofdMenu' + i).className == 'menuOn'){
					document.getElementById('hoofdMenu' + i).className = 'menuOff';
				}
			}
		}else{
			klaar = 1;
		}
		i=i+1;
	}
//	resetTimer(180000,i,0);
}

function submenuActie(which) {
	if (document.getElementById(which).className != 'submenuActive'){
		document.getElementById(which).className = 'submenuOn'
	}
//	resetTimer(180000,0,which);
}
function submenuActieOff(which) {
	if (document.getElementById(which).className != 'submenuActive'){
		document.getElementById(which).className = 'submenuOff'
	}
//	resetTimer(180000,0,which);
}

function hideAll (menuid,submenuid) {
	if(menuid==0){
		if (document.getElementById(submenuid).className != 'submenuActive'){
			document.getElementById(submenuid).className = 'submenuOff'
		}
	}
	var klaar=0;
	var i=1;
	while (klaar!=1){
		var productElement = document.getElementById('sub' + i);
		if (productElement != null){
			hide ('sub' + i);
		}else{
			klaar = 1;
		}
		i=i+1;
	}
}

var PopupTimer;
function resetTimer($miliseconds,menuid,submenuid) {
	clearTimeout(PopupTimer);
	func = "hideAll(" + menuid + ",\"" + submenuid + "\")";
    PopupTimer = setTimeout(func,$miliseconds);
}

//-->