<!-- 

addEvent(window, 'load', tinit);

function tinit() {
	toggle_init();
	jsinit();
	}

function jsinit() {
	var jselements = document.getElementsByTagName('div');
	for (var i = 0; i < jselements.length; i++) {
		if (/\bshow\b/.exec(jselements[i].className)) {
			jselements[i].style.display = "block";
		}
		if (/\bhide\b/.exec(jselements[i].className)) {
			jselements[i].style.display = "none";
		}
	}
}


// based on easytoggle2.js at http://simon.incutio.com/archive/2003/11/06/easytoggle

var toggle_toggleElements = [];
var toggle_toggleElements1 = [];
var toggle_toggleElements2 = [];
function toggle_init() {
    var i, link, id, target, first, first1, first2;
	first = true;
	first1 = true;
	first2 = true;
    for (i = 0; (link = document.links[i]); i++) {  // loop through all links

        if (/\btoggle\b/.exec(link.className)) {  // looking for classes than include "toggle"
            id = link.href.split('#')[1];
            target = document.getElementById(id);
            toggle_toggleElements[toggle_toggleElements.length] = target;
			if (first == true) { // if first tab
				if (/\bshow\b/.exec(target.className)) {  // and this panel is already displayed
					link.className = "toggle on";  // then highlight the corresponding link
					first = false;  // and reset first flag
				}
			} else {
				target.className = "panel hide"; // we probably have a default, so hide any extra "show" panels
			}
        	link.onclick = toggle;  
		}

        if (/\btoggle1\b/.exec(link.className)) {  // looking for classes than include "toggle"
            id = link.href.split('#')[1];
            target = document.getElementById(id);
            toggle_toggleElements1[toggle_toggleElements1.length] = target;
			if (first1 == true) { // if first tab
				if (/\bshow\b/.exec(target.className)) {  // and this panel is already displayed
					link.className = "toggle1 on";  // then highlight the corresponding link
					first1 = false;  // and reset first flag
				}
			} else {
				target.className = "panel hide"; // we probably have a default, so hide any extra "show" panels
			}
        	link.onclick = toggle1;  
		}

        if (/\btoggle2\b/.exec(link.className)) {  // looking for classes than include "toggle"
            id = link.href.split('#')[1];
            target = document.getElementById(id);
            toggle_toggleElements2[toggle_toggleElements2.length] = target;
			if (first2 == true) { // if first tab
				if (/\bshow\b/.exec(target.className)) {  // and this panel is already displayed
					link.className = "toggle2 on";  // then highlight the corresponding link
					first2 = false;  // and reset first flag
				}
			} else {
				target.className = "panel hide"; // we probably have a default, so hide any extra "show" panels
			}
        	link.onclick = toggle2;  
		}

    }
}
function toggle(e) {
	/* We need to know which link was activated when the function was called
	   this will allow us to identify the panel which should be displayed.
       Adapted from http://www.quirksmode.org/js/events_properties.html */
	if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return true;
    }
    /* For most browsers, targ would now be a link element; Safari however
       returns a text node so we need to check the node type to make sure */
    if (source.nodeType == 3) {
        source = source.parentNode;
    }
	for (i = 0; (link = document.links[i]); i++) {
		if (/\btoggle\b/.exec(link.className)) {
			link.className="toggle";
		}
	}
	source.className="toggle on";
    var id = source.href.split('#')[1];
    var elem;
    for (var i = 0; (elem = toggle_toggleElements[i]); i++) {
        if (elem.id != id) {
            elem.style.display = 'none';
        } else {
            elem.style.display = 'block';
        }
    }
    return false; // overrides the href for javascript-enabled browsers
}

function toggle1(e) {
	/* We need to know which link was activated when the function was called
	   this will allow us to identify the panel which should be displayed.
       Adapted from http://www.quirksmode.org/js/events_properties.html */
	if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return true;
    }
    /* For most browsers, targ would now be a link element; Safari however
       returns a text node so we need to check the node type to make sure */
    if (source.nodeType == 3) {
        source = source.parentNode;
    }
	for (i = 0; (link = document.links[i]); i++) {
		if (/\btoggle1\b/.exec(link.className)) {
			link.className="toggle1";
		}
	}
	source.className="toggle1 on";
    var id = source.href.split('#')[1];
    var elem;
    for (var i = 0; (elem = toggle_toggleElements1[i]); i++) {
        if (elem.id != id) {
            elem.style.display = 'none';
        } else {
            elem.style.display = 'block';
        }
    }
    return false; // overrides the href for javascript-enabled browsers
}

function toggle2(e) {
	/* We need to know which link was activated when the function was called
	   this will allow us to identify the panel which should be displayed.
       Adapted from http://www.quirksmode.org/js/events_properties.html */
	if (typeof e == 'undefined') {
        var e = window.event;
    }
    var source;
    if (typeof e.target != 'undefined') {
        source = e.target;
    } else if (typeof e.srcElement != 'undefined') {
        source = e.srcElement;
    } else {
        return true;
    }
    /* For most browsers, targ would now be a link element; Safari however
       returns a text node so we need to check the node type to make sure */
    if (source.nodeType == 3) {
        source = source.parentNode;
    }
	for (i = 0; (link = document.links[i]); i++) {
		if (/\btoggle2\b/.exec(link.className)) {
			link.className="toggle2";
		}
	}
	source.className="toggle2 on";
    var id = source.href.split('#')[1];
    var elem;
    for (var i = 0; (elem = toggle_toggleElements2[i]); i++) {
        if (elem.id != id) {
            elem.style.display = 'none';
        } else {
            elem.style.display = 'block';
        }
    }
    return false; // overrides the href for javascript-enabled browsers
}

/* Thanks to Scott Andrew */
function addEvent(obj, evType, fn){
    if (obj.addEventListener) {
        obj.addEventListener(evType, fn, true);
        return true;
    } else if (obj.attachEvent) {
        var r = obj.attachEvent("on"+evType, fn);
        return r;
    } else {
	    return false;
    }
}
