
function displayBubble( ev, eId , wid, hei ){

	bubbleObj = $(eId);
	
	mouseX = (Event.pointerX(ev) + 20);
	mouseY = (Event.pointerY(ev) - 10);
	
	
	bubbleObj.style.left = mouseX+"px";
	bubbleObj.style.top = mouseY+"px";
	bubbleObj.style.width = wid;
	if( hei ){ bubbleObj.style.height = hei; }
	
	bubbleObj.style.visibility = "visible";
	
	//Disable all the select inputs
	//selObjs = new Form.getInputs("former1");
}

function killBubble( oid ){
	$(oid).style.visibility = "hidden";
}







/***************************************************/
// figurehead cover rotator startup
function coverInit() {
	
	//Front Cover
	coverList["frontCover"] = { cached:false }
	coverList["backCover"] = { cached:false }
	coverList["currentCover"] = "backCover";

	coverList["frontCover"].img = new Image();
	coverList["frontCover"].img.onload = function(){ coverCacheDone("frontCover"); }
	coverList["frontCover"].img.src = coverImagePath+"/figureheadFrontSmall.jpg";

	//Back Cover
	coverList["backCover"].img = new Image();
	coverList["backCover"].img.onload = function(){ coverCacheDone("backCover"); }
	coverList["backCover"].img.src = coverImagePath+"/figureheadBackSmall.jpg";
	//coverList["backCover"].img.src = coverImagePath+"/ippySmall.jpg";
	
	
	return true;
}


/***************************************************/
// cache done.. start it up
function coverCacheDone( c ) {
	
	//Check to see if we have a container
	//if( ! (coverObj = $("cover") )) { return true; }
	//if( ! (coverImg = $("coverImage") )) { return true; }
	
	//Set this as cached
	coverList[c].cached = true;
	
	//if both are cached then set it up
	if( coverList["frontCover"].cached != true || coverList["backCover"].cached != true ) { return true; }
	
	//It's ready to go so do our swap
	coverSwap();
}

/***************************************************/
//Close our cover
function coverClose() {
	//Assign done effect function
	effectFinishFunc = new Function("coverSwap()");
	effectOpts = "afterFinish:effectFinishFunc";
			
	//Close Card
	eval("new Effect.Fade('cover', {"+effectOpts+"});");
}


/***************************************************/
//Swap covers and show them
function coverSwap() {

	//Our cover should be closed now
	
	//Determine which one should be swapped
	coverList["currentCover"] = coverList["currentCover"] == "frontCover" ? "backCover" : "frontCover";

	//Swap the image
	$("coverImage").src = coverList[coverList["currentCover"]].img.src;

	//start up timer for close
	effectOpts = "afterFinish:coverCloseTimer";
	eval("new Effect.Appear('cover', {"+effectOpts+"});");

	return true;
}


/***************************************************/
// start the close timer for the card
function coverCloseTimer() {

	//Kill timer just in case
	clearTimeout(coverTimer);
	
	//Startup a new timer for closing the cover
	coverTimer = window.setTimeout("coverClose();", 4000);	
	
	return true;
}




