var fix_w = false;
var fix_h = false;

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 setFlashWidth(w){
	if (!canResizeFlash()) return;
  if (-1 != w.indexOf("px")) setTimeout ("fixFlashWidth()", 10);
	document.getElementById("flashid").style.width = w;
}
function setFlashHeight(h){
	if (!canResizeFlash()) return;
  if (-1 != h.indexOf("px")) setTimeout ("fixFlashHeight()", 10);
	document.getElementById("flashid").style.height = h;
}
function setFlashSize(newW, newH){
	setFlashWidth(newW);
	setFlashHeight(newH);
}
function fixFlashWidth() {
	if (!canResizeFlash()) return;
  var win_w = (window.innerWidth)  ? window.innerWidth  : document.body.clientWidth;
  var div_w = document.getElementById("flashid").style.width;
  if (-1 != (p = div_w.indexOf("px")))
  {
    div_w = parseInt(div_w);
    if (div_w < win_w)
		  document.getElementById("flashid").style.width  = '100%';
	  else
			setTimeout ("fixFlashWidth()", 10);
  }
}
function fixFlashHeight() {
	if (!canResizeFlash()) return;
  var win_h = (window.innerHeight) ? window.innerHeight : document.body.clientHeight;
  var div_h = document.getElementById("flashid").style.height;
  if (-1 != (p = div_h.indexOf("px")))
  {
    div_h = parseInt(div_h);
    if (div_h < win_h)
		  document.getElementById("flashid").style.height = '100%';
	  else
			setTimeout ("fixFlashHeight()", 10);
  }
}