function doEmbedFlash(url, w, h, trans, vars) {
	if (trans == 1) {
		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="' + w + '" height="' + h + '" align="middle"><param name="movie" value="' + url + '" /><param name="flashvars" value="' + vars + '" /><param name="quality" value="high" /><param name="wmode" value="transparent"><embed src="' + url + '" flashvars="' + vars + '" quality="high" wmode="transparent" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	} else {
		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="' + w + '" height="' + h + '" align="middle"><param name="movie" value="' + url + '" /><param name="flashvars" value="' + vars + '" /><param name="quality" value="high" /><embed src="' + url + '" flashvars="' + vars + '" quality="high" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	}
}

function doEmbedTube(id,start) {
  if (!start) var start = 0;
  document.write('<iframe class="youtube-player" type="text/html" width="1280" height="750" src="http://www.youtube.com/embed/'+id+'?start='+start+'&hd=1" frameborder="0"></iframe>');
}

function doEmbedFlashGH(url, w, h, trans, vars) {
	if (trans == 1) {
		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="' + w + '" height="' + h + '" align="middle"><param name="movie" value="' + url + '" /><param name="flashvars" value="' + vars + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent"><embed src="' + url + '" flashvars="' + vars + '" quality="high" menu="false" wmode="transparent" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	} else {
		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="' + w + '" height="' + h + '" align="middle"><param name="movie" value="' + url + '" /><param name="flashvars" value="' + vars + '" /><param name="quality" value="high" /><param name="menu" value="false" /><embed src="' + url + '" flashvars="' + vars + '" quality="high" menu="false" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	}
}

function doUnity(url, w, h) {
	id = Math.floor(Math.random()*100001);
	document.write('<div id="unity'+id+'" style="display: none;"><div class="missing"><a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!"><img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" /></a></div></div>');
	document.write('<div id="showunity'+id+'"><a href="javascript:showUnity(\''+id+'\',\''+url+'\','+w+','+h+')"><img src="http://www.flamehaus.com/bbs/images/unity.png" width="193" height="63" /></a></div>');
}

function showUnity(id, url, w, h) {
	unityObject.embedUnity("unity"+id, url, w, h);
	showdiv('unity'+id);
	hidediv('showunity'+id);
}

function showdiv(id) {
	var element = (document.all) ? document.all(id) : document.getElementById(id);
	element.style.display="block";
}

function hidediv(id) {
	var element = (document.all) ? document.all(id) : document.getElementById(id);
	element.style.display="none";
}


function ytrep(id) {
  $('youtube').replace('<div id="youtube" style="text-align:center"><font face="verdana" size="1"><br /><a href="javascript:$(\'youtube\').hide();">Hide this shit</a><br/><iframe class="youtube-player" type="text/html" width="853" height="510" src="http://www.youtube.com/embed/'+id+'?hd=1" frameborder="0"></iframe></font></div>');
}
