// JavaScript functions

ajaxLoadMark = "<img src=/images/voteLoad.gif style='display:inline;'>";



	var gCallCount = 1;
	var timer, timertmp;



	function center_top_news_loop() {
		clearTimeout(timertmp);

		if(gCallCount == 5)
			gCallCount = 1;

		if(gCallCount > 1)
			$('center_top_news_upper_' + (gCallCount - 1)).style.display = 'none';

		if(gCallCount == 1)
			$('center_top_news_upper_' + 4).style.display = 'none';

		for(i = 1;i <= 4;i++)
		{
			$('center_top_news_upper_' + i).style.display = 'none';
			hideBand(i);
		}

		$('center_top_news_band_' + gCallCount).style.borderBottom = 'solid 5px #6E6D35';

		//new Effect.Appear('center_top_news_upper_' + gCallCount, {duration:2.0});
		$('center_top_news_upper_' + gCallCount).style.display = "block";

		gCallCount++;
		timer = setTimeout("center_top_news_loop()", 5000);
	}
	function restoreLoop() {
		stoploop() ;
		timertmp = setTimeout("center_top_news_loop()", 1500);

	}
	function center_top_news_loop_delay()
	{
		//timertmp = setTimeout("center_top_news_loop()", 3000);
	}

	function stoploop()
	{
		clearTimeout(timer);
		clearTimeout(timertmp);

	}

	function drawBand(num)
	{
		stoploop();

		for(var i = 1;i <= 4;i++)
			$('center_top_news_upper_' + i).style.display = 'none';
		$('center_top_news_upper_' + num).style.display = 'block';

		for(i = 1;i <= 4;i++)
			hideBand(i);
		$('center_top_news_band_' + num).style.borderBottom = 'solid 5px #6E6D35';
	}

	function hideBand(num)
	{
		$('center_top_news_band_' + num).style.borderBottom = 'solid 5px #E9BB20';
	}


	function changeActiveTabMid(num, tab)
	{


		var refID = "center_mid_tabs_ref_" + num;
		var refObj = document.getElementById(refID);

		if(refObj.className == "center_mid_tabs_item_inactive")
		{
			refObj.className = "center_mid_tabs_item_active";

			if(num == 1)
			{
				document.getElementById("center_mid_tabs_ref_2").className = "center_mid_tabs_item_inactive";
				document.getElementById("center_mid_tabs_ref_3").className = "center_mid_tabs_item_inactive";
			}
			else if(num == 2)
			{
				document.getElementById("center_mid_tabs_ref_1").className = "center_mid_tabs_item_inactive";
				document.getElementById("center_mid_tabs_ref_3").className = "center_mid_tabs_item_inactive";
			}
			else if(num == 3)
			{
				document.getElementById("center_mid_tabs_ref_1").className = "center_mid_tabs_item_inactive";
				document.getElementById("center_mid_tabs_ref_2").className = "center_mid_tabs_item_inactive";
			}
		}

		var params = 'midTab=' + tab;
		var myAjax = new Ajax.Request("loadMidTabsData.php", {method: 'post', parameters: params, onComplete:getMidTabsData});
	}

	function sortData(tab, num)
	{
		var params = 'midTab=' + tab + '&sortBy=' + num;
		var myAjax = new Ajax.Request("loadMidTabsData.php", {method: 'post', parameters: params, onComplete:getMidTabsData});
	}


	function getMidTabsData(response) {$('mid_news_content').innerHTML = response.responseText;}



	function changeColorRed(num)
	{
		$('center_mid_tabs_ref_' + num).style.color = "#e7040b";
	}

	function changeColorBlack(num)
	{
		$('center_mid_tabs_ref_' + num).style.color = "#000000";
	}

	function changeArrowRed(num)
	{
		if(num == 3)
			$('center_mid_tabs_arrow_' + num).style.background = "url(images/red_arrow.gif) no-repeat";
		else
			$('center_mid_tabs_arrow_' + num).style.background = "url(images/red_arrow_ext.gif) no-repeat";

		$('center_mid_tabs_arrow_' + num).style.backgroundPosition = "0px 2px";
	}

	function changeArrowBlack(num)
	{
		if(num == 3)
			$('center_mid_tabs_arrow_' + num).style.background = "url(images/black_arrow.gif) no-repeat";
		else
			$('center_mid_tabs_arrow_' + num).style.background = "url(images/black_arrow_ext.gif) no-repeat";

		$('center_mid_tabs_arrow_' + num).style.backgroundPosition = "0px 2px";
	}

	function changeActiveTabDownload(num)
	{
		var refID = "center_download_tabs_ref_" + num;
		var refObj = document.getElementById(refID);

		if(refObj.className == "center_download_tabs_item_inactive")
		{
			refObj.className = "center_download_tabs_item_active";

			if(num == 1)
			{
				document.getElementById("center_download_tabs_ref_2").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_3").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_4").className = "center_download_tabs_item_inactive";
			}
			else if(num == 2)
			{
				document.getElementById("center_download_tabs_ref_1").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_3").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_4").className = "center_download_tabs_item_inactive";
			}
			else if(num == 3)
			{
				document.getElementById("center_download_tabs_ref_1").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_2").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_4").className = "center_download_tabs_item_inactive";
			}
			else if(num == 4)
			{
				document.getElementById("center_download_tabs_ref_1").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_2").className = "center_download_tabs_item_inactive";
				document.getElementById("center_download_tabs_ref_3").className = "center_download_tabs_item_inactive";
			}
		}
	}

	function changeActiveTabSales(num)
	{
		var refID = "right_sales_tabs_ref_" + num;
		var refObj = document.getElementById(refID);

		if(refObj.className == "right_sales_tabs_item_inactive")
		{
			refObj.className = "right_sales_tabs_item_active";

			if(num == 1)
			{
				document.getElementById("right_sales_tabs_ref_2").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_3").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_4").className = "right_sales_tabs_item_inactive";
			}
			else if(num == 2)
			{
				document.getElementById("right_sales_tabs_ref_1").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_3").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_4").className = "right_sales_tabs_item_inactive";
			}
			else if(num == 3)
			{
				document.getElementById("right_sales_tabs_ref_1").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_2").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_4").className = "right_sales_tabs_item_inactive";
			}
			else if(num == 4)
			{
				document.getElementById("right_sales_tabs_ref_1").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_2").className = "right_sales_tabs_item_inactive";
				document.getElementById("right_sales_tabs_ref_3").className = "right_sales_tabs_item_inactive";
			}
		}
	}
	function changeActiveTabJournal(num)
	{
		var refID = "center_journal_tabs_ref_" + num;
		var refObj = document.getElementById(refID);

		if(refObj.className == "center_journal_tabs_item_inactive")
		{
			refObj.className = "center_journal_tabs_item_active";

			if(num == 1)
			{
				document.getElementById("center_journal_tabs_ref_2").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_3").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_4").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_5").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_6").className = "center_journal_tabs_item_inactive";
			}
			else if(num == 2)
			{
				document.getElementById("center_journal_tabs_ref_1").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_3").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_4").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_5").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_6").className = "center_journal_tabs_item_inactive";
			}
			else if(num == 3)
			{
				document.getElementById("center_journal_tabs_ref_1").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_2").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_4").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_5").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_6").className = "center_journal_tabs_item_inactive";
			}
			else if(num == 4)
			{
				document.getElementById("center_journal_tabs_ref_1").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_2").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_3").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_5").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_6").className = "center_journal_tabs_item_inactive";
			}
			else if(num == 5)
			{
				document.getElementById("center_journal_tabs_ref_1").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_2").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_3").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_4").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_6").className = "center_journal_tabs_item_inactive";
			}
			else if(num == 6)
			{
				document.getElementById("center_journal_tabs_ref_1").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_2").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_3").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_4").className = "center_journal_tabs_item_inactive";
				document.getElementById("center_journal_tabs_ref_5").className = "center_journal_tabs_item_inactive";
			}
		}
	}

	function mouseX(evt)
	{
		if(evt.pageX)
			return evt.pageX;
		else if(evt.clientX)
			return evt.clientX + (document.documentElement.scrollLeft ?
				document.documentElement.scrollLeft :  document.body.scrollLeft);
		else
			return null;
	}

	function mouseY(evt)
	{
		if(evt.pageY)
			return evt.pageY;
		else if(evt.clientY)
			return evt.clientY + (document.documentElement.scrollTop ?
				document.documentElement.scrollTop : document.body.scrollTop);
		else
			return null;
	}

	function showPopupMenu(e, num, menuname)
	{
		var x = mouseX(e);
		var y = mouseY(e);
		ypSlideOutMenu.showMenu(menuname + num, x - 110, y - 20);
	}

	function showsl(e, sid, menuname)
	{
		var x = mouseX(e);
		var y = mouseY(e);

		ypSlideOutMenu.showMenu(menuname, x - 110, y - 20);
	}


	function checkPopupMenu(e, num, menuname)
	{
		var x = mouseX(e);
		var y = mouseY(e);
		ypSlideOutMenu.checkMenu(menuname + num, x, y);
	}



	function hidePopupMenu(num, menuname)
	{
		ypSlideOutMenu.hideMenu(menuname + num);
	}
	var id=0;
	function showPopupMenuMarksNews(e, menuname, newsid)
	{
		var x = mouseX(e);
		var y = mouseY(e);
		id=newsid;
		ypSlideOutMenu.setLinkID(newsid);
		ypSlideOutMenu.showMenu(menuname, (x - 20)+'px', (y - 20)+'px');
	}


	function checkPopupMenuMarksNews(e, menuname)
	{
		var x = mouseX(e);
		var y = mouseY(e);
		ypSlideOutMenu.checkMenu(menuname, x, y);
	}

	function hidePopupMenuMarksNews(menuname)
	{
			ypSlideOutMenu.hideMenu(menuname);
	}

	function setMarksToNews(markID, newsID){
		Cookie=getCookie('newsID' + newsID);
if (Cookie!=null && Cookie!="")
  {alert ('вы уже использовали свой шанс');}
else {
  createCookie('newsID' + newsID,markID,365);


		$('ratingnews' + newsID).innerHTML=ajaxLoadMark;
		var params = 'markID=' + markID + '&newsID=' + newsID;
		var myAjax = new Ajax.Request(
			"setMarksToNews.php", {method: 'post', parameters: params, onComplete:
				function(transport)
				{
					$('ratingnews' + newsID).innerHTML=transport.responseText
					$('totalvotes' + newsID).innerHTML=parseInt($('totalvotes' + newsID).innerHTML) + 1;
				}
			}
		);


	}}


	function setMarksToNewsJtr(markID, newsID){
		Cookie=getCookie('newsIDL' + newsID);
if (Cookie!=null && Cookie!="")
  {alert ('Вы уже использовали свой шанс');}
else {
  createCookie('newsIDL' + newsID,markID,365);
		var params = 'markID=' + markID + '&newsID=' + newsID;
		var myAjax = new Ajax.Request("champions_league/setMarksToNewsJtr.php", {method: 'post', parameters: params, onComplete:	function(transport)
				{
					$('ratingnewsl' + newsID).innerHTML=transport.responseText
					$('totalvotes' + newsID).innerHTML=parseInt($('totalvotes' + newsID).innerHTML) + 1;
				}
			}
		);


	}}

	function setMarksToJournal(markID, articleID)
	{
Cookie=getCookie('articleID' + articleID);
if (Cookie!=null && Cookie!="")
  {alert ('вы уже использовали свой шанс');}
else {
  createCookie('articleID' + articleID,markID,365);

		var params = 'markID=' + markID + '&articleID=' + articleID;
		var myAjax = new Ajax.Request("setMarksToJournal.php", {method: 'post', parameters: params, onComplete: function(transport)
				{

					$('ratingnews' + articleID).innerHTML=transport.responseText
					$('totalvotes' + articleID).innerHTML=parseInt($('totalvotes' + articleID).innerHTML) + 1;
				}
			}
		)
	}}

	function setMarksToSlides(markID, slidesID)
	{	Cookie=getCookie('slidesID' + slidesID);
if (Cookie!=null && Cookie!="")
  {alert ('вы уже использовали свой шанс');}
else {
  createCookie('slidesID' + slidesID,markID,365);

		var params = 'markID=' + markID + '&slidesID=' + slidesID;
		var myAjax = new Ajax.Request("setMarksToSlides.php", {method: 'post', parameters: params, onComplete: function(transport)
				{

					$('ratingnews' + slidesID).innerHTML=transport.responseText
					$('totalvotes' + slidesID).innerHTML=parseInt($('totalvotes' + slidesID).innerHTML) + 1;
				}});
	}}

	function setMarksToSlidesJtr(markID, slidesID)
	{	Cookie=getCookie('slidesIDL' + slidesID);
if (Cookie!=null && Cookie!="")
  {alert ('вы уже использовали свой шанс');}
else {
  createCookie('slidesIDL' + slidesID,markID,365);

		var params = 'markID=' + markID + '&slidesID=' + slidesID;
		var myAjax = new Ajax.Request("champions_league/setMarksToSlidesJtr.php", {method: 'post', parameters: params, onComplete: function(transport)
				{

					$('ratingnewsl' + slidesID).innerHTML=transport.responseText
					$('totalvotes' + slidesID).innerHTML=parseInt($('totalvotes' + slidesID).innerHTML) + 1;
				}});
	}}



	function setMarksToVideo(markID, videoID)
	{Cookie=getCookie('videoID' + videoID);
if (Cookie!=null && Cookie!="")
  {alert ('вы уже использовали свой шанс');}
else {
  createCookie('videoID' + videoID,markID,365);

		var params = 'markID=' + markID + '&video=' + videoID;
		var myAjax = new Ajax.Request("setMarksToVideo.php", {method: 'post', parameters: params, onComplete: function(transport)
				{
					$('ratingnews' + videoID).innerHTML=transport.responseText
					$('totalvotes' + videoID).innerHTML=parseInt($('totalvotes' + videoID).innerHTML) + 1;
				}});
	}}

	function setMarksToSlidesPic(markID, slidesID, picId)
	{	Cookie=getCookie('slidesIDpic' + slidesID + picId);
if (Cookie!=null && Cookie!="")
  {alert ('вы уже использовали свой шанс');}
else {
  createCookie('slidesIDpic' + slidesID + picId,markID,365);


		var params = 'markID=' + markID + '&slidesID=' + slidesID + '&picID=' + picId;
		var myAjax = new Ajax.Request("setMarksToSlides.php", {method: 'post', parameters: params, onComplete: function(transport)
				{

					$('rating').innerHTML=transport.responseText
					$('totalvotes').innerHTML=parseInt($('totalvotes').innerHTML) + 1;
				}});
	}}


	function getNewsByDate(cal)
	{
		var year = cal.date.getFullYear();
		var month = cal.date.getMonth() + 1;

		if(month < 10)
			month = "0" + month;

		var day = cal.date.getDate();

		if(day < 10)
			day = "0" + day;

		var params = 'date=' + year + "-" + month + "-" + day;
		var date = year + "-" + month + "-" + day;

		if (cal.dateClicked) {
		$('newsdate').value = date;
		$('newsdateform').submit();
		var myAjax = new Ajax.Request("loadNews.php", {method: 'post', parameters: params, onComplete:loadNewsByDate});
		}
	}

	function loadNewsByDate(response)
	{
		var items = response.responseText;

		var itemsClean = new Array();
		var itemsClean = items.split("div2");
		var ind = 1;

		itemsClean.each(function(s)
		{
			var values = s.split("div1");
			var ref = values[0];
			var id = values[1];
			var date = values[2];
			var pic = values[3];
			var title = values[4];
			var text_brief = values[5];
			var votes = values[6];
			var rating = values[7];
			var comments = values[8];

			ind++;
		});

	}

	function hideElement(id)
	{
		document.getElementById(id).style.display = "none";
	}



