//
// functies die door Dreamweaver gegenereerd worden:
//
function MM_popupMsg(theMsg) { //v2.0
  alert(theMsg);
}

function MM_displayStatusMsg(msgStr) { //v2.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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 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 GrpDown(grp) {
    var i, j = 0, downSrc, downOver, objName;
    var cmd = "'" + grp + "'";
    var docGroup = false;
    for (i = 1; i < (GrpDown.arguments.length - 2); i += 3) {
        objName = GrpDown.arguments[i];
        downSrc = GrpDown.arguments[i + 1];
        downOver = GrpDown.arguments[i + 2];
        if (!downOver) {
            downOver = downSrc;
        }
        var docGroup = FindGroup(grp, objName);
        if (!docGroup || !downSrc) {
            continue;
        }
        obj = FWFindImage(document, objName, 0);
        if (!obj) {
            continue;
        }
        obj.atRestSrc = downSrc;
        obj.downOver = downOver;
        obj.src = downOver;
        obj.isDown = true;
        obj.skipMe = true;
        cmd += ",'" + objName + "','" + downSrc + "','" + downOver + "'";
        j++;
    }
    setCookie(grp, cmd);
    if (!docGroup) {
        return;
    }
    var theImages = docGroup.theImages;
    if (theImages) {
        for (i = 0; i < theImages.length; i++) {
            var curImg = theImages[i];
            if (curImg && !curImg.skipMe) {
                curImg.atRestSrc = curImg.initialSrc;
                curImg.isDown = false;
                curImg.downOver = false;
                curImg.src = curImg.initialSrc;
            }
            curImg.skipMe = false;
        }
    }
}

function setCookie(name, value) {
    document.cookie = name + "=" + escape(value);
}

function getCookie(Name) {
    var search = Name + "=";
    var retVal = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            end = document.cookie.indexOf(";", offset);
            offset += search.length;
            if (end == -1) {
                end = document.cookie.length;
            }
            retVal = unescape(document.cookie.substring(offset, end));
        }
    }
    return (retVal);
}

function InitGrp(grp) {
    var cmd = false;
    if (getCookie) {
        cmd = getCookie(grp);
    }
    if (cmd) {
        eval("GrpDown(" + cmd + ")");
        eval("GrpRestore(" + cmd + ")");
    }
}

function GrpSwap(grp) {
    var i, j = 0, newSrc, objName;
    var docGroup = false;
    for (i = 1; i < (GrpSwap.arguments.length - 1); i += 2) {
        objName = GrpSwap.arguments[i];
        newSrc = GrpSwap.arguments[i + 1];
        docGroup = FindGroup(grp, objName);
        if (!docGroup) {
            continue;
        }
        obj = FWFindImage(document, objName, 0);
        if (!obj) {
            continue;
        }
        if (obj.isDown) {
            if (obj.downOver) {
                obj.src = obj.downOver;
            }
        } else {
            obj.src = newSrc;
            obj.atRestSrc = obj.initialSrc;
        }
        obj.skipMe = true;
        j++;
    }
    if (!docGroup) {
        return;
    }
    theImages = docGroup.theImages;
    if (theImages) {
        for (i = 0; i < theImages.length; i++) {
            var curImg = theImages[i];
            if (curImg.atRestSrc && !curImg.skipMe) {
                curImg.src = curImg.atRestSrc;
            }
            curImg.skipMe = false;
        }
    }
}

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

function FindGroup(grp, imageName) {
    var img = FWFindImage(document, imageName, 0);
    if (!img) {
        return (false);
    }
    var docGroup = eval("document.FWG_" + grp);
    if (!docGroup) {
        docGroup = new Object();
        eval("document.FWG_" + grp + " = docGroup");
        docGroup.theImages = new Array();
    }
    if (img) {
        var i;
        for (i = 0; i < docGroup.theImages.length; i++) {
            if (docGroup.theImages[i] == img) {
                break;
            }
        }
        docGroup.theImages[i] = img;
        if (!img.atRestSrc) {
            img.atRestSrc = img.src;
            img.initialSrc = img.src;
        }
    }
    return (docGroup);
}

function GrpRestore(grp) {
    var docGroup = eval("document.FWG_" + grp);
    if (!docGroup) {
        return;
    }
    theImages = docGroup.theImages;
    if (theImages) {
        for (i = 0; i < theImages.length; i++) {
            var curImg = theImages[i];
            if (curImg.atRestSrc) {
                curImg.src = curImg.atRestSrc;
            }
        }
    }
}

function WM_setCookie (name, NS_value, IE_value, hours, path, domain, evalValue) {


    daValue = (navigator.appName == 'Netscape')?NS_value:IE_value;

    //fix layer ref if not supported (thanks, Ken Sundermeyer!)

    if ((daValue.indexOf('document.layers[')==0 && document.layers==null)|| (daValue.indexOf('document.all[')==0 && document.all==null)) {

      daValue = 'document'+daValue.substring(daValue.substring(0,daValue.lastIndexOf('.')).lastIndexOf('.'),daValue.length);

    }


    if(evalValue == 1) daValue = eval(daValue + '.value');


  // set the cookie, adding any parameters that were specified

  // (convert hours to milliseconds (*3600000) and then to a GMTString)

    document.cookie = name + '=' + daValue + ((hours)?(';expires=' + ((new Date((new Date()).getTime() + parseInt(hours)*3600000)).toGMTString())):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'');

}

function WM_readCookie(name, NS_outputElement, IE_outputElement) {

  // if there's no cookie, don't do anything

  if(document.cookie != '') {

    var actualValue, outputElement, firstChar, lastChar;


    // get the entire cookie string (this may have other name=value pairs in it

    var theBigCookie = document.cookie;

    // grab just this cookie from theBigCookie string

    // find the start of 'name'

    firstChar = theBigCookie.indexOf(name);

    // if you found it

    if(firstChar != -1) {

      // skip 'name' and '='

      firstChar += name.length + 1;

      // find the end of the value string (i.e. the next ';')

      lastChar = theBigCookie.indexOf(';', firstChar);

      if(lastChar == -1) lastChar = theBigCookie.length;

      // return the value

      actualValue = theBigCookie.substring(firstChar, lastChar);

    } else {

      // if there was no cookie, return false

      actualValue = false;

    }


    outputElement = (navigator.appName == 'Netscape')?NS_outputElement:IE_outputElement;

    //fix layer ref if not supported (thanks, Ken Sundermeyer!)

    if ((outputElement.indexOf('document.layers[')==0 && document.layers==null)|| (outputElement.indexOf('document.all[')   ==0 && document.all   ==null)) {

      outputElement = 'document'+outputElement.substring(outputElement.substring(0,outputElement.lastIndexOf('.')).lastIndexOf('.'),outputElement.length);

    }

    if(outputElement && actualValue) {

      eval(outputElement+".value = '"+actualValue+"'");

    }

  }

}

function BW_reload() {location.reload();}
onresize = BW_reload;

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; }
}

