preloadJs('jwplayer/swfobject.js');

function video(f,p,n,w,h) {
	if(p == 'youtube') {
		var n = $(ge(n));
		try{var ifrm = n.ac2("<iframe id='youtube-video' frameborder='0' allowfullscreen>");
		}catch(e){var ifrm = n.ac2("iframe");ifrm.id='youtube-video';ifrm.setAttribute('frameborder', '0');ifrm.setAttribute('allowfullscreen', 'allowfullscreen');}
		ifrm.src="http://www.youtube.com/embed/" + f;
		ifrm.width = w>0?w:470;
		ifrm.height = h>0?h:320;
	} else {
		skin = jsPath('jwplayer/lightrv5.zip');
		var so = new SWFObject(jsPath('jwplayer/player.swf'),'player',w>0?w:470,h>0?h:320,'9','#000000');
		so.addParam('playlist','none');
		so.addParam('allowfullscreen','true');
		so.addParam('allowscriptaccess','never');
		so.addParam('wmode','opaque');
		so.addVariable('skin',skin);
		so.addVariable('file', ec(f + "&s=" + srnd()) + '&provider=video');
		so.write(n);
	}
}

function audio(f,n,w,h) {
	var so = new SWFObject(jsPath('uppod/uppod.swf'),'player',w>0?w:470,h>0?h:32,'9','#ffffff');
	so.addParam('bgcolor','#ffffff');
	so.addParam('allowFullScreen','true');
	so.addParam('allowScriptAccess','always');
	so.addParam('wmode','transparent');
	so.addParam('movie',jsPath('uppod/uppod.swf'));
	f += "&s=" + srnd() + "&file=video.flv";
	so.addParam('flashvars',"st="+jsPath('uppod/audio.txt') + "&amp;file=" + ec(f));


	so.write(n);
}
