function LogoHover(idName, state) {
	myObject = GetObject ( idName );
	if (state == 'On') {
		myObject.style.cursor = 'pointer';
		myObject.src=logo2.src
	} else {
		myObject.style.cursor = 'auto';
		myObject.src=logo1.src
	}
}

function NavigationHover(idName, state) {

           myObject = GetObject ( idName );

           if (myObject.className == 'NavigationOn') {

                       myObject.style.cursor = 'auto';

           } else if (state =='On') {

                       myObject.style.cursor = 'auto';

                       myObject.className = 'NavigationOn';

           } else if (state =='Hover') {

                       myObject.style.cursor = 'pointer';

                       myObject.className = 'NavigationHover';

           } else if (state =='HoverRed') {

                       myObject.style.cursor = 'pointer';

                       myObject.className = 'NavigationHoverRed';

           } else if (state =='OffRed') {

                       myObject.style.cursor = 'pointer';

                       myObject.className = 'NavigationOffRed';

           } else {

                       myObject.style.cursor = 'auto';

                       myObject.className = 'NavigationOff';

           }

}


function NavigationClick(url, target) {
	var windowReference;
	if (target=='') {
		window.location = url;
	} else {
		windowReference = window.open (url, target);
	}
}



function ButtonColor(BTN,COLOR) {
   window.document.forms[0].elements[BTN].style.backgroundColor = COLOR;
}



function GetObject ( idName ) {
	if (document.layers) {
		// Netscape 4
		return document.layers[ idName ];
	} else if (navigator.userAgent.indexOf('Opera') != -1) {
		// Opera
		return document.all[ idName ];
	} else if (document.all && !document.getElementById) {
		// Explorer 4
		return document.all[ idName ];
	} else if (document.getElementById) {
		// Netscape 6 & Explorer 5
		return document.getElementById( idName );
	}
}

function DisplayAllBlocks(display, blockNames) {
	for (var i=0; i<blockNames.length; i++) {
		DisplayBlock(blockNames[i], display);
	}
}

function DisplayBlock(idName, display) {
	myObject = GetObject ( idName );
	myObject.style.display = display;
}

function MinimalScreen(URLString){
	
	var winWidth;
	var winHeight;

	if (document.all) {
	    winWidth = screen.width;
	    winHeight = screen.height;
	} else if (document.layers) {
	    winWidth = window.innerWidth;
	    winHeight = window.innerHeight;
	}

	windowProperties = '';
	windowProperties = windowProperties + 'fullscreen=no,';
	windowProperties = windowProperties + 'toolbar=no,';
	windowProperties = windowProperties + 'location=no,';
	windowProperties = windowProperties + 'directories=no,';
	windowProperties = windowProperties + 'status=no,';
	windowProperties = windowProperties + 'menubar=no,';
	windowProperties = windowProperties + 'scrollbars=no,';
	windowProperties = windowProperties + 'resizable=yes,';
	windowProperties = windowProperties + 'top=10,';
	windowProperties = windowProperties + 'left=10,';
	windowProperties = windowProperties + 'width=' + (winWidth-30) + ',';
	windowProperties = windowProperties + 'height=' + (winHeight-90);
	win = window.open(URLString, '', windowProperties);
}


function PopDialog(URLString, winWidth, winHeight){
	LeftPosition = (screen.width) ? (screen.width-winWidth)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-winHeight)/2 : 0;
	
	windowProperties = '';
	windowProperties = windowProperties + 'fullscreen=no,';
	windowProperties = windowProperties + 'toolbar=no,';
	windowProperties = windowProperties + 'location=no,';
	windowProperties = windowProperties + 'directories=no,';
	windowProperties = windowProperties + 'status=no,';
	windowProperties = windowProperties + 'menubar=no,';
	windowProperties = windowProperties + 'scrollbars=no,';
	windowProperties = windowProperties + 'resizable=no,';
	windowProperties = windowProperties + 'top='+ TopPosition + ',';
	windowProperties = windowProperties + 'left=' + LeftPosition + ',';
	windowProperties = windowProperties + 'width=' + winWidth + ',';
	windowProperties = windowProperties + 'height=' + winHeight;
	win = window.open(URLString, '', windowProperties);
}

function PopWindow(URLString){
	
	var winWidth;
	var winHeight;

	if (document.all) {
	    winWidth = screen.width;
	    winHeight = screen.height;
	} else if (document.layers) {
	    winWidth = window.innerWidth;
	    winHeight = window.innerHeight;
	}

	windowProperties = '';
	windowProperties = windowProperties + 'fullscreen=no,';
	windowProperties = windowProperties + 'toolbar=yes,';
	windowProperties = windowProperties + 'location=yes,';
	windowProperties = windowProperties + 'directories=yes,';
	windowProperties = windowProperties + 'status=yes,';
	windowProperties = windowProperties + 'menubar=yes,';
	windowProperties = windowProperties + 'scrollbars=yes,';
	windowProperties = windowProperties + 'resizable=yes,';
	windowProperties = windowProperties + 'top=10,';
	windowProperties = windowProperties + 'left=10,';
	windowProperties = windowProperties + 'width=800,';
	windowProperties = windowProperties + 'height=600';
	win = window.open(URLString, '', windowProperties);
}

function doOpenAccessAgreement(w,h) {
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	window.open('/KnowledgeLeader/Content.nsf/Web+Content/AboutAccessAgreementPopUp?OpenDocument','','location=no,fullscreen=no,toolbar=no,resizable=yes,menubar=no,scrollbars=yes,status=no,height='+h+',width='+w+',left='+LeftPosition+',top='+TopPosition+' ');
}

function WinStatus(statusString){
	window.status = statusString;
	return true;
}


function Trim(sString){
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}

function LeftTrim(sString){
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	return sString;
}

function RightTrim(sString){
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}

function YBSearch() {
	var YBSearchFieldValue = document.forms[0].YBSearchField.value;
	if (YBSearchFieldValue != "") {
		location.href = "http://prtv.yellowbrix.com/pages/prtv/Search.nsp?srQuery=" + YBSearchFieldValue;
	} else {
		alert("Please enter the search criteria");
		document.forms[0].YBSearchField.focus();
	}
}