_URL = '';
_POSCOUNT = 0;
_POS = 0;
_SLIDING = 0;
function slide(){
	if(! _SLIDING){
		_SLIDING = 1;
	};
	if(_POSCOUNT == _POS){
		_SLIDING = 0;
		// if(_URL){
		// 	document.location.href=_URL;
		// };
		return '';
	};
	if(_POSCOUNT < _POS) {
		_POSCOUNT++;
	} else {
		_POSCOUNT--;
	};
	// alert(_POS +':' + _POSCOUNT +':'+ _SLIDING)
	document.getElementById('logobox').style.backgroundPosition = "0px -"+ _POSCOUNT +"px";
	setTimeout("slide()",30);
};

function comeFrom(someHref){
	someHref = someHref.substr(someHref.lastIndexOf('/') + 1);
	setCookie('from',someHref);
	return true;
};


function scrollMenu(){
	somePage = getCookie('from');
	setCookie('from','');
	if (! somePage){ return ''; };

	var slideIndex = 132;
	if(somePage == 'biz.htm') { slideIndex = 0; };
	if(somePage == 'portfolio.htm') { slideIndex = 33; };
	if(somePage == 'careers.htm') { slideIndex = 66; };
	if(somePage == 'contact.htm') { slideIndex = 99; };
	_POS  = _POSCOUNT;
	_POSCOUNT = slideIndex;
	// alert(slideIndex + ':' + _POSCOUNT);
	document.getElementById('logobox').style.backgroundPosition = "0px -"+ _POS +"px";

	// return '';

	slide();
};


/**
*
* Some basic cookie reading and writing
*
*/
function setCookie(name, value, expires, path, domain, secure) {
	/* ovveride any date preference - just ave cookie last a long time */
	var d = new Date(); /* now */
	expires = new Date(d.getTime() + 12960000000); /* 150 days from now */
	var curCookie = name + "=" + value + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "");
	document.cookie = curCookie;
};

function getCookie(Name) {
	var search = Name + "=";
	if (document.cookie.length > 0) { // if there are any cookies
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // if cookie exists
			offset += search.length;
			end = document.cookie.indexOf(";", offset)
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		};
	};
	return '';
};

