function XMLRequestFix(m_width,m_height,m_cod) {
	var myPic = new Image;
	myPic.onerror = function(){ writeHfPlayerFix("http://s3.amazonaws.com/vtt-bp",m_width,m_height,m_cod)};
	myPic.onload = function(){  writeHfPlayer_hFix("http://www.happyfish.ro",m_width,m_height,m_cod)};
	myPic.src = "http://www.happyfish.ro/gri.gif";

}

function writeHfPlayerFix(where_to,m_width,m_height,m_cod)
{
	writeItDown(where_to,m_width,m_height,'amz','http://s3.amazonaws.com/vtplayer',m_cod);
}

function writeHfPlayer_hFix(where_to,m_width,m_height,m_cod)
{
	writeItDownFix(where_to,m_width,m_height,'hf','http://www.happyfish.ro/',m_cod);
}

function writeItDown(where_to,m_width,m_height,hfa,pls)
{
	var whereAmI = location.href;
	//whereAmI = "www.contentlogic.ro/videotest";
	place = document.getElementById('hfPlayer');
	if(m_width==0 && m_height==0)
	{
		place.innerHTML = 'Hack. Nu muta scriptul de la happy';
	} else
		{
		place.innerHTML = '<object id="banner" width="'+m_width+'" height="'+m_height+'" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="'+pls+'banners.swf" name="movie"/><param value="high" name="quality"/><param value="#869ca7" name="bgcolor"/><param value="always" name="allowScriptAccess"/><param value="true" name="allowFullScreen"/><param value="transparent" name="wmode"/><param value="autoplay=false&hfa='+hfa+'&whereTo='+where_to+'&cuid='+whereAmI+'" name="FlashVars"/><embed width="'+m_width+'" height="'+m_height+'" align="middle" allowScriptAccess="always" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" quality="high" loop="false" play="true" flashvars="autoplay=false&hfa='+hfa+'&whereTo='+where_to+'&cuid='+whereAmI+'" name="banner" wmode="transparent" bgcolor="#869ca7" src="'+pls+'banners.swf"/></object><div style="width:'+m_width+'px; heigt:1px; border:none; background-color:#000000;"></div>';
		}
}

function writeItDownFix(where_to,m_width,m_height,hfa,pls,m_cod)
{
	var whereAmI = location.href;
	//whereAmI = "www.contentlogic.ro/videotest";
	place = document.getElementById('hfPlayer_'+m_cod);
	if(m_width==0 && m_height==0)
	{
		place.innerHTML = 'Hack. Nu muta scriptul de la happy';
	} else
		{
		place.innerHTML = '<object id="banner" width="'+m_width+'" height="'+m_height+'" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="'+pls+'banners.swf" name="movie"/><param value="high" name="quality"/><param value="#869ca7" name="bgcolor"/><param value="always" name="allowScriptAccess"/><param value="true" name="allowFullScreen"/><param value="transparent" name="wmode"/><param value="autoplay=false&hfa='+hfa+'&whereTo='+where_to+'&ide='+m_cod+'" name="FlashVars"/><embed width="'+m_width+'" height="'+m_height+'" align="middle" allowScriptAccess="always" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" quality="high" loop="false" play="true" flashvars="autoplay=false&hfa='+hfa+'&whereTo='+where_to+'&ide='+m_cod+'" name="banner" wmode="transparent" bgcolor="#869ca7" src="'+pls+'banners.swf"/></object><div style="width:'+m_width+'px; heigt:1px; border:none; background-color:#000000;"></div>';
		
		}
}