/*****************************************************
 * ypSlideOutMenu
 * 3/04/2001
 *
 * a nice little script to create exclusive, slide-out
 * menus for ns4, ns6, mozilla, opera, ie4, ie5 on
 * mac and win32. I've got no linux or unix to test on but
 * it should(?) work...
 *
 * --youngpup--
 *****************************************************/

ypSlideOutMenu.Registry = []
ypSlideOutMenu.aniLen = 650
ypSlideOutMenu.hideDelay = 325
ypSlideOutMenu.minCPUResolution = 10
var gl_left = 0, gl_top = 0;
var gl_linkID = 0;

// constructor
function ypSlideOutMenu(id, dir, left, top, width, height)
{
	this.ie  = document.all ? 1 : 0
	this.ns4 = document.layers ? 1 : 0
	this.dom = document.getElementById ? 1 : 0

	if (this.ie || this.ns4 || this.dom) {
		this.id			 = id
		this.dir		 = dir
		this.orientation = dir == "left" || dir == "right" ? "h" : "v"
		this.dirType	 = dir == "right" || dir == "down" ? "-" : "+"
		this.dim		 = this.orientation == "h" ? width : height
		this.hideTimer	 = false
		this.aniTimer	 = false
		this.open		 = false
		this.over		 = false
		this.startTime	 = 0

		// global reference to this object
		this.gRef = "ypSlideOutMenu_"+id
		eval(this.gRef+"=this")

		// add this menu object to an internal list of all menus
		ypSlideOutMenu.Registry[id] = this

		var d = document
		d.write('<style type="text/css">')
		d.write('#' + this.id + 'Container { visibility:hidden; ')
		d.write('left:' + left + 'px; ')
		d.write('top:' + top + 'px; ')
		d.write('overflow:hidden; }')
		d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; ')
		d.write('width:' + width + 'px; ')
		d.write('height:' + height + 'px; ')
		d.write('clip:rect(0 ' + width + ' ' + height + ' 0); ')
		d.write('}')
		d.write('</style>')

		this.load()
	}
}

