var AC_FL_RunContent = 0;
$(document).ready(function(){

	$("#email, #name, #captcha").click(function(){
	$(this).val('');
	});
	
	$("#hitinner .title a").click(function(){
		$("#hitinner .more").hide();
		$("#hitinner .title").show();
		$(this).parent("div").hide();
		
		$(this).parent("div").next(".more").fadeIn('slow');
		
		id=$(this).attr('id');

		ht=$(this).parent("div").next().html();
		
		if (ht.search("img/loader.gif")!=-1){
			$.post('/engine/hit/ru/'+id, {lang:'ru'},
			function(data) {
				$("#"+id).parent("div").next(".more").html(data);
				
			});
		}
	});

	//$("#player").hide();

});


function runPlayer(id, inner){
	
//	t=l=20;
	t=$("#pb"+id).offset().top;
	l=$("#pb"+id).offset().left;
	if (inner==1){
		l=l-90;

	}
//	alert (navigator.userAgent);
	if (navigator.userAgent.search("Firefox")!=-1)
	{
		//alert ('firefox!');
		t=t-12;
		l=l-12;
	}
	Close();
	song='/engine/single/ru/file/'+id;
	
	$("body").prepend("<div id='player'></div>");
	
	
	document.getElementById('player').innerHTML='\
	<object style="padding:0; margin:0;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \
	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" \
	width="137" height="25" id="player" align="middle"> \
	<param name="allowScriptAccess" value="sameDomain" /> \
	<param name="allowFullScreen" value="false" /> \
	<param name="movie" value="player.swf" /> \
	<param name="quality" value="high" /> \
	<param name="bgcolor" value="#ffffff" /> \
	<param name="Flashvars" value="song='+song+'" /> \
	<embed Flashvars="song='+song+'" src="player.swf" quality="high" \
	bgcolor="#ffffff" width="137" height="25" name="player" align="middle" allowScriptAccess="sameDomain" \
	allowFullScreen="false" type="application/x-shockwave-flash" \
	pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	
	
	document.getElementById('player').style.top=t+"px";
	document.getElementById('player').style.left=l+"px";
}

function Close(){
	$("#player").html('');
	$("#player").remove();
}
function ShowBanner(src, w, h)
{
	//alert ('ok!');
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		'width', w,
		'height', h,
		'src', src,
		'quality', 'high',
		'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'exactfit',
		'wmode', 'opaque',
		'devicefont', 'false',
		'id', 'stan_tv',
		'bgcolor', '#ffffff',
		'name', 'stan_tv',
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'wmode', 'opaque',
		'allowScriptAccess', 'always',
		'movie', src,
		'salign', ''
		); //end AC code
	}
}