var popUpPage = 'http://www.iens.nl/popUp/2004/deBedrijfseditiesVanIENS';
var popUpHeight = '300';
var is = new browserCheck();
var imgExt = ".gif";
var myLayers = Array ("navigation", "body");
wbds_counttags=0;
wbds_serverup=true;
wbds_firstdone=false;
wbds_waitserver=2500;
wbds_pageid=-1;
wbds_target = 'http://adserver.webads.nl/jserver/SITE=IENS.NL/AREA=';
function browserCheck() {
	var b = navigator.appName;
	this.agent = window.navigator.userAgent;
	this.win = (this.agent.indexOf('Win')>0);
	this.mac = (this.agent.indexOf('Mac')>0);
	switch (b) {
		case "Netscape": this.b = "ns"; break;
		case "Microsoft Internet Explorer": this.b = "ie"; break;
		default: this.b = b};
	this.version = navigator.appVersion;
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.min = (this.ns||this.ie);
	if (this.ns4) {
		var d = document; var w = window;
		if (typeof d.cs == 'undefined') {
			d.cs = new Object;
			d.cs.csFix = new Object};
		d.cs.csFix.w = w.innerWidth;
		d.cs.csFix.h = w.innerHeight;
		window.onresize = NSFixFct}};
function NSFixFct() {
	var d = document; var w = window;
	if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
		d.location = d.location}};
function clickReturn () {
	if (is.ie && (is.agent.indexOf("Mozilla/3") >= 0) && (is.mac)) {
		return true}
	else {
		return false}};
function findElement(name, layer) {
	if (is.version < 4) {
		return document[name]};
	if (is.v == 4) {
		var curDoc = layer ? layer.document : document, elem = curDoc[name];
		if (!elem) {
			for (var i=0;i<curDoc.layers.length;i++) {
				elem = findElement (name, curDoc.layers[i]);
				if (elem) {
					return elem}}}}
	else {
		elem = document.getElementById (name)};
	return elem};
function findLayer (name) {
	if (is.ie) {
		return document.all.tags("div")[name]}
	else {
		return findElement(name,0)}};
function layerObj (id) {
	this.id = id;
	this.obj = findLayer (this.id);
	if (is.ns4) {
		this.x = this.obj.left;
		this.y = this.obj.top}
	else {
		this.x = this.obj.offsetLeft;
		this.y = this.obj.offsetTop};
	this.pos_x = this.x;
	this.pos_y = this.y;
	this.write = writeLayer;
	this.clip = clipLayer;
	this.getWidth = getWidth;
	this.getHeight = getHeight;
	this.setHeight = setHeight;
	this.getClip = getClipValue;
	this.moveTo = moveLayerTo;
	this.moveBy = moveLayerBy;
	this.alignMiddle = alignMiddle;
	this.show = show;
	this.hide = hide};
function imageObj (id, preloads, urlprefix) {
	if (urlprefix == null) {
		this.url = "template/" + id.replace (/:/g, '/')}
	else {
		this.url =  urlprefix + "/" + id.replace (/:/g, '/')};
	if (is.ns4) {
		this.obj = findElement(id,0)}
	else {
		this.obj = document.images[id]};
	if (this.obj) {
		for (var ct in preloads) {
			var suffix = "_" + preloads[ct];
			if (preloads[ct] == "_") {
				suffix = ""};
			this[preloads[ct]] = new Image ();
			if (preloads[ct] != "current") {
				this[preloads[ct]].src = imgprefix + "images/" + this.url + suffix + ".gif"}
			else {
				this[preloads[ct]].src = this.obj.src}};
		this.set = setImage}};
function textObj (id, w, h, show) {
	this.id = id + "TextObj";
	eval(this.id+"=this");
	this.layer = new layerObj (id);
	this.layer.w = this.layer.getWidth ();
	this.layer.h = this.layer.getHeight ();
	if (w == null) {
		w = this.layer.w};
	if (h == null) {
		h = this.layer.h};
	if (show) {
		this.layer.show ()}};
function navObj (id) {
	this.id = id + "NavObj";
	eval (this.id+"=this");
	this.image = new imageObj (id.replace (/__/g, '_:'), new Array ("current", "m"), "navigation");
	this.over = new Function (this.id + '.image.set (' + this.id + '.image.m.src)');
	this.out = new Function (this.id + '.image.set (' + this.id + '.image.current.src)')};
