function addListener(element, event, listener, bubble) {
	if(element.addEventListener){
		if(typeof(bubble)=="undefined")bubble=false;
		element.addEventListener(event,listener,bubble);
	}else if(this.attachEvent) {
		element.attachEvent("on"+event,listener);
	}
}
var myHeight=0;
function getSize() {
  if(typeof(window.innerWidth)=='number'){
    myHeight=window.innerHeight;
  } else if((document.documentElement)&&((document.documentElement.clientWidth)||(document.documentElement.clientHeight))){
    myHeight=document.documentElement.clientHeight;
  } else if((document.body)&&((document.body.clientWidth)||(document.body.clientHeight))){
    myHeight=document.body.clientHeight;
  }
}
var userAgent=navigator.userAgent.toLowerCase();
var msie6=/msie [456]/.test(userAgent)&&!/opera/.test(userAgent);

function adjust(){
	var c=document.getElementById('flash');
	if(c){
		getSize();
		if(myHeight<400)
			myHeight=400;
		c.style.height=myHeight+'px';
	}
}
function resize(){
	if(msie6)window.location.href=window.location.href;
	else adjust();
}
addListener(window,'load',adjust);
addListener(window,'resize',resize);

function swfCode(f,w,h){
	return '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+w+'" height="'+h+'">'+
'<param name="movie" value="'+f+'">'+
'<param name="quality" value="high">'+
'<param name="wmode" value="transparent">'+
'<param name="menu" value="false">'+
'<embed src="'+f+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed>'+
'</object>';
}
