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 WriteFlash(SWFfile, width, height, parameterName, parameterValue)
{
	var d = new Date();
	var cacheTime = d.getTime();
	
	SWFfile = SWFfile + '?cacheTime=' + cacheTime;
	
	if (parameterName != '')
	{
		SWFfile = SWFfile + '&' + parameterName + '=' + parameterValue;
	}
	
	e = canResizeFlash();	

//	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="100%">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');	
    document.write('<param name="movie" value="'+SWFfile+'">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="WMode" value="transparent">');
//    document.write('<embed src="'+SWFfile+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="100%"></embed>');
    document.write('<embed src="'+SWFfile+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');	
    document.write('</object>');
    
}
