	// JavaScript Document
function XMLRequest(m_width,m_height) {
		var myPic = new Image;
		myPic.onerror = function(){ writeHfPlayer("http://s3.amazonaws.com/vtt-bp",m_width,m_height)};
		myPic.onload = function(){  writeHfPlayer_h("http://www.happyfish.ro",m_width,m_height)};
		myPic.src = "http://www.happyfish.ro/gri.gif";

}

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 writeHfPlayer(where_to,m_width,m_height)
{
	writeItDown(where_to,m_width,m_height,'amz','http://s3.amazonaws.com/vtplayer');
}

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_h(where_to,m_width,m_height)
{
	writeItDown(where_to,m_width,m_height,'hf','http://www.happyfish.ro/');
}

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 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
		{
			if((whereAmI.match('romlit.ro')!=null) || (whereAmI.match('happyfish.ro')!=null) || (whereAmI.match('gsp.ro')!=null) || (whereAmI.match('sistersmagazine.ro')!=null) || (whereAmI.match('cotidianul.ro')!=null) || (whereAmI.match('flacarais.ro')!=null) || (whereAmI.match('paginademedia.ro')!=null))
			{
				place.innerHTML = '<object id="player" 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+'player_v2.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="autoplay=false&hfa='+hfa+'&whereTo='+where_to+'&cuid='+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+'&cuid='+m_cod+'" name="player" bgcolor="#869ca7" src="'+pls+'player_v2.swf"/></object><div style="width:'+m_width+'px; heigt:1px; border:none; background-color:#000000;"></div>';
			} else
			{
				place.innerHTML = '<object id="player" 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+'player.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="autoplay=false&hfa='+hfa+'&whereTo='+where_to+'&cuid='+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+'&cuid='+m_cod+'" name="player" bgcolor="#869ca7" src="'+pls+'player.swf"/></object><div style="width:'+m_width+'px; heigt:1px; border:none; background-color:#000000;"></div>';
			}
		
		}
}

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
		{
		if((whereAmI.match('romlit.ro')!=null) || (whereAmI.match('happyfish.ro')!=null) || (whereAmI.match('gsp.ro')!=null) || (whereAmI.match('sistersmagazine.ro')!=null) || (whereAmI.match('cotidianul.ro')!=null) || (whereAmI.match('flacarais.ro')!=null) || (whereAmI.match('paginademedia.ro')!=null))
			{
				place.innerHTML = '<object id="player" 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+'player_v2.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="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="player" bgcolor="#869ca7" src="'+pls+'player_v2.swf"/></object><div style="width:'+m_width+'px; heigt:1px; border:none; background-color:#000000;"><a href="http://www.happyfish.ro" target="_blank"><img src="http://www.happyfish.ro/hack.jpg" height="1" border="0" alt="happyfish tv" title="happyfish tv" /></a></div>';
			} else
			{
				place.innerHTML = '<object id="player" 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+'player.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="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="player" bgcolor="#869ca7" src="'+pls+'player.swf"/></object><div style="width:'+m_width+'px; heigt:1px; border:none; background-color:#000000;"><a href="http://www.happyfish.ro" target="_blank"><img src="http://www.happyfish.ro/hack.jpg" height="1" border="0" alt="happyfish tv" title="happyfish tv" /></a></div>';
			}
		
		}
}