function setImage (url) {
	this.obj.src = url};
function getWidth () {
	if (is.ns4) {
		return this.obj.clip.width}
	else if (is.ie) {
		return 500}
	else {
		return parseInt (this.obj.scrollWidth)};
	return -1};
function getHeight () {
	if (is.ns4) {
		return this.obj.clip.height}
	else if (is.ie) {
		return this.obj.clientHeight}
	else {
		return parseInt (this.obj.scrollHeight)};
	return -1};
function setHeight (value) {
	if (is.ns4) {
		this.obj.document.height = value}
	else {
		this.obj.style.height = value};
	return true};
function writeLayer (html) {
	this.text = html;
	if (is.ie) {
		this.obj.innerHTML = html}
	else {
		this.obj.document.open ();
		this.obj.document.write (html);
		this.obj.document.close ()}};
function moveLayerTo (x, y) {
	if (x!=null) {
		this.x = x;
		if (is.ie) {
			 this.obj.style.pixelLeft = this.x}
		else {
			if (is.ns4) {
				this.obj.left = this.x}
			else {
				this.obj.style.left = this.x}}};
	if (y!=null) {
		this.y = y;
		if (is.ie) {
			 this.obj.style.pixelTop = this.y}
		else {
			if (is.ns4) {
				this.obj.top = this.y}
			else {
				this.obj.style.top = this.y}}}};
function moveLayerBy (dx, dy) {
	this.moveTo(this.x+dx,this.y+dy)};
function clipLayer(clipleft, cliptop, clipright, clipbottom) {
	if (is.ie) {
		this.obj.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';}
	else {
		this.obj.clip.left  = clipleft;
		this.obj.clip.top = cliptop;
		this.obj.clip.right = clipright;
		this.obj.clip.bottom = clipbottom}};
function getClipValue (which) {
	if (is.ie) {
		var str =  this.obj.style.clip;
		if (!str) {
			return 0};
		var clip = getIEClipValues(this.obj.style.clip);
		switch (which) {
			case "top": return clip[0];
			case "right": return clip[1];
			case "bottom": return clip[2];
			case "left": return clip[3]}}
	else {
		return this.obj.clip[which]};
	return -1};
function getIEClipValues(str) {
	var clip = new Array();
	var i;
	i = str.indexOf("(");
	clip[0] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[1] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[2] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[3] = parseInt(str.substring(i + 1, str.length), 10);
	return(clip)};
function scrollLayerBy(dx, dy, bound) {
	var cl = 0;
	var ct = this.getClip("top");
	var cr = this.getClip("right");
	var cb = this.getClip("bottom");
	if (bound) {
		if (cl + dx < 0) {
			dx = -cl}
		else if (cr + dx > this.getWidth()) {
			dx = this.getWidth() - cr};
		if (ct + dy < 0) {
			dy = -ct}
		else if (cb + dy > this.getHeight()) {
			dy = this.getHeight() - cb}};
	this.clip (cl + dx, ct + dy, cr + dx, cb + dy);
	this.moveBy (-dx, -dy);};
function show () {
	if (is.ns4) {
		this.obj.visibility = 'show'}
	else {
		this.obj.style.visibility = "visible"}};
function hide () {
	if (is.ns4) {
		this.obj.visibility = 'hide'}
	else {
		this.obj.style.visibility = "hidden"}};
function alignMiddle () {
	var pageWidth = 1000, leftIndent = 0;
	if (is.ie) {
		leftIndent = (document.body.clientWidth-pageWidth)/2 + 8}
	else {
		leftIndent = (window.innerWidth-pageWidth)/2 - 16};
	left = leftIndent + this.pos_x;
	if (left < this.pos_x) {
		left = this.pos_x};
	this.moveTo (left, this.y)};
function alignLayers() {
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = eval(myLayers[ct] + "TextObj");
		myObj.layer.alignMiddle ()}};
function init() {
	window.onresize = alignLayers;
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = new textObj (myLayers[ct], null, null, false);
		myObj.layer.pos_x = myObj.layer.x;
		myObj.layer.pos_y = myObj.layer.y;
		myObj.layer.alignMiddle ();
		myObj.layer.show()};

	initialized = true}

