(function(global,$){
	var id = "perplayer",
		flashvars = {urlfin:"http://www.paltalk.com/#viral"},
		params = {allowScriptAccess:"always",play:"true"},
		attributes = {id:id,name:id},
		myplayer = null,
		check = null;

	global.ChangeName = function(theForm) {
		theForm = document.forms["nameForm"];
		if (myplayer !== null) swfobject.removeSWF(id);
	
		flashvars.firstname = theForm.elements["first_name"].value;
		flashvars.lastname = theForm.elements["last_name"].value;
		
		check.DoSWF("http://www.paltalk.com/marketing/media/vanksen/main.swf",{appendToId:"holder"},"384","304",flashvars,params,attributes,function(obj){
			if (obj.status == flensed.checkplayer.SWF_INIT) myplayer = obj.srcElem;
		});
	}
	
	$(document).ready(function(){
		check = new flensed.checkplayer("9.0.0",null,true,null);
	});
})(window,jQuery);