// we need to store the interval ID so we can stop the interval
var intervalID;



function expandHero(id,action,eValue,cValue){
/***************************************************************
Detail 	: 	The method called from the swf
***************************************************************/

    var target = (action == 'expand')?eValue:cValue;
    
    // start animation
	intervalID = setInterval("incrementSWFHeight('"+id+"', "+target+", '"+action+"')", 10);
}

 

function incrementSWFHeight(id, target, action)
/***************************************************************
Detail 	: 	Performs the animation
***************************************************************/
{
    var swf = getFlashMovieElement(id);
	if (swf){
	    if (swf.height < target && action == 'expand'){
		    swf.height = Number(swf.height) + 23;
	    }else if (swf.height > target && action == 'collapse'){
		    swf.height = Number(swf.height) - 23;
	    }else{
		    swf.height = target;
		    clearInterval(intervalID);
		    swf.callBack(action);
	    }
	}else{
		clearInterval(intervalID);
	}
}
 


function getFlashMovieElement(id)
/***************************************************************
Detail 	: 	Finds the embeded swf
***************************************************************/
{
	if (document.all){
		return document.all(id).getElementsByTagName('object')[0];
	}else if (document.getElementById){
		return document.getElementById(id).getElementsByTagName('embed')[0];
	}else{
		return null;
	}
}