
  /*
    Methods for resizing the flash stage at runtime.

    setFlashWidth(divid, newW)
    divid: id of the div containing the flash movie.
    newW: new width for flash movie

    setFlashWidth(divid, newH)
    divid: id of the div containing the flash movie.
    newH: new height for flash movie

    setFlashSize(divid, newW, newH)
    divid: id of the div containing the flash movie.
    newW: new width for flash movie
    newH: new height for flash movie

    canResizeFlash()
    returns true if browser supports resizing flash, false if not.
  */

    function setFlashWidth(divid, newW){
    	document.getElementById(divid).style.width = newW+"px";
    }
    function setFlashHeight(divid, newH){
    	//alert(newH);
    	document.getElementById(divid).style.height = newH+"px";
    }
    function setFlashSize(divid, newW, newH){
    	setFlashWidth(divid, newW);
    	setFlashHeight(divid, newH);
    }
    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;
    }


  function text(root,textsource)
    {
      e = canResizeFlash();
      document.write('<div id="flashtext"> ');
      document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="text" valign="top" align="middle">');
      document.write('<param name="allowScriptAccess" value="sameDomain" />');
      document.write('<param name="FlashVars" value="allowResize='+e+'" />');
      document.write('<param name="movie" value="' + root + 'text.swf?textsource='+textsource+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="' + root + 'text.swf?textsource='+textsource+'" quality="high" wmode="transparent" width="100%" height="100%" name="text" valign="top" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
      document.write('</object> ');
      //document.write('<object data="' + root + 'text.swf?textsource='+textsource+'" width="100%" height="100%" type="application/x-shockwave-flash">');
      //document.write('<param name="movie" value="' + root + 'text.swf?textsource='+textsource+'" />');
      //document.write('<param name="FlashVars" value="allowResize='+e+'" />');
      //document.write('Flash Movie With Resizing Content');
      //document.write('</object>');
      document.write('</div> ');
    }