ypSlideOutMenu.prototype.load = function() {
	var d = document
	var lyrId1 = this.id + "Container"
	var lyrId2 = this.id + "Content"
	var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
	if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
	var temp

	if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
	else {
		this.container	= obj1
		this.menu		= obj2
		this.style		= this.ns4 ? this.menu : this.menu.style
		this.homePos	= eval("0" + this.dirType + this.dim)
		this.outPos		= 0
		this.accelConst	= (this.outPos - this.homePos) / ypSlideOutMenu.aniLen / ypSlideOutMenu.aniLen

		// set event handlers.
		if (this.ns4)
			this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);

		//this.menu.onmouseover = new Function("ypSlideOutMenu.showMenu('" + this.id + "', 0, 0)")
		//this.menu.onmouseout = new Function("ypSlideOutMenu.hideMenu('" + this.id + "')")

		//set initial state
		this.endSlide()
	}
}

ypSlideOutMenu.setLinkID = function(linkid)
{
	gl_linkID = linkid;
}

ypSlideOutMenu.getLinkID = function(linkid)
{
	return gl_linkID;
}

ypSlideOutMenu.showMenu = function(id, left, top)
{
	var contID = id + "Container";
	var menuObj = document.getElementById(contID);

	menuObj.style.left = left;
	menuObj.style.top = top;
	gl_left = left;
	gl_top = top;

	window.status = id
	var reg = ypSlideOutMenu.Registry
	var obj = ypSlideOutMenu.Registry[id]

	if (obj.container) {
		obj.over = true

		// close other menus.
		for (menu in reg) if (id != menu) ypSlideOutMenu.hide(menu)

		// if this menu is scheduled to close, cancel it.
		if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }

		// if this menu is closed, open it.
		if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
	}
}


