function getswf(swfname, swfWidth, swfHeight, swfParams) {
	finalWidth = swfWidth;
	finalHeight = swfHeight;
	
	var iw, ih;
	/*if (window.innerWidth == undefined) {
		iw = document.body.offsetWidth;
		ih = document.body.offsetHeight;
	}
	else {
		iw = window.innerWidth;
		ih = window.innerHeight;
	}
	
	if (iw - 40 < swfWidth || ih - 40 < swfHeight) {
		ratio = swfWidth/swfHeight;
		width = iw - 40;
		height = ih - 40;
		if (width/height < ratio) {
			finalWidth = width;
			finalHeight = width/ratio;
		}
		else {
			finalHeight = height;
			finalWidth = height*ratio;
		}
	}*/
	swfParams += '&fs=' + gup('fs');
	if (gup('target') != "") {
		swfParams += '&target=' + gup('target');
	}
	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="'+finalWidth+'" height="'+finalHeight+'" id="'+swfname+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+swfname+'" />');
	document.write('<param name="FlashVars" value="'+swfParams+'" />');
	document.write('<param name="quality" value="high" /><embed src="'+swfname+'" FlashVars="'+swfParams+'" quality="high" width="'+finalWidth+'" height="'+finalHeight+'" name="'+swfname+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function gup( name ) {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function newwin(location,name,w,h)
{
var scrw=(screen.width/2)-(w/2);
var scrh=(screen.height/2)-(h/2);
window.open(location,name,'scrollbars,left='+scrw+',top='+scrh+',width='+w+',height='+h);
}

