
<!--
/* begin nav */

hideElements = new Array();

// hides selectors when user rolls over horizontal dropdown

function findForm() {
	//alert('this is ie');
	//hideElements = new Array();
	for (var f=0; f<window.document.forms.length; f++) {
		var theForm = window.document.forms[f];
		for (var e=0; e<theForm.elements.length; e++) {
			var theElem = theForm.elements[e];
			if (theElem.type.substr(0,6) == "select") {
				hideElements.push(theElem);		
			}
		}
	}
}

function initnav(obj) {
	var av = navigator.appVersion.toLowerCase();
	var platform;
	// check platform
	if (av.indexOf("mac") != -1) {
		platform = "mac";
	} else if (av.indexOf("windows") != -1) {
		platform = "win";
	}
	var isIE = (navigator.appName == "Microsoft Internet Explorer");
	if (document.getElementById && document.getElementById(obj)) {
		navRoot = document.getElementById(obj);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			// make sure drop downs don't extend past 780
			if (node.offsetLeft > 775) {
				var adjust = 775-node.offsetLeft;
				for (var j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].nodeName.toUpperCase() == 'UL') {
						node.childNodes[j].style.left = adjust+'px';
					}
				}
			}
			node.onmouseover = function() {
				if ((this.className.indexOf('lo') != -1) || (this.className.indexOf('current') != -1) ) {
					// set a flag for current
					if (this.className.indexOf('current') != -1) {
						// check if it is wide
						if (this.className.indexOf('wide') != -1) {
							if(this.className.indexOf('last') != -1){
								this.className = 'hi_current_wide last';
							} else {
								this.className = 'hi_current_wide';
							}
						} else if (this.className.indexOf('last') != -1){
							this.className = 'hi_current last';
						} else {
							this.className = 'hi_current';
						}
					} else if (this.className.indexOf('wide') != -1) {
						if(this.className.indexOf('last') != -1){
							this.className = 'hi_wide last';
						} else {
							this.className = 'hi_wide';
						}
					} else {
						if(this.className.indexOf('last') != -1){
							this.className = 'hi last';
						} else {
							this.className = 'hi';
						}
					}
					if (isIE) {		
						for (e=0; e<hideElements.length; e++) {
							/* To hide a select box in IE give the select an id and reference it here.  You'll have to add some logic */
							if (hideElements[e].id){														
								var formElem = document.getElementById(hideElements[e].id);				 
							} else {
								formElem = null;	
							}
							if (formElem != null) {
								formElem.style.visibility = 'hidden';
							}
						}		
					}
				}
			}
			node.onmouseout = function() {
				if ((this.className.indexOf('hi') != -1) || (this.className.indexOf('hi_current') != -1)) {					
					if (this.className.indexOf('hi_current') != -1) {
						if (this.className.indexOf('wide') != -1) {
							if(this.className.indexOf('last') != -1){
								this.className = 'current_wide last';
							} else {
								this.className = 'current_wide';	
							}
						} else if(this.className.indexOf('last') != -1){
							this.className = 'current last';
						} else {
							this.className = 'current';	
						}
					} else if (this.className.indexOf('hi_wide') != -1) {
						if(this.className.indexOf('last') != -1){
							this.className = 'lo_wide last';
						} else {
							this.className = 'lo_wide';	
						}
					} else {
						if(this.className.indexOf('last') != -1){
							this.className = 'lo last';
						} else {
							this.className = 'lo'
						}
					}	
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							/* To hide a select box in IE give the select an id and reference it here.  You'll have to add some logic */
							if (hideElements[e].id){														
								var formElem = document.getElementById(hideElements[e].id);				 
							} else {
								formElem = null;	
							}
							if (formElem != null) {
								formElem.style.visibility = 'visible';
							}
						}					
					}
				}
			}
		}
	}
	if (navigator.appName == "Microsoft Internet Explorer" && platform != "mac") {
		isIE = true;
		window.attachEvent("onload", findForm);
		//window.onload = findForm;
	}
}

/* end nav */


/*		Show/Hide 		*/
var learn1 = new Array();
var learn2 = new Array();
var learn3 = new Array();
var learn4 = new Array();
var learnobjects = 0;
function getLearnObjects(parentObject, arr) {
		learnParent = document.getElementById(parentObject);
		learnArray = arr;
		if (learnParent.hasChildNodes) 
		{	
			for (i=0; i < learnParent.childNodes.length; i++) 
			{
			if (learnParent.childNodes[i].nodeType == 1) 
				{
					learnArray[learnobjects] = learnParent.childNodes[i].attributes.id.nodeValue;
					learnobjects++;
				}
			}
		}	
		learnobjects = 0;
}

function showLearnItems(arr, item)
{
	for (i=0; i < arr.length; i++)
	{
		document.getElementById(arr[i]).style.display = 'none';
		show(item);
	}
}

function selectArrow(item)
{
	listParent = item.parentNode;
	if (listParent.hasChildNodes) 
	{	
		for (i=0; i < listParent.childNodes.length; i++) 
		{
		if ((listParent.childNodes[i].className != 'triggerTitle') && (listParent.childNodes[i].className == 'selected')) 
			{ 
				listParent.childNodes[i].className = 'static';
			}
		}
	}	
	item.className = 'selected';
}

function showPillarPane(item)
{
	for (i=1; i < 5; i++) 
	{
		document.getElementById('campaignContainer_' + i.toString()).style.display = 'none';
	}
	show(item);
}

function show(item) 
{
	document.getElementById(item).style.display='block'
}


function hide(item) 
{
		document.getElementById(item).style.display='none'
}

function timeHide(item)
{
	window.setTimeout("hide('" + item + "')", 1000);
}

//Added - JJ

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

function onSearchClick(){
	if (!validateSearch()){
	}
	else{
		searchTrack();
		document.searchForm.submit();
	}
}

function createInputParam(name, value) {
                var el = document.createElement('input');
                el.type = 'hidden';
                el.name = name;
                el.value = value;
                return el;
}

function validateSearch(){
	if (document.searchForm.q.value==null || document.searchForm.q.value.length<1 || trim(document.searchForm.q.value)==''){
			return false;
	}
	else{
			var form = document.forms['searchForm'];
			form.appendChild(createInputParam('entqr', '3'));
			form.appendChild(createInputParam('client', 'default_frontend'));
			form.appendChild(createInputParam('proxystylesheet', 'default_frontend'));
			form.appendChild(createInputParam('output', 'xml_no_dtd'));
			return true;
	}
}


function submitSearch(){
	if (!validateSearch()){
		return false;
	}
	else{
		searchTrack();
	}
}

function searchTrack(){
	if (typeof (onSearchSubmit) == "function") {
		    onSearchSubmit(document.searchForm);
	}
}

-->



   



