function tickerInit() {
    if ($('#ticker').length!=0) {
        var options = {
            newsList: "#ticker",
            startDelay: 10,
            placeHolder1: "",
            placeHolder2: "",
            controls: false,
            tickerRate: 40,
            loopDelay: 3000
        }
        $().newsTicker(options);
    }
}

$(document).ready(
	function()
	{
                tickerInit();
});

function ajax_pidtv( id ,type )
{
	if ($('#text_'+id).length < 0)
		var comment = '';
	else
		var comment = $('#text_'+id).attr("value");
	jQuery.ajax({
    		type: "POST",
    		url  : 'ajax_olimp.php',
    		data : {
				id: id,
				user_id: $('.user_id').attr("id"),
				comment: comment,
				type: type
			},                    
			success: function (result) 
			{
				if (type == 'button')
				{
					$("input[name='button_"+id+"']").attr("value", " Äÿêóºìî çà ï³äòâåðäæåííÿ! ");
					$("input[name='button_"+id+"']").attr("disabled", "disabled");
				}
				else
				{
					document.location = $('#link_'+id).attr("href");;
				}
			}
    });
}

function test_pole( name , el , count )
{
	if (el.length >= count)
	{
		jQuery.ajax({
    		type: "GET",
    		url  : 'ajax_test.php',
    		data : {
					text: el,
					pole: name
					},                    
			success: function (result) {
    	        document.getElementById(name+'_div').innerHTML = '';
    	        document.getElementById(name+'_div').innerHTML = result;
    	   }
    	  });
	}
	else
	{
		 document.getElementById(name+'_div').innerHTML = '';
	}

}
