
function addOnLoadFunction(func) {

	if(window.addEventListener) window.addEventListener('load', func, false); // gecko, safari, konqueror and standard
	else if(document.addEventListener) document.addEventListener('load', func, false); // opera 7
	else if(window.attachEvent) { // win/ie
		window.attachEvent('onload', func);
	} else { // mac/ie5
		if(typeof window.onload == 'function') {
			var existing = onload;
			window.onload = function() {
				existing();
				func();
			}
		} else {
			window.onload = function() {
				func();
			}
		}
	}
}


function T2W_domTT_activate() {

}

function T2W_domTT_replaceTitles(in_decorator, className) {
	if (!className) className='tooltip';
	var elements = domLib_getElementsByClass(className);
	for (var i = 0; i < elements.length; i++)
	{
		if (elements[i].title)
		{
			var content;
			if (typeof(in_decorator) == 'function')
			{
				content = in_decorator(elements[i]);
			}
			else
			{
				content = elements[i].title;
			}

			content = content.replace(new RegExp('\'', 'g'), '\\\'');
			elements[i].onmouseover = new Function('in_event', "domTT_activate(this, in_event, 'content', '" + content + "', 'type', 'greasy', 'delay', 500, 'lifetime', 0, 'offsetY', -10)");
			elements[i].title = '';
		}
	}
}

/*

caption [text|xhtml|DOM Node]
    An auto-generated caption will be created if this text is present. Set this to false when creating a sticky tip to prevent the automatic caption with close link.
content [text|xhtml|DOM Node] (required)
    The main content of the tip, which may be XHTML text.
clearMouse [boolean]
    This option flags whether the tip should attempt to avoid the mouse when the direction is south.
closeAction ['hide'|'destroy']
    Determines if the tip should be destroyed (removed from DOM) or just hidden when deactivated. (If fading is used, hiding is forced)
closeLink [text|xhtml|DOM Node]
    The text that should be used for the auto-generated close link used for sticky tips.
delay [ms]
    Time in milliseconds before the tip appears.
direction ['southeast'|'southwest'|'northeast'|'northwest'|'north'|'south']
    The position of the tip relative to the mouse.
draggable [boolean]
    Determines of the sticky tooltip can be dragged.
fade ['in'|'out'|'neither'|'both']
    Sets the alpha effect when the tip is created or destroyed.
fadeMax [0-100]
    Sets the maximum alpha that should be used for the alpha effect. (Minimum is always 0, or invisible)
grid [px]
    Snaps the trailing to a grid, so that the tip only moves after a set number of pixels.
id [string]
    The XML id that should be assigned to the tip. Using this setting allows for external manipulation of the tip.
inframe [boolean]
    Hints that the tooltip is inside an iframe, so that the tip can be manipulated from the parent frame.
lifetime [ms]
    The duration of time before the tooltip is automatically terminated, as long as it is still activated.
offsetX [px]
    The left-to-right offset from the event where the tip should be placed.
offsetY [px]
    The top-to-bottom offset from the event where the tip should be placed.
parent [DOM Node]
    The parent node on which the tip should be appended. Usually used for tips with a relative position.
position ['absolute'|'relative'|'fixed']
    The style position of the tip. (In most cases, the position is 'absolute')
predefined [string]
    A reference to a previously defined tooltip using domTT_addPredefined()
statusText [string]
    Sets the text to be used in the statusbar when the tip is activated. If used with mouseover, it is necessary to wrap the domTT_activate() call in 'return domTT_true()'.
styleClass [string]
    The class that will be assigned to the tip. The contents of the tip is assigned the class 'content' and the caption of the tip is assigned the class 'caption'.
type ['greasy'|'sticky'|'velcro']
    Sets the fate of the tip. A greasy tip disappears when a mouse out occurs on owner. A sticky tip stays active until explicitly destroyed (a caption is also forced). A velcro tip disappears when a mouse out occurs on the tip itself.
trail [true|false|'x'|'y']
    On which axis the tip should be updated when the mouse moves. A value of true updates on both axes.
lazy [boolean]
    Whether or not to enable a delay when updating the mouse position of a trailing tip (drunk tooltip).
width [px]
    A manual width for the tip.
maxWidth [px]
    A manual maximum width for the tip. (In Firefox, this is controlled by the max-width style of the element)
x [px]
    The absolute x position to be used for the tip location. This can be a calculated value, such as 'this.offsetLeft + 5'.
y [px]
    The absolute y position to be used for the tip location. This can be a calculated value, such as 'this.offsetTop + 5'.
*/

function toggleNav() {
	nel = document.getElementById('navMenu');
	mh = document.getElementById('menuHandle');
	teli = document.getElementById('navToggleImage');
	cookieName = 't2wklnv';
// 	alert(nel.className);
	if (nel.className == 'navMenuHidden') {
		nel.className = 'navMenu';
		mh.className = 'menuHandle';
		teli.src = "/knowledgelab/resources/Images/hide_nav.gif";
		SetCookie(cookieName,'show',0);
	} else {
		nel.className = 'navMenuHidden';
		mh.className = 'menuHandleHidden';
		teli.src = "/knowledgelab/resources/Images/show_nav.gif";
		SetCookie(cookieName,'hide',0);
	}
}

function submitRating(el, type) {
	if (!confirm("Remember, you may only rate this " + type + " once.\nPlease confirm your rating: " + el.value)) return false;
	el.form.submit();
}

// function in case of review and rating
function submitRatenReview(frm, type) {

	// checking the value of radiobutton
	var ratele=frm.r_Rating;

	var chk = -1;
	for (var i=0; i<ratele.length; i++) {
         if (ratele[i].checked) {
            chk = i;
         }
      }

	// checking the rating
	if(chk == -1){
		alert("Please select your rating.");
		return false;
	}

	// confirming and submitting
	reg = / /g;
  	str = frm.review.value;
  	res = str.replace(reg,"");
	reg = /\s/g;
	res = res.replace(reg,"");

	//	checking for review title
	if((res != "" && frm.title.value =="") || (res == "" && frm.title.value !="")){
		if(frm.title.value ==""){
			alert("Please type the title of your review");
			frm.title.focus();
			return false;
		}else if(res == ""){
			alert("Please type your review");
			frm.review.focus();
			return false;
		}
	}

	if(res == ""){
		if (!confirm("You have rated this " + type + " as " + ratele[chk].value + ", but chose not to review this " + type + ".\n Please click Cancel if you'd like to add a review now." )) return false;
		el.form.submit();
	}else{
		if (!confirm("Remember, you may only rate this " + type + " once.\nPlease confirm your rating: " + ratele[chk].value)) return false;
		el.form.submit();
	}
}

// function added for review rating

function submitReviewRating(el) {
		el.form.submit();
}

function addBookmark(title, url) {
	if (!_addBookmark(title, url)) {
		alert('Please use your browser\'s Add Bookmark function.');
	}
	return true;
}

function _addBookmark(title, url) {
	if (window.sidebar) {
		return window.sidebar.addPanel(title, url, "");
	} else if (document.all) {
		return window.external.AddFavorite(url, title);
	} else if (window.opera && window.print) {
		return false;
	}
}

function SetCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue)
			 + ";expires="+expire.toGMTString()
			 + ";path=/knowledgelab";
}

function browseSubmit(f, baseuri) {
	var a = baseuri.replace(' ', '_');
	sel = document.getElementById('input_subtype');
// 	sel = document.getElementById('input_subtype_plural');
	st = sel.options[sel.options.selectedIndex].value;
	if (st != '0') a += '/' + st + '/';
	f.action = a.toLowerCase();
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();
}}