ypSlideOutMenu.hideMenu = function(id)
{
	var contID = id + "Container";
	var menuObj = document.getElementById(contID);

	//if(left >= parseInt(menuObj.style.left) && top >= parseInt(menuObj.style.top))
	//		return;

	// schedules the menu to close after <hideDelay> ms, which
	// gives the user time to cancel the action if they accidentally moused out

	var obj = ypSlideOutMenu.Registry[id]

	if(obj.container)
	{
		if(obj.hideTimer)
			window.clearTimeout(obj.hideTimer)

		obj.hideTimer = window.setTimeout("ypSlideOutMenu.hide('" + id + "')", ypSlideOutMenu.hideDelay);
	}
}

ypSlideOutMenu.checkMenu = function(id, left, top)
{
	this.showMenu(id, gl_left, gl_top);
}

ypSlideOutMenu.hide = function(id)
{
	var obj = ypSlideOutMenu.Registry[id]
	obj.over = false

	if (obj.hideTimer) window.clearTimeout(obj.hideTimer)

	// flag that this scheduled event has occured.
	obj.hideTimer = 0

	// if this menu is open, close it.
	if (obj.open && !obj.aniTimer) obj.startSlide(false)
}

ypSlideOutMenu.prototype.startSlide = function(open) {
	this.open = open
	if (open) this.setVisibility(true)
	this.startTime = (new Date()).getTime()
	this.aniTimer = window.setInterval(this.gRef + ".slide()", ypSlideOutMenu.minCPUResolution)
}

