function __alert( _field, _label, _custom ) {
	if ( _field.focus )
		_field.focus();
	alert( _custom ? _custom : ( '\'' + _label + '\' is a required field.' ) );
	}
function __change_country( _s ) {
	var _ca, _other, _postal_code_label, _state_label, _us;

	_ca = document.getElementById( 'state-ca' );
	_other = document.getElementById( 'state-other' );
	_postal_code_label = document.getElementById( 'postal-code-label' );
	_state_label = document.getElementById( 'state-label' );
	_us = document.getElementById( 'state-us' );
	if ( _s.options[ _s.selectedIndex ].value == 'Canada' ) {
		_other.style.display = _us.style.display = 'none';
		_postal_code_label.innerHTML = 'Postal Code';
		_state_label.innerHTML = 'Province<span class="ff-v highlight">*</span>';
		_ca.style.display = 'block';
		}
	else if ( _s.options[ _s.selectedIndex ].value == 'United States' ) {
		_ca.style.display = _other.style.display = 'none';
		_postal_code_label.innerHTML = 'ZIP Code';
		_state_label.innerHTML = 'State<span class="ff-v highlight">*</span>';
		_us.style.display = 'block';
		}
	else {
		_ca.style.display = _us.style.display = 'none';
		_postal_code_label.innerHTML = 'Postal Code';
		_state_label.innerHTML = 'State<span class="ff-v highlight">*</span>';
		_other.style.display = 'block';
		}
	};
function __enter( _this ) {
	var _hover = document.getElementById( 'hover' );

	_this.appendChild( _hover );
	_hover.style.display = 'block';
}
function __enter_out( _this ) {
	document.getElementById( 'hover' ).style.display = 'none';
	}
function __home_init() {
	__init();
	__ticker();
	$( '#prove-it' )
		.click( function () { __link( '/company/prove_it/' ); } )
		.hover( __hover_toggle, __hover_toggle );
	$( '#sign-up' )
		.click( function () { __link( '/news_alerts/' ); } )
		.hover( __hover_toggle, __hover_toggle );
	}
function __hover_toggle() {
	$( this ).find( '.hover' ).toggle();
	};
function __init() {
	$( '.link' )
		.wrap( '<span class="link-wrap"></span>' );
	$( '.link-wrap' )
		.append( '<span>►</span>' )
		.click( __link_click )
		.hover( __link_hover, __link_hover );
	$( '#company' ).click( function () { __link( '/company/' ) } );
	$( '#contact' ).click( function () { __link( '/contact/' ) } );
	$( '#knowledge-center' ).click( function () { __link( '/knowledge_center/' ) } );
	$( '#logo' ).click( function () { __link( '/' ) } );
	$( '#nav div' )
		.hover( __nav_hover, __nav_hover_off );
	$( '#site-map' ).click( function () { __link( '/site_map/' ) } );
	$( '#technology' ).click( function () { __link( '/technology/' ) } );
	__preload( '/i/nav_links_hover.gif' );
	}
function __link( _href ) {
	window.location = _href;
	}
function __link_click() {
	__link( $( this ).find( 'a' ).attr( 'href' ) );
	}
function __link_hover() {
	$( this ).find( 'a' ).toggleClass( 'td-u' );
	}
function __nav_hover() {
	$( this ).css( 'backgroundImage', 'url( /i/nav_links_hover.gif )' );
	}
function __nav_hover_off() {
	if ( ! $( this ).hasClass( 'current' ) ) {
		$( this ).css( 'backgroundImage', 'url( /i/nav_links.gif )' );
		}
	}
function __news_alerts_init() {
	__page_init();
	$( '#submit' )
		.click( __news_alerts_validate )
		.hover( __submit_hover, __submit_hover_off );
	$( 'form input' ).focus();
	}
function __news_alerts_validate() {
	var _f = document.forms[ 0 ];

	if ( _f.email.value ) __post();
	else __alert( _f.email, 'Email' );
	}
function __page_init() {
	__init();
	$( '#visit-knowledge-center' )
		.click( function () { __link( '/knowledge_center/' ); } )
		.hover( __hover_toggle, __hover_toggle );
	$( '#winning-strategies' )
		.click( function () { __link( '/company/winning_formula/' ); } )
		.hover( __hover_toggle, __hover_toggle );
	}
function __post( _hiddenO ) {
	var _e,
		_f = document.forms[ 0 ],
		_prop;

	if ( ! _f._busy ) {
		_f._busy = true;

	    if ( ! _hiddenO )
	        _hiddenO = { };

	    for ( _prop in _hiddenO ) {
	        _e = document.createElement( 'input' );
	        _e.name = _prop;
	        _e.type = 'hidden';
	        _e.value = _hiddenO[ _prop ];
	        _f.appendChild( _e );
	        }

		_f.submit();
		}
	}
function __preload( _src ) {
	jQuery( '<img>' ).attr( 'src', _src );
	}
function __prove_it_init() {
	__page_init();
	$( '#submit' )
		.click( __prove_it_validate )
		.hover( __submit_hover, __submit_hover_off );
	$( 'form input:first' ).focus();
	}
function __prove_it_validate() {
	var _f = document.forms[ 0 ];

	if ( _f.first_name.value )
		if ( _f.last_name.value )
			if ( _f.company.value )
				if ( _f.country.selectedIndex ) {
					if ( _f.country.options[ _f.country.selectedIndex ].value == 'Canada' ) {
						if ( ! _f.state_ca.selectedIndex ) return __alert( _f.state_ca, 'Province' );
						}
					else if ( _f.country.options[ _f.country.selectedIndex ].value == 'United States' ) {
						if ( ! _f.state_us.selectedIndex ) return __alert( _f.state_us, 'State' );
						}
					else if ( ! _f.state_other.value ) return __alert( _f.state_other, 'State' );
					if ( _f.phone.value )
						if ( _f.email.value ) __post();
						else __alert( _f.email, 'Email' );
					else __alert( _f.phone, 'Phone' );
					}
				else __alert( _f.country, 'Country' );
			else __alert( _f.company, 'Company' );
		else __alert( _f.last_name, 'Last Name' );
	else __alert( _f.first_name, 'First Name' );
	}
function __submit_hover() {
	$( this ).css( 'backgroundPosition', '0 -23px' );
	}
function __submit_hover_off() {
	$( this ).css( 'backgroundPosition', '0 0' );
	}
function __ticker( _bac ) {
	if ( _tim )
		clearTimeout( _tim );
	_idx = _bac ? ( _idx ? ( _idx - 1 ) : ( _hea.hs.length - 1 ) ) : ( ( _idx == ( _hea.hs.length - 1 ) ) ? 0 : ( _idx + 1 ) );
	$( '#ticker a' ).html( '<a href="' + _hea.hs[ _idx ][ 0 ] + '">' + _hea.hs[ _idx ][ 1 ] + '</a>' );
	_tim = setTimeout( __ticker, 5000 );
	};