 $(document).ready(function(){
 		if ( $.browser.msie && $.browser.version == '6.0')
 		alert( 'Jūsų interneto naršyklė yra per sena ir gali nepalaikyti tam tikrų šiame tinklapyje esančių funkcijų bei efektų arba veikti lėtai. Dėl šios priežasties mes primygtinai siųlome jums atsinaujinti naršyklę iki 7 arba 8 interneto naršyklės versijos. http://localhost/aptana/kiwiclub/' );

		  
	   $('img').not('.slide,.img,#santa0 img').wrap($('<span/>').attr('class','roundBlocks').css({position: 'relative',display: 'inline-block'}));
	   
	   $('.roundBlocks').append('<img src="./css/tw.png" alt="" style="position: absolute; top: 0; left: 0; width: 9px;"/>');
	   $('.roundBlocks').append('<img src="./css/te.png" alt="" style="position: absolute; right: 0; top:0; width: 9px;"/>');
	   $('.roundBlocks').append('<img src="./css/be.png" alt="" style="position: absolute; right: 0; bottom: 0; width: 9px;"/>');
	   $('.roundBlocks').append('<img src="./css/bw.png" alt="" style="position: absolute; left: 0; bottom: 0; width: 9px;"/>');
	   
	  
	   
	   $('#menu li').hover(function(){
			$('#menu li').not(".active").children('div').remove();
			$('#menu li').removeClass("hover");
	   		$(this).not(".active").addClass("hover").corner('15px');
	   });
	   $('#middle,#header').hover(function(){
			$('#menu li').not(".active").children('div').remove();
			$('#menu li').removeClass("hover");
	   });
	   
		$('#closePanel').bind('click', function(){
			$('#resizable').css({display: 'none'});
			$('#resizable div').not('.ui-resizable-handle').remove();
			return false;
		});
		
		$(function() {
			$("#resizable").draggable();
		});
		$(function() {
			$("#resizable").resizable({
				
				minWidth: 408});
		});
		$(function() {
			$("#musicPopup").draggable();
		});
		$(function() {
			$("#musicPopup").resizable({
				minHeight: 200,
				minWidth: 408});
		});
		
		$('.showingMenu a').bind('click', function(){
			/*var myleft=(screen.width)?(screen.width-608)/2:100;
			var mytop=$(this).parent().offset().top;
			$('#resizable').css({display: 'none',height: 'auto'});
			$('#resizable div').not('.ui-resizable-handle, .bottom, .mainLL, .mainLR').remove();
			var div = $('#resizable');
			div.prepend($(this).parent().children('div:first').html());
			div.css({left: myleft, top: mytop});
			var h = div.height();
			div.css({height: '0'});
			div.toggle();
			div.animate({height: h}, 400, 'linear', function(){});*/
			return true;
		});
		
		$('#resizable').append('<div class="bottom"><div class="mainLL"><!-- --></div><div class="mainLR"><!-- --></div></div>');
		$('.popup').prepend('<div class="top"><div class="mainLL"><!-- --></div><div class="mainLR"><!-- --></div></div>');
		
		$('.bottom').css({width: $("#resizable").width()});
		$('.showingMenu li').hover(function(){
			$('.showingMenu li').children('span').removeClass('hover');
			$('.showingMenu li').children('span.fire').addClass('last');
			$('.showingMenu li').children('span').not('.room').addClass('week');
			$(this).children('span:first').addClass('hover');
			$(this).children('span:first').removeClass('week last');
		});
		$('#content').hover(function(){
			$('.showingMenu li').children('span').removeClass('hover');
			$('.showingMenu li').children('span').not('.room').addClass('week');
			$('.showingMenu li').children('span.fire').addClass('last');
		});
		
		$('#musicLink').bind('click',function(){
			var myleft=(screen.width)?(screen.width-608)/2:100;
			var mytop=$(this).parent().offset().top;
			$('#musicPopup').css({display: 'block',left: myleft, top: mytop});
			return false;
		});
		//Balsavimo mygtuko ijungikmas
		$('#pageWoteForm ul li input').bind('click',function(){
			$('#woteButton').removeAttr('disabled');
		});
		
});

function ajax_wote(view){
	var wote = document.getElementById('wote');
	var answ = $("input[@name='option_layout']:checked").val();
	var quest = $('#pageId').val();
	$('#wote div.content2').html('');
	$('#wote div.content img.preloader').css('display','block');
	$.post("wote.php", {view: view, question: quest,answere: answ}, function(data){	
		$('#wote div.content').html(data);
		var i = 0;
		while (true) {
			if ($('#status'+i).length > 0) {
				var w = $('#status'+i).width();
				$('#status'+i).css({
					width: '0'
				});
				$('#status'+i).animate({
					width: w
				}, 1000, 'linear', function(){});
				i++;
			}else{
				break;
			}
		}
	});
}
function emptyAjax(){
	$.post("http://www.kiwiclub.lt");
}
setInterval('emptyAjax()',350000);