<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



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 open_multiple(url, img){
	document.getElementById("main").src = url;
	document.getElementById("screenshot").src = img;
}

function openMultiAudio(urlA, urlB){
	window.location.href=(urlA);
	window.open(urlB,'new','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=40');
}

function openMultiVideo(urlA, urlB){
	window.location.href=(urlA);
	window.open(urlB,'new','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=362,height=290');
}

function picPop(url){
	 window.open(url,'new','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=300');
}

function PopupPic(sPicURL) { 
	window.open("img_pop.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function chkFormCONTACT(xform) {

	if (xform.name.value == "") {
		alert('Vul alstublieft uw naam in');
		xform.name.focus();
		xform.name.select();
		return false;
	}

	if (xform.email.value == "") {
		alert('Vul alstublieft een email adres in');
		xform.email.focus();
		xform.email.select();
		return false;
	}
	
	if (xform.message.value == "") {
		alert('U heeft nog geen bericht ingevuld');
		xform.message.focus();
		xform.message.select();
		return false;
	}

	return true;

}

function chkFormOCCMAIL(xform) {

	if (xform.name.value == "") {
		alert('Vul alstublieft uw naam in');
		xform.name.focus();
		xform.name.select();
		return false;
	}

	if (xform.email.value == "") {
		alert('Vul alstublieft een email adres in');
		xform.email.focus();
		xform.email.select();
		return false;
	}
	
	if (xform.message.value == "") {
		alert('U heeft nog geen bericht ingevuld');
		xform.message.focus();
		xform.message.select();
		return false;
	}

	return true;

}



/*
    Adds onmouseover and onmousout handlers for
    Internet Explorer because it doesn't support
    :hover pseudo classes.
    Adds onclick handlers on tracker items for
    all browsers.
*/

function addHandlers() {

    // Menu hovers    

    if (isIE && document.getElementById('campingshop') && document.getElementById('menu')) {

        var menu = document.getElementById('menu');

        var first = true;

        for (var i=0; i<menu.childNodes.length; i++) {

            if (menu.childNodes[i].tagName == 'LI') {

                menu.childNodes[i].onmouseover = function() { addClassName(this, 'hover'); };
                menu.childNodes[i].onmouseout  = function() { removeClassName(this, 'hover'); };

            }

        }

    }

    // Tracker hovers and onclick

    if (document.getElementById('campingshop') && document.getElementById('occasionlist')) {

        var tracker = document.getElementById('occasionlist').getElementsByTagName('ul')[0].childNodes;

        for (var i=0; i<tracker.length; i++) {

            if (tracker[i].tagName == 'LI') {

                if (isIE) {

                    tracker[i].onmouseover = function() {
                        addClassName(this, 'hover');
                        window.status=this.getElementsByTagName('a')[0].href;
                    };

                    tracker[i].onmouseout = function() {
                        removeClassName(this, 'hover');
                        window.status='';
                    };

                } else {

                    tracker[i].onmouseover = function() { window.status=this.getElementsByTagName('a')[0].href; };
                    tracker[i].onmouseout  = function() { window.status=''; };

                }

                tracker[i].onclick = function() { window.location=this.getElementsByTagName('a')[0].href; };

            }

        }

    }

    // Search results hovers and onclick

    if (document.getElementById('resultaten')) {

        var resultaten = document.getElementById('resultaten').getElementsByTagName('tbody')[0].childNodes;

        var first = true;
        var dontMove = false;

        for (var i=0; i<resultaten.length; i++) {

            if (resultaten[i].tagName == 'TR') {

                if (hasClassName(resultaten[i], 'tekst')) {

                    // Tekst item

                    resultaten[i].onmouseover = function() {
                        addClassName(this, 'hover');
                        window.status = this.getElementsByTagName('a')[0].href;
                    };

                    resultaten[i].onmouseout = function() {
                        removeClassName(this, 'hover');
                        window.status = '';
                    };

                    resultaten[i].onclick = function() {
                        window.location = this.getElementsByTagName('a')[0].href;
                    };

                } else {

                    if (first) {

                        // Handlers for first row

                        resultaten[i].onmouseover = function() {
                            addClassName(this, 'hover');
                            var s = this.nextSibling;
                            if (s.tagName != 'TR') s = s.nextSibling;
                            addClassName(s, 'hover');
                            window.status = this.getElementsByTagName('a')[0].href;
                        };

                        resultaten[i].onmouseout = function() {
                            removeClassName(this, 'hover');
                            var s = this.nextSibling;
                            if (s.tagName != 'TR') s = s.nextSibling;
                            removeClassName(s, 'hover');
                            window.status = '';
                        };

                        resultaten[i].onclick = function() {
                            if (dontMove) {
                                dontMove = false;
                            } else {
                                window.location = this.getElementsByTagName('a')[0].href;
                            }
                        };

                        // Hovers for second row

                        t = resultaten[i].nextSibling;
                        if (t.tagName != 'TR') t = t.nextSibling;

                        t.onmouseover = function() {
                            addClassName(this, 'hover');
                            var s = this.previousSibling;
                            if (s.tagName != 'TR') s = s.previousSibling;
                            addClassName(s, 'hover');
                            window.status = s.getElementsByTagName('a')[0].href;
                        };

                        t.onmouseout = function() {
                            removeClassName(this, 'hover');
                            var s = this.previousSibling;
                            if (s.tagName != 'TR') s = s.previousSibling;
                            removeClassName(s, 'hover');
                            window.status='';
                        };

                        t.onclick = function() {
                            var s = this.previousSibling;
                            if (s.tagName != 'TR') s = s.previousSibling;
                            window.location = s.getElementsByTagName('a')[0].href;
                        };

                        // Hack to ignore onclick() when checking of unchecking a checkbox
                        var check = resultaten[i].getElementsByTagName('input')[0];
                        if (check) {
                            check.onclick = function() {
                                dontMove = true;
                            }
                        }


                    }

                    first = !first;

                }

            }

        }

    }

}



/*
    Set image source on element
*/

function setImage (id, img) {

	document.getElementById(id).src=img;

	return true;

}



/*
    Function to show how much chars to go
*/

function countToGo (src, dest, max) {

    var toGo = max - document.getElementById(src).value.length;

    document.getElementById(dest).firstChild.nodeValue = toGo;

    return true;

}



/*
    Show or hide a field
*/


function toggleFieldDisplay (value, valueShow, fieldID) {

	field = document.getElementById(fieldID);

    if (field) {

        if (value == valueShow) {
	    	field.style.display = '';
    	} else {
    		field.style.display = 'none';
    	}

    }

}



function removeClassName(el, name) {

    var i, curList, newList;

    if (el.className == null) {
        return;
    }

    newList = new Array();
    curList = el.className.split(" ");

    for (i = 0; i < curList.length; i++) {
        if (curList[i] != name) {
            newList.push(curList[i]);
        }
    }

    el.className = newList.join(" ");

}



function addClassName(el, name) {

	el.className += " " + name;

}



function hasClassName(el, name) {

  var i, list;

  list = el.className.split(" ");
  for (i = 0; i < list.length; i++)
    if (list[i] == name)
      return true;

  return false;

}



/*
	Determine browser type
*/

isOpera = navigator.userAgent.indexOf('Opera') >= 0;
isIE = navigator.userAgent.indexOf('MSIE') >= 0 && !isOpera;



/*
	Some methods to run on load
*/

defaultOldOnload = window.onload;

window.onload = function() {

    if (defaultOldOnload != null) {
        defaultOldOnload();
    }

    addHandlers();
    //focusForm();

};

function removeItem(message){ 
    if (confirm("Weet u zeker dat u dit artikel wilt verwijderen?")){ 
	return true;
    } else { 
    return false; 
    } 
}

function removeCart() { 
    if (confirm("Weet u zeker dat u de hele winkelwagen wilt legen?")){ 
	return true;
    } else { 
    return false; 
    } 
}
//-->
