window.addEvent('domready',function(){
			var ns4_more = $$('#ns_more span');
			var nS4 = new noobSlide({
				box: $('carousel_box'),
				items: $$('#carousel_box div'),
				size: 420,
				autoPlay: true,
				handles: $$('#handles4 span'),
				onWalk: function(currentItem,currentHandle){
					$$(this.handles,ns4_more).removeClass('active');
					$$(currentHandle,ns4_more[this.currentIndex]).addClass('active');
				}
			});
			
			var tabs = new MGFX.Tabs('.mootabs_tabs','.mootabs_feature',{
				autoplay: false,
				transitionDuration: 100,
				slideInterval: 0,
				hover: true
			});
			
 			//create the tooltips
			
			$$('a.x').each(function(element,index) {
				//element.store('tip:title', '');
				element.store('tip:text', '');
			});

			var x = new Tips('.x',{
				className: 'x',
				fixed: false,
				hideDelay: 0,
				showDelay: 50
			});
			x.addEvents({
				'show': function(tip) {
					tip.fade('in');
				},
				'hide': function(tip) {
					tip.fade('out');
				}
			});
			
			$$('a.top').each(function(element,index) {
				//element.store('tip:title', '');
				element.store('tip:text', '');
			});

			var top = new Tips('.top',{
				className: 'top',
				fixed: false,
				hideDelay: 250,
				showDelay: 50
			});
			top.addEvents({
				'show': function(tip) {
					tip.fade('in');
				},
				'hide': function(tip) {
					tip.fade('out');
				}
			});
			
		});
		
		function showCurrentDate() {
			montharray=new Array (
				"января","февраля",
				"марта","апреля","мая",
				"июня",	"июля",	"августа",
				"сентября","октября","ноября",
				"декабря");
			ndata=new Date();
			month=montharray[ndata.getMonth()];
			date=ndata.getDate();
			year=ndata.getFullYear();
			datastr=(" "+ date +" "+ month +" "+ year +" года");
			document.getElementById("current_date").innerHTML = datastr;
		};

		function onLoadFunction() {
			showCurrentDate();
		}
		
function getPollData(pId, answerId) {
	new Request.HTML({
		url: '/ajax_php/poll.php?id='+pId+'&answer='+answerId, 
		onRequest: function(html) { $('changePoll').empty().addClass('ajax-loading'); },
		onSuccess: function(html) {
			$('changePoll').empty().removeClass('ajax-loading');
			//Clear the text currently inside the results div.
			$('changePoll').set('text', '');
			//Inject the new DOM elements into the results div.
			$('changePoll').adopt(html);
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('changePoll').set('text', 'Ошибка запроса в базу данных!');
		}
	}).send();
}
