
// ALL JAVASCRIPTS FOR THE SITE WWW.CARERIX.COM
// 


// Object name: RollOver
//
// Author: Eric Byrnes, Hybridigital
//
// Parameters: OffSrc - relative path to 'Off' image
//             OnSrc - relative path to 'On' image
//
// Usage: 1) include the Javascript source file within the HTML header, i.e.
//           <SCRIPT LANGUAGE="Javascript" SRC="../rollover.js">
//
//        2) create new Rollover objects for each rollover, passing the source for
//           the 'Off' image and 'On' image, i.e.
//           rollimage = new RollOver("../images/OffImage.gif","../images/OnImage.gif");
//
//        3) call it within the HTML
//           <A HREF="xxx" onMouseOver="rollimage.On('target')" onMouseOut="rollimage.Off('target')">
//           <IMG NAME="target" SRC="<default>"></A>
//           where
//           - rollimage is the object created in step 2
//           - target is either the image object or the name of the image object to
//             apply the rollover to
//
// Attributes: state - OFF or ON
// Methods: On(target) - turns object 'on' (overlays image named target with 'On' image)
//          Off(target) - turns object 'off' (overlays image named target with 'Off' image)
//          Toggle(target) - toggles object state for image named target
//
// Modification Log
// ERB  20-OCT-1999  Initial release.
// ERB  08-NOV-9999  Updated for Netscape compatibility
// ERB  08-FEB-2000  Updated for Netscape 3.x compatibility

//
// Method functions for Rollover object below
function RollOverOn(target) {

	if (document.images) {
		if (typeof (target) == "string") {
			if (typeof (eval(document[target])) == "object") {
				document[target].src = this.OnImage.src;
			}
		} else if (typeof (target) == "object") {
			target.src = this.OnImage.src;
		}
	}
	this.State = "ON";
}

function RollOverOff(target) {

	if (document.images) {
		if (typeof (target) == "string") {
			if (typeof (eval(document[target])) == "object") {
				document[target].src = this.OffImage.src;
			}
		} else if (typeof (target) == "object") {
			target.src = this.OffImage.src;
		}
	}
	this.State = "OFF";
}

function RollOverToggle(target) {

	// change state attribute
	if (this.State == "OFF")
		this.On(target)
	else
		this.Off(target);
}

// MAIN RollOver object
function RollOver(OffSrc, OnSrc) {

	if (document.images) {
		// create on object for the 'Off' state
		this.OffImage = new Image();
		// initialize 'off' property object
		this.OffImage.src = OffSrc;

		// create on object for the 'On' state
		this.OnImage = new Image();
		// initialize 'on' property object
		this.OnImage.src = OnSrc;
	}

	// initialize attributes
	this.State = "OFF";

	// set up methods for 'On', 'Off', and 'Toggle'
	this.Off = RollOverOff;
	this.On = RollOverOn;
	this.Toggle = RollOverToggle;
}

// global to all pages (does that work here?)
arrow = new RollOver(
  "/gfx/n1_arrow_spacer.gif", 
  "/gfx/n1_arrows.gif");
  
  
  
//----------------------------------------------------------

// See KB article about changing this dynamic HTML
	function getControlTag(src)
	{
		TRok = false
		while ("HTML" != src.tagName)
		{
			if ("IMG" == src.tagName || "FONT" == src.tagName || "A" == src.tagName || "TD" == src.tagName)
			    TRok = true
			if ("LI" == src.tagName)
				return src
			if ("TR" == src.tagName)
			{
				if(TRok)
					return src
				return null
			}
			src = src.parentElement
		}
		return null
	}
	function dynOutlineEnabled(src)
	{
		while ("BODY" != src.tagName)
		{
			table = "TABLE" == src.tagName;
			if(table && src.getAttribute("border", false) != "0")
				return false;
			if("OL" == src.tagName || "UL" == src.tagName || table)
			{
				if(null != src.getAttribute("nodynamicoutline", false))
					return false
				if(null != src.getAttribute("dynamicoutline", false))
					return true
				if(mac > 0)
				{
					var at = src.outerHTML.indexOf("dynamicoutline")
					if(at > 0)
					{
						var gt = src.outerHTML.indexOf(">")
						if(at < gt)
							return true
					}
				}
			}
			src = src.parentElement
		}
		return false
	}
    function initCollapse(src)
    {
		while ("BODY" != src.tagName)
		{
			table = "TABLE" == src.tagName;
    		if(table && src.getAttribute("border", false) != "0")
    			return false;
        	if("OL" == src.tagName || "UL" == src.tagName || table)
    		{
    			if(null != src.getAttribute("initcollapsed", false))
    				return true
    		}
    		src = src.parentElement
        }
		return false
    }
	function containedIn(src, dest)
	{
		if ("!" == src.tagName)
			return true
		src = getControlTag(src)
		if (src == dest)
		    return true
		return false
	}
    function initOutline()
    {
		var ms = navigator.appVersion.indexOf("MSIE");
    	mac = navigator.appVersion.indexOf("Macintosh");
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
		if(!ie4)
			return;
        listTags = new Array()
        listTags[0]="UL"
        listTags[1]="OL"
        listTags[2]="TABLE"
        for(j=0;j<listTags.length;j++)
        {
            tagName=listTags[j]
            coll=document.all.tags(tagName)
            for(i=0; i<coll.length; i++)
            {
                if(dynOutlineEnabled(coll[i].parentElement))
                {
                    if(initCollapse(coll[i]))
                        coll[i].style.display="none"
                }
            }
        }        
    }   
	function dynOutline()
	{
		var ms = navigator.appVersion.indexOf("MSIE");
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
		if(!ie4)
			return;
		var src = event.srcElement
		src = getControlTag(src)
		if (null == src)
			return
		if (!dynOutlineEnabled(src))
			return
		var idx = src.sourceIndex+1
		while (idx < document.all.length && containedIn(document.all[idx], src))
		{
			srcTmp = document.all[idx]
			tag = srcTmp.tagName
			if ("UL" == tag || "OL" == tag || "TABLE" == tag)
				srcTmp.style.display = srcTmp.style.display == "none" ? "" : "none"
			idx++;
		}
	}
	
function days_date()
{
    var d = new Date();
    day   = d.getDay();
    date  = d.getDate();
    month = d.getMonth();
    days = new Array ('zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', '');
    numdates = new Array ('1 ','2 ','3 ','4 ','5 ','6 ','7 ','8 ','9 ','10 ','11 ','12 ','13 ','14 ','15 ','16 ','17 ','18 ','19 ','20 ','21 ','22 ','23 ','24 ','25 ','26 ','27 ','28 ','29 ','30 ','31 ');
    months = new Array ('januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december');
    document.write(days[day],', ',numdates[date-1],' ',months[month]);
}

function OpenBookmarks() {
    window.open("bookmark.htm", "nieuw", "top=5, left=5, width=320, height=590, scrollbars=1, resizable=1");
}