// Javascript from lib.js
/****************************************************************************
DHTML library from DHTMLCentral.com
* Copyright (C) 2001 Thomas Brattli 2001
* This script was released at DHTMLCentral.com
* Visit for more great scripts!
* This may be used and changed freely as long as this msg is intact!
* We will also appreciate any links you could give us.
*
* Made by Thomas Brattli 2001
***************************************************************************/
//Browsercheck (needed) ***************
function lib_bwcheck(){
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5)
return this
}
bw=new lib_bwcheck() //Browsercheck object
//Debug function ******************
function lib_message(txt){return false;}
//Lib objects ********************
function lib_obj(obj,nest){
if(!bw.bw) return lib_message('Old browser')
nest=(!nest) ? "":'document.'+nest+'.'
this.evnt=bw.dom? document.getElementById(obj):
bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;
if(!this.evnt) return lib_message('The layer does not exist ('+obj+')'
+'- \nIf your using Netscape please check the nesting of your tags!')
this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;
this.ref=bw.dom||bw.ie4?document:this.css.document;
this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0
this.w=this.evnt.offsetWidth||this.css.clip.width||
this.ref.width||this.css.pixelWidth||0;
this.h=this.evnt.offsetHeight||this.css.clip.height||
this.ref.height||this.css.pixelHeight||0
this.c=0 //Clip values
if((bw.dom || bw.ie4) && this.css.clip) {
this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1);
this.c=this.c.split(' ');
for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
}
this.ct=this.css.clip.top||this.c[0]||0;
this.cr=this.css.clip.right||this.c[1]||this.w||0
this.cb=this.css.clip.bottom||this.c[2]||this.h||0;
this.cl=this.css.clip.left||this.c[3]||0
this.obj = obj + "Object"; eval(this.obj + "=this")
return this
}
//Moving object to **************
lib_obj.prototype.moveIt = function(x,y){
this.x=x;this.y=y; this.css.left=x;this.css.top=y
}
lib_obj.prototype.moveItY = function(y){
this.y=y; this.css.top=y
}
lib_obj.prototype.moveItX = function(x){
this.x=x; this.css.left=x
}
//Moving object by ***************
lib_obj.prototype.moveBy = function(x,y){
this.css.left=this.x+=x; this.css.top=this.y+=y
}
//Showing object ************
lib_obj.prototype.showIt = function(){this.css.visibility="visible"}
//Hiding object **********
lib_obj.prototype.hideIt = function(){this.css.visibility="hidden"}
//Changing backgroundcolor ***************
lib_obj.prototype.bg = function(color){
if(bw.opera) this.css.background=color
else if(bw.dom || bw.ie4) this.css.backgroundColor=color
else if(bw.ns4) this.css.bgColor=color
}
//Writing content to object ***
lib_obj.prototype.writeIt = function(text,startHTML,endHTML){
if(bw.ns4){
if(!startHTML){startHTML=""; endHTML=""}
this.ref.open("text/html");
this.ref.write(startHTML+text+endHTML);
this.ref.close()
}else this.evnt.innerHTML=text
}
lib_obj.prototype.width = function() {
return (this.w = this.evnt.offsetWidth||this.css.clip.width||this.ref.width||this.css.pixelWidth||0)
}
node_normal_images_39860 = new Array();
node_mouseover_images_39860 = new Array();
node_normal_images_39860[0] = '/upload/42608_7024_1161093057542-abonnementenproducten_wit.gif';
node_mouseover_images_39860[0] = '/upload/42607_7024_1111593806892-abonnementenproducten_grijs.gif';
node_normal_images_39860[1] = '/upload/43983_7024_1111594194719-magazines_wit.gif';
node_mouseover_images_39860[1] = '/upload/43982_7024_1111593831343-magazines_grijs.gif';
node_normal_images_39860[2] = '/upload/394297_7024_1111594341326-kids_wit.gif';
node_mouseover_images_39860[2] = '/upload/394307_7024_1111594000289-kids_grijs.gif';
node_normal_images_39860[3] = '/upload/44002_7024_1111594217389-funcontact_wit.gif';
node_mouseover_images_39860[3] = '/upload/44001_7024_1111593869834-funcontact_grijs.gif';
node_normal_images_39860[4] = '/upload/44004_7024_1111594256008-breedband_wit.gif';
node_mouseover_images_39860[4] = '/upload/44003_7024_1111593894914-breedband_grijs.gif';
node_normal_images_39860[5] = '/upload/44006_7024_1111594300413-abonneeservice_wit.gif';
node_mouseover_images_39860[5] = '/upload/44005_7024_1111593954402-abonneeservice_grijs.gif';
node_normal_images_39860[6] = '/upload/582331_7024_1112787068040-shopping_wit.gif';
node_mouseover_images_39860[6] = '/upload/582334_7024_1112787031109-shopping_grijs.gif';
function Navigation() {
this.root = new NavigationNode(0, null)
this.currentNode = null
this.sub = null
this.imageDir = ''
this.divImage = '/upload/69041_7024_1048032325833-line_blue.gif'
this.trans = '
'
this.left = 0
this.mainTimeout = 200
this.resetTimeout = 1200
this.timeout = null
this.selected = null
this.lookup = new Object()
window.onload = function() { nav.init() }
return this
}
Navigation.prototype.init = function() {
this.relsub = new lib_obj("relsub")
this.sub = new lib_obj("sub", "relsub")
for (var i=0; i ')
this.sub.showIt()
var node = this.lookup['node_1']
node.mouseOver('', 'a_node_1')
}
Navigation.prototype.setLabel = function(path, label) {
var node = this.getNode(path, this.root, 0)
node.label = label
}
Navigation.prototype.setLink = function(path, link) {
var node = this.getNode(path, this.root, 0)
node.link = link
}
Navigation.prototype.setAdultOnly = function(path, adultonly) {
var node = this.getNode(path, this.root, 0)
node.adultonly = adultonly
}
//
Navigation.prototype.setSelected = function(path) {
if (this.selected) {
this.selected.setSelected(false)
}
var node = this.getNode(path, this.root, 0)
this.selected = node
this.selected.setSelected(true)
}
Navigation.prototype.getNode = function(path, parent, i) {
var index = path[i] - 1
var nodes = parent.children
if (index >= nodes.length || !nodes[index]) {
var node = new NavigationNode(this, index, parent, i)
nodes[index] = node
this.lookup[node.id] = node
}
if (i < path.length-1) {
return this.getNode(path, nodes[index], i+1)
} else {
return nodes[index]
}
}
Navigation.prototype.getMainHtml = function() {
var code = ''
code += '
'
for (var i=0; i\n'
code += '
\n'
code += '
'
code += '\n'
} else if (bw.ns6) {
code += '\n'
code += '

\n'
code += '
'
code += '
\n'
} else {
code += '\n'
}
return code
}
Navigation.prototype.update = function() {
var t = this.timeout
t.node[t.fun](t.source, t.sourceid)
this.timeout = null
}
Navigation.prototype.updateOut = function() {
var t = this.timeout
t.node[t.fun](t.source, t.sourceid)
this.timeout = null
var node = this.lookup['node_1']
node.mouseOver('', 'a_node_1')
}
Navigation.prototype.mouseOver = function(source, sourceid) {
var node = this.lookup[sourceid.substr(2)]
if (node != this.currentNode) {
if (this.timeout) {
clearTimeout(this.timeout.id)
}
if (node.level == 0) {
this.timeout = {'id': setTimeout("nav.update()", this.mainTimeout),
'node': node,
'source': source,
'sourceid': sourceid,
'fun': 'mouseOver' }
} else {
this.timeout = null
node.mouseOver(source, sourceid)
}
}
}
Navigation.prototype.mouseOut = function(source, sourceid) {
var node = this.lookup[sourceid.substr(2)]
node.mouseOut(source, sourceid)
if (this.timeout) {
clearTimeout(this.timeout.id)
}
this.timeout = {'id': setTimeout("nav.updateOut()", this.resetTimeout),
'node': node,
'source': source,
'sourceid': sourceid,
'fun': 'reset' }
}
function NavigationNode(nav, index, parent, level) {
this.nav = nav
this.index = index
this.image = {'current': null, 'normal': null, 'hoover': null}
this.id = (parent ? parent.id + "_" + index : "node")
this.parent = parent
this.level = level
this.left = 0
this.right = 0
this.label = null
this.link = null
this.adultonly = null
this.source = null
this.focus = false
this.selected = false
this.children = new Array()
}
function getElt() {
if (document.all) { // IE4+
var elt = eval('document.all[\'' + getElt.arguments[getElt.arguments.length - 1] + '\']');
// Extra code to skip the LAYER for Netscape 4 with the same name which causes elt to be an array
if (elt.length) {
return elt[0];
} else {
return elt;
}
} else if (document.layers) { //NS4
var currentLayer = document.layers[getElt.arguments[0]];
for (var i = 1; i < getElt.arguments.length && currentLayer; i++) {
currentLayer = currentLayer.document.layers[getElt.arguments[i]];
}
return currentLayer;
} else if (document.getElementById) { // NS6
return document.getElementById(getElt.arguments[getElt.arguments.length - 1]);
}
}
NavigationNode.prototype.init = function() {
if (this.level == 0) {
this.image.current = getElt(this.id)
this.image.normal = new Image()
this.image.normal.src = node_normal_images_39860[this.index]
this.image.hoover = new Image()
this.image.hoover.src = node_mouseover_images_39860[this.index]
var sub = this.nav.sub
sub.writeIt(this.getSubHtml())
for (var i=1; i 635) {
this.sub_left = 635 - sub.w
}
}
}
NavigationNode.prototype.setSelected = function(selected) {
var node = this
node.selected = selected
while (node.parent != null) {
node.focus = selected
node = node.parent
}
node.focus = selected
}
NavigationNode.prototype.getMainHtml = function() {
var code = ''
if (!this.selected) {
code += this.getAnchorHtml(this.link, "sub")
}
code += '
'
code += '
'
if (!this.selected) {
code += ''
}
return code
}
NavigationNode.prototype.getSubHtml = function() {
var code = ''
code += ''
first = true;
for (var i=0; i'
return code
}
NavigationNode.prototype.getSubItemHtml = function (first) {
var code = ''
code += ''
if (!this.selected) {
code += this.getAnchorHtml(this.link, "sub")
}
if ((this.index > 0) && (!(first))) {
code += '•'
} else {
code += ' '
}
code += ' ' + this.label + ' '
if (!this.selected) {
code += ''
}
code += ''
return code
}
NavigationNode.prototype.getAnchorHtml = function(link, className, hasEvents) {
var code = ''
code += ''
} else {
code += '>'
}
return code
}
NavigationNode.prototype.mouseOver = function(source, sourceid) {
this.source = source
if (this.level == 0) {
if (this.nav.currentNode) {
if (this.nav.currentNode.level == 0) {
this.nav.currentNode.setImage("normal")
} else if (this.nav.currentNode.level == 1) {
this.nav.currentNode.parent.setImage("normal")
}
}
this.setImage("hoover")
this.nav.sub.moveItX(this.sub_left)
this.nav.sub.writeIt(this.getSubHtml())
} else if (this.level == 1) {
if (this.nav.currentNode) {
if (this.nav.currentNode.level == 1) {
this.nav.currentNode.setColor("")
}
}
this.setColor("#000000")
} else {
this.setBgColor('#FFFFFF')
}
this.nav.currentNode = this
}
NavigationNode.prototype.reset = function () {
if (this.level == 0) {
this.nav.sub.writeIt(' ')
this.setImage("normal")
} else if (this.level == 1) {
this.nav.sub.writeIt(' ')
this.parent.setImage("normal")
}
this.nav.currentNode = null
}
NavigationNode.prototype.mouseOut = function(source, sourceid) {
if (this.level == 2) {
this.setBgColor("#E1E1E1")
}
}
NavigationNode.prototype.setImage = function(type) {
this.image.current.src = this.image[type].src
}
NavigationNode.prototype.setColor = function(color) {
if (bw.dom || bw.ie4) {
this.source.style.color=color
} else if (bw.ns4) {
// source.color=color
}
}
NavigationNode.prototype.setBgColor = function(color) {
var item = new lib_obj(this.id, "relsub.document.dropdown.document.i_" + this.id)
item.bg(color)
}