/*
        #########################################################
        #                                                       #
        #                 Js by -> Digiblox Interproductions    #
        #                        Please visit www.digiblox.net  #
        #                                                       #
        #########################################################
*/
<!--
    var Mode = null;
    var MenuHeight = new Array();
    var theDiv = null;
    var MyDiv = null;
    var i = null;
    var VPicture = "url(images/min.gif) 0 3px no-repeat";
    var HPicture = "url(images/plus.gif) 0 3px no-repeat";

    function ShowHideAnchor(item,place) {
        var VPic = "#d8dbe1 url(images/arrow_up.gif) " + place + "px center no-repeat";
        var HPic = "#d8dbe1 url(images/arrow_down.gif) " + place + "px center no-repeat";
        MyDiv = 'block' + item;
        theDiv = document.getElementById(MyDiv);

        if (theDiv.style.display == 'block') {
            // Hij is zichtbaar
            MyDiv = 'ShowHideImg' + item;
            theDiv = document.getElementById(MyDiv);
            theDiv.style.background = HPic;
            MyDiv = 'block' + item;
            theDiv = document.getElementById(MyDiv);
            theDiv.style.display = 'none';
        }
        else {
            // Onzichtbaar
            MyDiv = 'ShowHideImg' + item;
            theDiv = document.getElementById(MyDiv);
            theDiv.style.background = VPic;
            MyDiv = 'block' + item;
            theDiv = document.getElementById(MyDiv);
            theDiv.style.display = 'block';
        }
    }

    function ChCookie(item,pagina,mtype) {
        MyDiv = 'block' + item;
        theDiv = document.getElementById(MyDiv);
        var Status;
        var Use;
        if (mtype == 1) {
            // Normaal
            Use = 'ShowHide';
            if (theDiv.style.visibility == 'hidden') {
                // Nu gesloten
                Status = 0;
            }
            else {
                Status = 1;
            }
        }
        else if (mtype == 2) {
            // Anchor
            Use = 'ShowHideAnchor';
            if (theDiv.style.display == 'block') {
                // Nu open
                Status = 1;
            }
            else {
                Status = 0;
            }
        }
        var Koekie = 'P' + pagina + '[' + item + ']';
        //var Val = Status + ':' + mtype;
        var largeExpDate = new Date ();
        largeExpDate.setTime(largeExpDate.getTime() + (365 * 24 * 3600 * 1000));
        SetCookie(Koekie,Status,largeExpDate);
    }

    function ShowHide(item,items) {
        if (items < 1) {
            MyDiv = 'block' + item;
            theDiv = document.getElementById(MyDiv);
        }
        else {
            MyDiv = item + '1';
            theDiv = document.getElementById(MyDiv);
        }
        if (theDiv.style.visibility == 'hidden') {
            // Alles openen en top height terug zetten :)
            // Van + naar - veranderen
            MyDiv = 'ShowHideImg' + item;
            theDiv = document.getElementById(MyDiv);
            theDiv.style.background = VPicture;
            // Height goedzetten
            MyDiv = 'block' + item;
            theDiv = document.getElementById(MyDiv);
            if (items < 1) {
                theDiv.style.display = 'block';
                theDiv.style.visibility = 'visible';
            }
            else {
                theDiv.style.height = MenuHeight[item];
                theDiv.style.overflow = 'visible';
                // Alle items op visible zetten
                for (i=1; i <= items; i++) {
                    MyDiv = item + i;
                    theDiv = document.getElementById(MyDiv);
                    theDiv.style.visibility = 'visible';
                }
            }
        }
        else {
            // Alles openen en top height terug zetten :)
            // Van + naar - veranderen
            MyDiv = 'ShowHideImg' + item;
            theDiv = document.getElementById(MyDiv);
            theDiv.style.background = HPicture;
            // Height goedzetten
            MyDiv = 'block' + item;
            theDiv = document.getElementById(MyDiv);
            if (items < 1) {
                theDiv.style.display = 'none';
                theDiv.style.visibility = 'hidden';
            }
            else {
                MenuHeight[item] = theDiv.style.height;
                theDiv.style.height = '15px';
                theDiv.style.overflow = 'hidden';
                // Alle items op visible zetten
                for (i=1; i <= items; i++) {
                    MyDiv = item + i;
                    theDiv = document.getElementById(MyDiv);
                    theDiv.style.visibility = 'hidden';
                }
            }
        }
    }
    function switchMap (item,items) {
        Mode = 'visible';
        for (i=0; i < items; i++) {
            if (i != item) {
                MyDiv = 'exview' + i;
                theDiv = document.getElementById(MyDiv);
                theDiv.style.display = 'none';
            }
        }
        MyDiv = 'exview' + item;
        theDiv = document.getElementById(MyDiv);
        theDiv.style.display = 'inline';
    }

    function getCookieVal (offset) {
        var endstr = document.cookie.indexOf (";", offset);
        if (endstr == -1)
        endstr = document.cookie.length;
        return unescape(document.cookie.substring(offset, endstr));
    }
    function GetCookie (name) {
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
            var j = i + alen;
            if (document.cookie.substring(i, j) == arg)
            return getCookieVal (j);
            i = document.cookie.indexOf(" ", i) + 1;
            if (i == 0) break;
        }
        return null;
    }
    function SetCookie (name, value) {
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : null;
        var domain = (argc > 4) ? argv[4] : null;
        var secure = (argc > 5) ? argv[5] : false;
        document.cookie = name + "=" + escape (value) +
                    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
                    ((path == null) ? "" : ("; path=" + path)) +
                    ((domain == null) ? "" : ("; domain=" + domain)) +
                    ((secure == true) ? "; secure" : "");
    }
    function SaveScrollXY() {
        document.forms.shop.ScrollX.value = document.body.scrollLeft;
        document.forms.shop.ScrollY.value = document.body.scrollTop;
    }
    function ResetScrollPosition() {
        var hidx, hidy;
        hidx = document.forms.shop.ScrollX;
        hidy = document.forms.shop.ScrollY;
        if (typeof hidx != 'undefined' && typeof hidy != 'undefined') {
            window.scrollTo(hidx.value, hidy.value);
        }
    }

    function getObject(obj) {
        var theObj;
        if(document.all) {
            if(typeof obj=="string") {
                return document.all(obj);
            } else {
                return obj.style;
            }
        }
        if(document.getElementById) {
            if(typeof obj=="string") {
                return document.getElementById(obj);
            } else {
                return obj.style;
            }
        }
        return null;
    }

    function makeRequest(methode,url,vars,soort,ObjS) {
        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { alertContents(http_request,soort,ObjS); };
        http_request.open(methode, url, true);
        http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(vars);
    }

    function alertContents(http_request,s,ObjS) {
        var Obj=getObject(ObjS);
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                switch (s) {
                    case 1:
                        Obj.innerHTML = '$' + http_request.responseText;
                        break;
                }
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
    function ChItems(Url,Opts,S,Field,ObjS) {
        var Obj_s=getObject(Field);
        Opts += Obj_s.value;
        makeRequest('POST',Url,Opts,S,ObjS);
    }


//-->

// function for detail images

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

