/* 
Methods for resizing the flash stage at runtime.
Original code example by http://www.mustardlab.com/developer/flash/objectresize/

- updated to reference prototype, 
- and added flashid so that we can resize the containing div where the flash is written out, and the flash element as well
- in the ultimate tag cloud we are only updating the height. The width remains constant. But these functions allow for both

*/
function setFlashWidth(divid, flashid, newW){
	$(divid).style.width = newW+"px";
	$(flashid).style.width = newW+"px";
}
function setFlashHeight(divid, flashid, newH){
	$(divid).style.height = newH+"px";		
	$(flashid).style.height = newH+"px";		
}
function setFlashSize(divid, flashid, newW, newH){
	setFlashWidth(divid, flashid, newW);
	setFlashHeight(divid, flashid, newH);
}

/* Check if we can run the code or not */
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}