ypSlideOutMenu.prototype.slide = function() {
	var elapsed = (new Date()).getTime() - this.startTime
	if (elapsed > ypSlideOutMenu.aniLen) this.endSlide()
	else {
		var d = Math.round(Math.pow(ypSlideOutMenu.aniLen-elapsed, 2) * this.accelConst)
		if (this.open && this.dirType == "-")		d = -d
		else if (this.open && this.dirType == "+")	d = -d
		else if (!this.open && this.dirType == "-")	d = -this.dim + d
		else										d = this.dim + d

		this.moveTo(d)
	}
}

ypSlideOutMenu.prototype.endSlide = function() {
	this.aniTimer = window.clearTimeout(this.aniTimer)
	this.moveTo(this.open ? this.outPos : this.homePos)
	if (!this.open) this.setVisibility(false)
	if ((this.open && !this.over) || (!this.open && this.over)) {
		this.startSlide(this.over)
	}
}

ypSlideOutMenu.prototype.setVisibility = function(bShow) {
	var s = this.ns4 ? this.container : this.container.style;
	s.visibility = bShow ? "visible" : "hidden";
	s.display = bShow ? "inline" : "none";
}
ypSlideOutMenu.prototype.moveTo = function(p) {
	this.style[this.orientation == "h" ? "left" : "top"] = p
}
ypSlideOutMenu.prototype.getPos = function(c) {
	return parseInt(this.style[c])
}


