function embedEmail( idName ) {
	// Assumptions: 
	//   idName exists
	// 	 idName has links
	//	 email link has a title where the '@' is a '+' and the '.' is a '-'
	//	 email link rel='email'
//alert("embedEmail invoked. idName="+idName);
	if ( !document.getElementsByTagName ) return false;
	if ( !document.getElementById ) return false;
	if ( !document.getElementById( idName )) return false;
	
	// Get array of links
	var links = $( idName ).getElementsByTagName( 'a' );
	// For all links
	for ( var i=0; i < links.length; i++ ) {
		var thisLink = links[i];
		if ( !thisLink.rel ) continue;
		// If the class is email
		if ( thisLink.getAttribute( 'rel' ).toUpperCase()=='EMAIL' && thisLink.title ){
			var title = thisLink.title;
			if ( title.indexOf( '+' )!=-1 && title.indexOf( '-' )!=-1) {
				var name = title.slice( 0, title.indexOf( '+' ) );
				var domain = title.slice( title.indexOf( '+' )+1, title.indexOf( '-' ) );
				var suffix = title.slice( title.indexOf( '-' )+1, title.length );
				newTitle = name + '@' + domain + '.' + suffix;
				thisLink.href = 'mai'+'lto:' + newTitle;
				thisLink.firstChild.nodeValue = newTitle;
				thisLink.title = newTitle;
			};
		};
	};
};
function setExternalLinkage() {
//alert ("setExternalLinkage invoked");
	if ( !document.getElementsByTagName ) return false;
	var i, a;
	a = document.getElementsByTagName('a');
	for (var i=0; i < a.length; i++) if( a[i].getAttribute( 'href' )&& a[ i ].getAttribute( 'rel' ) == 'external' ) a[i].target = '_blank';
};
function setCopyrightDate ( copyrightYear) {
	if ( !document.getElementById ) return;
	if ( !document.getElementById( copyrightYear )) return;
	var copy = document.getElementById( copyrightYear );
	var copyText = document.createTextNode( new Date().getFullYear() );
	copy.replaceChild( copyText, copy.firstChild );
};

/*SearchBox UI 
function focusSearchText ( textBox ) {
	textBox.style.backgroundColor ='#FFFFFF';
	if ( document.body.id='home') {
		$('searchBox').style.backgroundImage = 'url(images/header/searchBoxHome-over.gif)';
	} else {
		$('searchBox').style.backgroundImage = 'url(../images/header/searchBox-over.gif)';
	};
};
function blurSearchText ( textBox ) {
	if ( textBox.value.length == 0) {
		textBox.style.backgroundColor ='';
		if ( document.body.id='home') {
			$('searchBox').style.backgroundImage = 'url(images/header/searchBoxHome.gif)';
		} else {
			$('searchBox').style.backgroundImage = 'url(../images/header/searchBox.gif)';
		};
	};
};
function checkSearchText ( textBox ) {
	if ( textBox.value.length >0) {
		textBox.style.backgroundColor ='#FFFFFF';
		if ( document.body.id='home') {
			$('searchGo').style.backgroundImage = 'url(images/header/magGlass-over.gif)';
		} else {
			$('searchGo').style.backgroundImage = 'url(../images/header/magGlass-over.gif)';
		};		
	} else {
		textBox.style.backgroundColor ='';
		if ( document.body.id='home') {
			$('searchGo').style.backgroundImage = 'url(images/header/magGlass.gif)';
		} else {
			$('searchGo').style.backgroundImage = 'url(../images/header/magGlass.gif)';
		};		

	};
};*/
function animateSecNav() {
	$$( '#' + document.body.id+'SecNav' + ' a' ).each( function( element ) {
		if(( element.className != document.body.className ) && ( element.className != document.body.id )) {
			if( element.className != 'header' ) {
				var fx = new Fx.Morph( element, { duration:200, wait:false });
				element.addEvent( 'mouseenter', function() {
					fx.start({
						'margin-left': 5,
						'background-color': '#d7ddd7',
						color: '#000000'
					});
				});
				element.addEvent('mouseleave', function(){
					fx.start({
						'margin-left': 0,
						'background-color': '#c6cec6',
						'color': '#AA7B00'
					});
				});
			};
		};
	});
};
function animateLinks( thisOne ) {
	$$( '#' + thisOne + ' a' ).each( function( e ) {
		if ( !e.hasClass( 'image' ) && !e.hasClass( 'emailIcon' )) {
			if( e.getParent( '.secNav' ) == null ) {
				var fx = new Fx.Morph( e, { duration:350, wait:false });
				e.addEvent( 'mouseenter', function() {
					fx.start({ 'color': '#777777', 'background-color': '#e3e7e3' }); });
				e.addEvent('mouseleave', function(){
					fx.start({ 'color': '#AA7B00', 'background-color': '#C6CEC6' }); });
			};
		};
	});
};
function invokeDropdownDisplay() {
	aboutMenu = 	SlideMenu.create( 'aboutSubNav', 'aboutBtn' );
	productsMenu =	SlideMenu.create( 'productsSubNav', 'productsBtn' );
	servicesMenu =	SlideMenu.create( 'servicesSubNav', 'servicesBtn' );
	rcssMenu =		SlideMenu.create( 'rcssSubNav', 'rcssBtn' );
	formsMenu =		SlideMenu.create( 'formsSubNav', 'formsBtn' );		
};
function setHTMLValidateLink( thisOne ) {
	if ( !document.getElementById ) return;
	if ( !document.getElementById( thisOne )) return;
	$( thisOne ).href += 'check?uri=' + window.location.href;
};
function setCSSValidateLink( thisOne ) {
	if ( !document.getElementById ) return;
	if ( !document.getElementById( thisOne )) return;
	$( thisOne ).href += 'validator?uri=' + window.location.href;
};
