/**
 * Антипиратство (запрет выделения текста)
 */


jQuery.fn.extend({ 
    disableSelection : function() { 
            this.each(function() { 
                    this.onselectstart = function() { return false; }; 
                    this.unselectable = "on"; 
                    jQuery(this).css('-moz-user-select', 'none'); 
            }); 
    },
    enableSelection : function() { 
            this.each(function() { 
                    this.onselectstart = function() {}; 
                    this.unselectable = "off"; 
                    jQuery(this).css('-moz-user-select', 'auto'); 
            }); 
    } 
});


/**
 * Отключение правой кнопки мыши
 */

var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false");



 
  $(document).ready(function() {
    $('body *').disableSelection(); 
    $('#inputString, body input').enableSelection();
      $("#myradio").corner("10px");
	  $(".roundthisdiv").corner("15px");
	
	$(".fadeImg").fadeTo("normal", 0.5); 
	$(".fadeImg").hover(function() 
								 {		 
		$(this).fadeTo("normal", 1.0); },
		function(){ 
			$(this).fadeTo("slow", 0.5); 
		});
		
		
		 
	
  });
  



<!-- Автозаполнение при поиске -->
	function lookup(inputString) {
		if(inputString.length == 0) {
			$('#suggestions').hide();
		} else {
			$.post("http://www.the-radio.ru/engine/mods/autocomplete/rpc.php", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	}
	
	function fill(thisValue) {

		xajax_search(thisValue);
		setTimeout("$('#suggestions').hide();", 2000);
		
	}


// ОНЛАЙН

function flash_player(urls)
{
	var so = new SWFObject("http://www.the-radio.ru/skin/main/inc/js/flash/nativeradio2small.swf", "nativeradio2small", "300", "50", "10", "#000000");
	so.addParam("scale", "noscale");
	so.addVariable("swfcolor", "000000");
	so.addVariable("swfwidth", "300");
	so.addVariable("swfradiochannel", "The-Radio.ru");
	so.addVariable("swfstreamurl", urls);
	so.addVariable("swfpause", "0");
	so.write("player");
}

function nextvideo(j)
{
	document.getElementById('videobystyle').innerHTML = 'Подождите, идет загрузка...';	
	xajax_nextvideojax(j, 'videobystyle');
}


function resetTitle()
{
	document.getElementById('nowtitle').innerHTML = '<span class="hc7">Что бы узнать, какой трек играет на радио – кликните по ссылке</span>&nbsp;&nbsp; (<a href="#n" onclick="loadTitle(\'\');">Что сейчас играет ?</a>)';
}
	   
function setNext()
{
	document.getElementById('wantmore').style.backgroundColor = '#555';	
	document.getElementById('wantmore').innerHTML = 'Идет загрузка .........';	
}


function BlockMirrors()
{
	
 $.blockUI(   	   
	{ 
		   message: 'Пожалуйста подождите, идет загрузка! ' , 
		   
		   css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#000', 
            '-webkit-border-radius': '10px', 
            '-moz-border-radius': '10px', 
            opacity: .5, 
			
            color: '#fff' 
    } }
		
		
		); 
 
        setTimeout($.unblockUI, 3000); 
}

function errorM (msg)
{
		$.prompt('<span class="font16 cred">Ошибка</span><br /><div class="msgpadtop font11">' + msg + '</div>');
}


function okM (msg)
{
		$.prompt('<span class="font16 cgreen">Успешно</span><br /><div class="msgpadtop font11">' + msg + '</div>');
}

function ok (head, msg)
{
		$.prompt('<span class="font16 cgreen">'+head+'</span><br /><div class="msgpadtop font11">' + msg + '</div>');
}

function error (head, msg)
{
		$.prompt('<span class="font16 cred">'+ head +'</span><br /><div class="msgpadtop font11">' + msg + '</div>');
}

