 $(document).ready(function(){
 		$('img').not('.banners,.img').wrap($('<span/>').attr('class', 'roundImages').css({
				position: 'relative',
				display: 'inline-block'
			}));
			$('.roundImages').append('<img class="rounding" src="./css/tw.png" alt="" style="position: absolute; top: 0; left: 0;"/>');
			$('.roundImages').append('<img class="rounding" src="./css/te.png" alt="" style="position: absolute; right: 0; top:0;"/>');
	 		if ($.browser.msie && $.browser.version == '7.0') {
				$('.roundImages').append('<img class="rounding" src="./css/be.png" alt="" style="position: absolute; right: 0; bottom: 0px;"/>');
				$('.roundImages').append('<img class="rounding" src="./css/bw.png" alt="" style="position: absolute; left: 0; bottom: 0px;"/>');
			}
			else {
				$('.roundImages').append('<img class="rounding" src="./css/be.png" alt="" style="position: absolute; right: 0; bottom: 4px;"/>');
				$('.roundImages').append('<img class="rounding" src="./css/bw.png" alt="" style="position: absolute; left: 0; bottom: 4px;"/>');
			}
		 $('.roundBlocksTL').append('<img src="./css/tw.png" alt="" style="position: absolute; top: 0; left: 0; width: 9px;"/>');
	   $('.roundBlocksTR').append('<img src="./css/te.png" alt="" style="position: absolute; right: 0; top:0; width: 9px;"/>');
	   $('.roundBlocksBR').append('<img src="./css/be.png" alt="" style="position: absolute; right: 0; bottom: 0; width: 9px;"/>');
	   $('.roundBlocksBL').append('<img src="./css/bw.png" alt="" style="position: absolute; left: 0; bottom: 0; width: 9px;"/>');
	
	   $('img.banners').not('.pink,.blue,.green,.img').wrap($('<span/>').attr('class','roundBanner').css({position: 'relative',display: 'inline-block'}));
	   $('.roundBanner').append('<img src="./css/tw_grey.png" alt="" style="position: absolute; top: 0; left: 0;"/>');
	   $('.roundBanner').append('<img src="./css/te_grey.png" alt="" style="position: absolute; right: 0; top:0;"/>');
	   $('.roundBanner').append('<img src="./css/be_grey.png" alt="" style="position: absolute; right: 0; bottom: 0px;"/>');
	   $('.roundBanner').append('<img src="./css/bw_grey.png" alt="" style="position: absolute; left: 0; bottom: 0px;"/>');
	   
	   $('img.banners.pink').wrap($('<span/>').attr('class','roundBannerP').css({position: 'relative',display: 'inline-block'}));
	   $('.roundBannerP').append('<img src="./css/tw_pink.png" alt="" style="position: absolute; top: 0; left: 0;"/>');
	   $('.roundBannerP').append('<img src="./css/te_pink.png" alt="" style="position: absolute; right: 0; top:0;"/>');
	   $('.roundBannerP').append('<img src="./css/be_pink.png" alt="" style="position: absolute; right: 0; bottom: 0px;"/>');
	   $('.roundBannerP').append('<img src="./css/bw_pink.png" alt="" style="position: absolute; left: 0; bottom: 0px;"/>');
	   
	   $('img.banners.blue').wrap($('<span/>').attr('class','roundBannerB').css({position: 'relative',display: 'inline-block'}));
	   $('.roundBannerB').append('<img src="./css/tw_blue.png" alt="" style="position: absolute; top: 0; left: 0;"/>');
	   $('.roundBannerB').append('<img src="./css/te_blue.png" alt="" style="position: absolute; right: 0; top:0;"/>');
	   $('.roundBannerB').append('<img src="./css/be_blue.png" alt="" style="position: absolute; right: 0; bottom: 0px;"/>');
	   $('.roundBannerB').append('<img src="./css/bw_blue.png" alt="" style="position: absolute; left: 0; bottom: 0px;"/>');
	   
	   $('img.banners.green').wrap($('<span/>').attr('class','roundBannerG').css({position: 'relative',display: 'inline-block'}));
	   $('.roundBannerG').append('<img src="./css/tw_green.png" alt="" style="position: absolute; top: 0; left: 0;"/>');
	   $('.roundBannerG').append('<img src="./css/te_green.png" alt="" style="position: absolute; right: 0; top:0;"/>');
	   $('.roundBannerG').append('<img src="./css/be_green.png" alt="" style="position: absolute; right: 0; bottom: 0px;"/>');
	   $('.roundBannerG').append('<img src="./css/bw_green.png" alt="" style="position: absolute; left: 0; bottom: 0px;"/>');
	   
	   $('.roundBlocks').append('<img src="./css/tw.png" alt="" style="position: absolute; top: 0; left: 0;"/>');
	   $('.roundBlocks').append('<img src="./css/te.png" alt="" style="position: absolute; right: 0; top:0;"/>');
	   $('.roundBlocks').append('<img src="./css/be.png" alt="" style="position: absolute; right: 0; bottom: 0;"/>');
	   $('.roundBlocks').append('<img src="./css/bw.png" alt="" style="position: absolute; left: 0; bottom: 0;"/>');
 		$('#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;
		});
		$('#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: $("#musicPopup").width()});
		$(function() {
			$("#musicPopup").draggable();
		});
		$(function() {
			$("#musicPopup").resizable({
				minHeight: 200,
				minWidth: 408});
		});
	  
	   $('div#menu li.active').corner('15px');
	   $('.round').corner();
	  $('#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");
	   });
		
		$('.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');
		});
		//var img = $('#content span img:first');
		var img = $('.grey h6 span img, .blue h6 span img').not('.rounding');
		
		jQuery.each(img,function(){
			$(this).wrap('<a class="lightbox" href="'+$(this).attr('src').replace('_120','')+'" rel="lightbox" title="Nuotrauka" />');
		});
		
		$('ul li:last-child').css('border','none');
		
		$(function() {
	        $('#content a.lightbox').lightBox();
	    });
		//Balsavimo mygtuko ijungikmas
		$('#pageWoteForm ul li input').bind('click',function(){
			$('#woteButton').removeAttr('disabled');
		});
			
});

function emptyAjax(){
	$.post("http://www.kiwiclub.lt");
}

function ajax_wote(){
	var wote = document.getElementById('wote');
	var answ = $("input[@name='option_layout']:checked").val();
	var quest = $('#pageId').val();
	$('#wote div.content2').html('');
	var wote = document.getElementById('wote');
	$.post("wote.php", {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;
			}
		}
	});
}

setInterval('emptyAjax()',35000);