	//DATE DISPLAY AT TOP, AND IN COPYRIGHT FOOTER TEXT
	
	var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");	//predefine weekday names
	var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December");	//predefine month names
	
	var this_date_timestamp=new Date();	//get current day-time stamp
	
	var this_weekday = this_date_timestamp.getDay();	//extract weekday
	var this_date = this_date_timestamp.getDate();	//extract day of month
	var this_month = this_date_timestamp.getMonth();	//extract month
	var this_year = this_date_timestamp.getYear();	//extract year
	
	if (this_year < 1000)
		this_year+= 1900;	//fix Y2K problem
	if (this_year==101)
		this_year=2001;		//fix Netscape browsers - it displays the year as being the year 101!
	
	var this_date_string = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date + ", " + this_year;	//concat long date string
	
	//END DATE CODE
	
			
	function viewcustomer(formname,selectname){
		var thevalue;

		if(selectname == '' || selectname == null)
			selectname = 'customers';

		if(formname == '' || formname == null)
			formname = 'customerform';

		thevalue = document.forms[formname].elements[selectname].options[document.forms[formname].elements[selectname].selectedIndex].value;
		if(thevalue != 0)
			window.location.href="/customers/bios/bio.asp?customer=" + thevalue;
	}

	function selectcustomer(){
		var i;		
		var thecustomer;
		
		thecustomer = customer;
		if(thecustomer != "") {
			for(i=0;i<document.forms['customerform'].elements['customers'].options.length;i++){
				if(document.forms['customerform'].elements['customers'].options[i].value == thecustomer){
					document.forms['customerform'].elements['customers'].options[i].selected = 1;
				}
			}
		}
	}
	
	function viewpartner(formname,selectname){
		var thevalue;

		if(selectname == '' || selectname == null)
			selectname = 'partners';

		if(formname == '' || formname == null)
			formname = 'partnerform';

		thevalue = document.forms[formname].elements[selectname].options[document.forms[formname].elements[selectname].selectedIndex].value;
		if(thevalue != 0)
			window.location.href="/partners/directory/profile.asp?partner=" + thevalue;
	}

	function selectpartner(){
		var i;
		var thepartner;
		
		thepartner = partner;
		for(i=0;i<document.forms['partnerform'].elements['partners'].options.length;i++){
			if(document.forms['partnerform'].elements['partners'].options[i].value == thepartner){
				document.forms['partnerform'].elements['partners'].options[i].selected = 1;
			}
		}
	}

	function motivemedia(movie,movieid,group)
	{
		var browser;
		var windowvar;
		var leftVal;
		var topVal;
		var winWidth;
		var winHeight;

		var leftVal = 50;
		var topVal = 50;

		if(document.all)
			browser = "ie";
		else if((!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1))
			browser = "ns6";
		else
			browser = "other";

		if(movie == "" || movie == null || movie == "0")
		{
			windowvar = window.open("/motivemedia/motivemedia.asp?group=customer&movie=0&movieid=0&browser=" + browser,"motivemedia","height=368,width=765,top=" + topVal + ",left=" + leftVal);
		}
		else
		{
			group = group.replace(/ /i,"");
			windowvar = window.open("/motivemedia/motivemedia.asp?movie=" + movie + "&movieid=" + movieid + "&group=" + group + "&browser=" + browser,"motivemedia","height=368,width=765,top=" + topVal + ",left=" + leftVal);
		}

	}

	function openFlashWindow(url,width,height) {
		var tempVar;
		var tempWinVar;		
		var leftVal = (screen.width - width) / 2;
		var topVal = (screen.height - height) / 2;		
		tempWinVar = window.open(url,"flashWindow","width=" + width + ",height=" + height + ",left=" + leftVal + ",top=" + topVal);				
		
	}
	
	var flashCode;
	flashCode = '';
	
	function execFlashContent(altContent,altDestination,promptInstall)
	{
		var confirmAnswer;
		
		confirmAnswer = window.confirm("To view this page as it was intended, would you like to install the Macromedia Flash Player?");
		if(confirmAnswer){
			//document.write(flashCode);		
			document.all.flashContent.innerHTML=flashCode;
		} else {
			if(promptInstall == "altContent"){
				document.all.flashContent.innerHTML=altContent;
				//document.write(altContent);			
			} else if(promptInstall == "altDestination"){
				window.location.href=altDestination;
			}
		}
	}

	function getFlash(flashURL,width,height,name,bgcolor,minFlashVersion,altContent,altDestination,promptInstall){
		var confirmAnswer;
		//var flashCode;
		var timerVar;
		
		flashCode = '	<OBJECT	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
							'				codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' +
							'				WIDTH="' + width + '"' +
							'				HEIGHT="' + height + '"' +
							'				id="' + name + '">' +
							'		<PARAM	NAME=movie' +
							'				VALUE="' + flashURL + '">' +
							'		<PARAM	NAME=quality' +
							'				VALUE=high>' +
							'		<PARAM	NAME=bgcolor' +
							'				VALUE=' + bgcolor + '>' +
							'		<PARAM	NAME=wmode' +
							'				VALUE=transparent>' +
							'		<EMBED	src="' + flashURL + '"' +
							'				quality="high"' +
							'				bgcolor="' + bgcolor + '"' +
							'				WIDTH="' + width + '"' +
							'				HEIGHT="' + height + '"' +
							'				NAME="' + name + '"' +
							'				TYPE="application/x-shockwave-flash"' +
							'				WMODE="transparent"' + 
							'				PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
		
		if(getFlashVersion() >= minFlashVersion){
			document.write(flashCode);
		} else {
			if(promptInstall != ""){					
				if(document.all){		
					document.write("<div id='flashContent'>"+altContent+"</div>");						
					window.setTimeout("execFlashContent('"+altContent+"','"+altDestination+"','"+promptInstall+"');",1000);			
				}else{				
					confirmAnswer = window.confirm("To view the Motive home page as it was intended, would you like to install the Macromedia Flash Player?");
					if(confirmAnswer){
						document.write(flashCode);		
					} else {
						if(promptInstall == "altContent"){
							document.write(altContent);			
						} else if(promptInstall == "altDestination"){
							document.write(altContent);
							window.location.href=altDestination;
						}
					}
				}
			} else {			
				if(altContent !=""){
					document.write(	altContent);			
				} else {
					window.location.href=altDestination;
				}
			}
		}
	}

	function openImage(url,width,height)
	{
		width+=20;
		height+=60;
		var leftVal = (screen.width - width) / 2;
		var topVal = (screen.height - height) / 2;		
		var htmlString = "<html><head><link rel='stylesheet' type='text/css' href='/css/wwwmotive.css'><title>Motive, Inc.</title></head><body " +
						" marginheight='0' " +
						"	topmargin='0' " +
						"	rightmargin='0' " +
						"	bottommargin='0' " +
						"	vspace='0' " +
						"	marginwidth='0' " +
						"	leftmargin='0' " +
						"	hspace='0' " +
						"	style='margin:0; padding:0;'><br>" +
							"<center><a href='javascript:window.close();'>close this window</a></center><br>" +
							"<center><img src='" + url + "' border='0'></center>" +
							"</body></html>";
		var newWindow = window.open("","imageWindow","width=" + width + ",height=" + height + ",left=" + leftVal + ",top=" + topVal);	
		newWindow.document.write(htmlString);
	}
	
	function openPrintView(pageURL){
		if(pageURL == ''){
			pageURL = window.location.href;
		}
		if(pageURL.indexOf('?')>=0){
			pageURL+="&printView=Y";	
		}else{
			pageURL+="?printView=Y";	
		}
		var win = window.open(pageURL,"printView","top=1,left=1,height=610,width=630,scrollbars=1,resizable=1,toolbars=0");
	}

	function gotolink(inbound,url)
	{

		if((url.search(/spotlight.html/i) == -1) && (url.search(/spotlight_/i) == -1)){
			if(inbound != 'Y' && url.search(/motivation/) == -1){

				url=url.replace(/#/gi,"~");

				window.open("/include/outbound.asp?url=" + url,"Outbound","height=600,width=800,top=5,left=5,resizable");

			}
			else{

				window.location.href=url;

			}
		}
		else{
			openspotlight(url);
		}
	}				
	
	function addEvent(obj, evType, fn){ 
		if (obj.addEventListener){ 
	   		obj.addEventListener(evType, fn, false); 
	   		return true; 
	 	} else if (obj.attachEvent){ 
	   		var r = obj.attachEvent("on"+evType, fn); 
	   		return r; 
	 	} else { 
	   		return false; 
	 	} 
	}	
	
	function removeEvent( obj, type, fn )
	{
		if (obj.removeEventListener)
			obj.removeEventListener( type, fn, false );
		else if (obj.detachEvent)
		{
			obj.detachEvent( "on"+type, obj[type+fn] );
			obj[type+fn] = null;
			obj["e"+type+fn] = null;
		}
	}
	
	tabNavSelected = function() {		
		if(document.getElementById("tabnav")){
			var lis = document.getElementById("tabnav").getElementsByTagName("a");
			for (var i=0; i<lis.length; i++) {			
				if(window.location.href.indexOf(lis[i].href)>=0){			
					lis[i].className='selected';
				}
			}
		}
	}
	addEvent(window, 'load', tabNavSelected);	
	
	leftNavSelected = function() {		
		if(document.getElementById("leftnav")){
			var lis = document.getElementById("leftnav").getElementsByTagName("a");
			for (var i=0; i<lis.length; i++) {		
				if(document.title.indexOf(lis[i].innerHTML)>=0 && lis[i].className != 'header' && !(document.title=='News & Events' && lis[i].innerHTML == 'Events')){			
					// alert(lis[i].innerHTML);	
			 		//alert(lis[i].className);
					if(lis[i].className.length>0)
					{
						if(lis[i].className=='header2'){ lis[i].className='header2selected';}
					 	else{lis[i].className='onpage';}
					}
					else
					{ lis[i].className='selected';}
					
				}
			}
		}
	}
	addEvent(window, 'load', leftNavSelected);	
	
	
	rightNavHeaderLink = function() {	
		if(document.getElementById("rightnav")){
			var lis = document.getElementById("rightnav").getElementsByTagName("a");
			for (var i=0; i<lis.length; i++) {			
				if(lis[i].className.indexOf('disabledlink')>=0){																				
					var href = lis[i].getAttribute("href");
				    if(href && href != "" && href != null){
				       lis[i].setAttribute('href_bak', href);
				    }
				    lis[i].removeAttribute('href');					    
				}
			}
		}
	}
	addEvent(window, 'load', rightNavHeaderLink);
	
	
	/*HANDLE OPENING NEW WINDOWS*/
	
	
	/* Create the new window */
	function openInOutboundWindow(e) {
		var event;
		if (!e) event = window.event;
		else event = e;
		// Abort if a modifier key is pressed
		if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
			return true;
		}
		else {
			// Change "_blank" to something like "newWindow" to load all links in the same new window
		    //var newWindow = window.open(this.getAttribute('href'), '_blank');
		    var url=this.getAttribute('href').replace(/#/gi,"~");
			
			var newWindow = window.open("/include/outbound.asp?url=" + url,"Outbound","height=600,width=800,top=5,left=5,resizable");
			
			if (newWindow) {
				if (newWindow.focus) {
					newWindow.focus();
				}
				return false;
			}
			return true;
		}
	}		
	
	function openInMotiveMediaWindow(e) {
		var event;
		if (!e) event = window.event;
		else event = e;
		// Abort if a modifier key is pressed
		if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
			return true;
		}
		else {
			// Change "_blank" to something like "newWindow" to load all links in the same new window
		    //var newWindow = window.open(this.getAttribute('href'), '_blank');
		    var browser;
		    if(document.all)
				browser = "ie";
			else if((!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1))
				browser = "ns6";
			else
				browser = "other";
		    var tempClassName = this.className;
		    var tempClassNameArray = tempClassName.split("-");
		    /*if(movie == "" || movie == null || movie == "0")
			{
				windowvar = window.open("/motivemedia/motivemedia.asp?group=customer&movie=0&movieid=0&browser=" + browser,"motivemedia","height=368,width=765,top=" + topVal + ",left=" + leftVal);
			}
			else
			{*/
				tempClassNameArray[2] = tempClassNameArray[2].replace(/ /i,"");
				var newWindow = window.open("/motivemedia/motivemedia.asp?movie=" + this.getAttribute("href") + "&movieid=" + tempClassNameArray[1] + "&group=" + tempClassNameArray[2] + "&browser=" + browser,"motivemedia","height=368,width=765,top=50,left=50");
			//}
		    
		    //var url=this.getAttribute('href').replace(/#/gi,"~");
			
			//var newWindow = window.open("/include/outbound.asp?url=" + url,"Outbound","height=600,width=800,top=5,left=5,resizable");
			
			if (newWindow) {
				if (newWindow.focus) {
					newWindow.focus();
				}
				return false;
			}
			return true;
		}
	}		
	
	
	function openInFlashWindow(e) {
		var event;
		if (!e) event = window.event;
		else event = e;
		// Abort if a modifier key is pressed
		if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
			return true;
		}
		else {
			// Change "_blank" to something like "newWindow" to load all links in the same new window
		    //var newWindow = window.open(this.getAttribute('href'), '_blank');
		    var tempVar;
			var tempWinVar;		
			var tempClassName = this.className;
		    var tempClassNameArray = tempClassName.split("-");
			
			var leftVal = (screen.width - tempClassNameArray[1]) / 2;
			var topVal = (screen.height - tempClassNameArray[2]) / 2;					
		    
		    
			var newWindow = window.open(this.getAttribute("href"),"flashWindow","width=" + tempClassNameArray[1] + ",height=" + tempClassNameArray[2] + ",left=" + leftVal + ",top=" + topVal);				
			
			//var newWindow = window.open("/motivemedia/motivemedia.asp?movie=" + this.getAttribute("href") + "&movieid=" + tempClassNameArray[1] + "&group=" + tempClassNameArray[2] + "&browser=" + browser,"motivemedia","height=368,width=765,top=50,left=50");
			
		    
		    //var url=this.getAttribute('href').replace(/#/gi,"~");
			
			//var newWindow = window.open("/include/outbound.asp?url=" + url,"Outbound","height=600,width=800,top=5,left=5,resizable");
			
			if (newWindow) {
				if (newWindow.focus) {
					newWindow.focus();
				}
				return false;
			}
			return true;
		}
	}	
	
	
		/* Create the new window */
	function openInPrintWindow(e) {
		var event;
		if (!e) event = window.event;
		else event = e;
		// Abort if a modifier key is pressed
		if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
			return true;
		}
		else {
			// Change "_blank" to something like "newWindow" to load all links in the same new window
		    //var newWindow = window.open(this.getAttribute('href'), '_blank');
		    //var tempClassName = this.className;
		    //var tempClassNameArray = tempClassName.split("-");
		    var pageURL=this.getAttribute('href');
		    
		    if(pageURL == ''){
				pageURL = window.location.href;
			}
			if(pageURL.indexOf('?')>=0){
				pageURL+="&printView=Y";	
			}else{
				pageURL+="?printView=Y";	
			}
			var newWindow = window.open(pageURL,"printView","top=1,left=1,height=610,width=630,scrollbars=1,resizable=1,toolbars=0");
		
		    
		    //var url=this.getAttribute('href').replace(/#/gi,"~");
			
			//var newWindow = window.open("/include/outbound.asp?url=" + url,"Outbound","height=600,width=800,top=5,left=5,resizable");
			
			if (newWindow) {
				if (newWindow.focus) {
					newWindow.focus();
				}
				return false;
			}
			return true;
		}
	}	
	
	
	/*
	Add the openInNewWindow function to the onclick event of links with a class name of "new-window"
	*/
	function getNewWindowLinks() {
		// Check that the browser is DOM compliant
		if (document.getElementById && document.createElement && document.appendChild) {
			// Change this to the text you want to use to alert the user that a new window will be opened
			var strNewWindowAlert = " (opens in a new window)";
			// Find all links
			var links = document.getElementsByTagName('a');
			var objWarningText;
			var link;
			for (var i = 0; i < links.length; i++) {
				link = links[i];
				// Find all links with a class name of "non-html"
				//if (/\bnon\-html\b/.test(link.className)) {
				if (/\bgotolink\-N\b/.test(link.className)) {
					// Create an em element containing the new window warning text and insert it after the link text
					//objWarningText = document.createElement("em");
					//objWarningText.appendChild(document.createTextNode(strNewWindowAlert));
					//link.appendChild(objWarningText);
					//link.onclick = openInNewWindow;
					link.onclick = openInOutboundWindow;					
					//link.onclick = gotolink("N",link.getAttribute("href"));
				}else if (/\bmotivemedia/.test(link.className)) {
					link.onclick = openInMotiveMediaWindow;					
				}else if (/\bflash/.test(link.className)) {
					link.onclick = openInFlashWindow;									
				}else if (/\bprintview/.test(link.className)) {
					link.onclick = openInPrintWindow;					
				}
			}
			objWarningText = null;
		}
	}
	
	addEvent(window, 'load', getNewWindowLinks);	
	
	
	
	/*END HANDLE OPENING NEW WINDOWS*/
	
	
	/*LEGACY REGISTRATION FUNCTIONS*/
	
	function cpass()
	{
		mywin = window.open("changePassword.asp","Password",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=350');
	}
	function openSame(val)
		{
			window.location.href=val;
		}
	function openNewSame(val)
		{
			window.open(val)
		}	
	function open_window(url)
	{
		window.open(url)
	}
	
	/*END LEGACY REGISTRATION FUNCTIONS*/