function ProxyFlash(pCrossdomain, pDebug, pRand) {
	if(!ProxyFlash._single) {
	
	if(pRand == undefined)
	{
	pRand = true;
	}
	
	this._rand = pRand;
	
	this._eventListener = new EventListener();
	
	
	this._divProxyFlash = document.createElement('div');
	this._divProxyFlash.id = 'divProxyFlash';
	this._divProxyFlash.name = 'divProxyFlash';
	
	var ldiv = document.getElementsByTagName('body')[0].appendChild(this._divProxyFlash);

	if(pDebug == undefined || pDebug == null )
	{
	pDebug = false;
	}
	
	if(pCrossdomain == null || pCrossdomain == undefined)
	{
	pCrossdomain = '';
	}
	
	var flashvars = {
	crossdomain: pCrossdomain
	};
	var params = {
	menu: "false",
	allowscriptaccess: "always"
	};
	
	var lWidth = 1;
	var lHeight = 1;
	if(pDebug)
	{
	lWidth = 320;
	lHeight = 240;
	} else
	{
	params.wmode = "transparent";
	}
	
	var attributes = {
	id: "proxyFlash",
	name: "proxyFlash"
	
	};
	swfobject.embedSWF('http://download.od.tv-radio.com/nrj_static/www/webradio/proxy.swf', 'divProxyFlash', lWidth, lHeight, '9.0.0',null,flashvars,params,attributes);
	
	ProxyFlash._single = this;
	
	} else {
	;
	}
	return ProxyFlash._single;
	
}
	
ProxyFlash._single = null;
	
ProxyFlash._thisMovie = function(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
	return window[movieName]
	}
	else {
	return document[movieName]
	}
}
	
ProxyFlash.prototype._eventListener = null;
ProxyFlash.prototype._divProxyFlash = null;
	
	
ProxyFlash.prototype.response = null;
ProxyFlash.prototype.responseText = null;

ProxyFlash.prototype.addEventListener = function(pListener) {
	this._eventListener.addEventListener(pListener);
}
	
ProxyFlash.prototype.removeEventListener = function(pListener) {
	this._eventListener.removeEventListener(pListener);
}
	
ProxyFlash.prototype.request = function(pName, pRequest)
{
	var lFlash = ProxyFlash._thisMovie('proxyFlash');
	
	this.response = null;
	
	
	var lRand = '';
	if(this._rand)
	{
	lRand = new Date();
	lRand = lRand.getTime();
	if(pRequest.indexOf('?') > -1)
	{
	lRand = '&rand=' + lRand;
	} else
	{
	lRand = '?rand=' + lRand;
	}
	}
	
	lFlash.request(pName, pRequest + lRand);
}
	
	ProxyFlash.test = '';
	
ProxyFlash.callback = function(pName, pText)
{
	
	ProxyFlash.test = pText;
	if(ProxyFlash._single != null)
	{
	lText = xml2json(pText);
	
	var pJson;
	eval('pJson =' + lText);
	
	ProxyFlash._single.responseText = pText;
	
	if(pJson.parsererror == undefined)
	{
	ProxyFlash._single.response = pJson;
	ProxyFlash._single._eventListener.launchEvent('onResponse', pName);
	} else
	{
	var lError = pJson.parsererror.sourcetext.substr(0,pJson.parsererror.sourcetext.indexOf('\n'));
	ProxyFlash._single.response = null;
	ProxyFlash._single._eventListener.launchEvent('onError', pName, lError);//
	
	}

	
	}
} 
