zero = new Image();
zero.src = imgDir+'zero.gif';

var clientURL = "";
function gotoURL() {
	if( clientURL ) location.href = clientURL;
}

function getH (id) {
	el = document.getElementById(id);
	return (document.all)? el.offsetHeight : el.clientHeight;
}

/* ------------------------------------------------------------
	swapCient()
	handle user click on client list item
*/
function swapClient (id) {

	if( clientURL.indexOf(client[id][2])!=-1 || getH(id+'Info')==0 )
	{
		if( !toggleText(id+'Info') ) {
			id = null;
		}
	}
	setMarquee( id );
}

/* ------------------------------------------------------------
	toggleText()
	slide open the collapsed (height:0, display:none) element
*/
function toggleText (id) {
	textH = getH( id );

	if( textH==0 ) {
		YAHOO.util.Dom.setStyle( id, 'height', 'auto' );
		textH = getH( id );
		YAHOO.util.Dom.setStyle( id, 'height', '0px' );
	} else {
		textH = 0;
	}

	var anim = new YAHOO.util.Anim( id );
	anim.attributes.height = { to: textH };
	anim.duration = 0.5;
	anim.method = YAHOO.util.Easing.easeOut;
	anim.animate();
	return( textH );
}


/* ------------------------------------------------------------
	setMarquee()
	set the image src of the client screenshot image
*/
function setMarquee (id) {
	var marquee = document.getElementById('clientShot');

	if( id==null ) {
		marquee.src = zero.src;
		clientURL = "";
		document.getElementById('clientShot').style.cursor='default';
	} else {
		marquee.src = client[id][1].src;
		clientURL = "http://www."+client[id][2];
		document.getElementById('clientShot').style.cursor='pointer';
	}
}

/* ------------------------------------------------------------
	showVisit()
	show or hide the "visit site" graphic
*/
function showVisit (show) {
	vImg = document.getElementById('visit');

	if( show && clientURL!="" ) {
		vImg.style.visibility = 'visible';
	} else {
		vImg.style.visibility = 'hidden';
	}
}