function activne () {
					for(var h = 1;h <= 4;h++) 	{
		var k =h;

	Event.observe('center_top_news_band_' + h, 'mouseover', function(event) {
	var element = Event.element(event);

	if (Number(element.id.substr(2))) {
	bid = element.id.substr(2);

	} else {
	bid = parseInt(element.id.substr(21));}

	if (Number(bid)) {drawBand(bid);}

	});

	Event.observe('center_top_news_band_' + h, 'mouseout', function() {restoreLoop();});

	}


}

function NotLoggedIn (element) {
clearTimeout(timer);
demension = Position.cumulativeOffset(element);
if ($('booknow')) {} else {
$('center_news_info_item_bottom').innerHTML = $('center_news_info_item_bottom').innerHTML + '<div id="booknow" class="bookmarkit">Зарегистритуйтесь или авторизуйтесь</div>';
}
$('booknow').style.left=(demension[0]) + 'px';
$('booknow').style.top=(demension[1] - 60) + 'px';
$('booknow').style.display='block';

timer = setTimeout("$('booknow').style.display='none';",3000);
}


function slidesstrip() {
//$('thumbnails').style.width=$('center_slides_show_bottom').getWidth() - 55;
return 1;
}

function createCookie(name,value,days) {

	if (days) {var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();}
		else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1 ;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    }
  }
return ""
}


function hidelogo () {

var logos = $('llm').getElementsByClassName('projects_gameland_popup_container');
/*try{
	logos.each(Element.hide);
}catch(e){;}/**/
		for(i=0;i<logos.length;i++){
			logos[i].style.display='none';
		}
	}
var timer;
function logo (logo) {


Event.unloadCache();

lid=logo.id.substr(4);
clearTimeout(timer); hidelogo ();
demension = Position.cumulativeOffset(logo);
popup='lp' + lid;

$(popup).style.left=(demension[0] - 40) + 'px';
$(popup).style.top=(demension[1] - $(popup).getHeight() + 10) + 'px';
$(popup).style.display='block';

Event.observe(document.body, 'click', function(event) {
hidelogo ();
});


timer = setTimeout("hidelogo ();",3000);
/**/
}