/*
 * http://share42.com
 * Date: 09.04.2011
 * (c) 2011, Dimox
 */
function share42(f,u,t){if(!u)u=location.href;if(!t)t=document.title;u=encodeURIComponent(u);t=encodeURIComponent(t);var s=new Array('"http://www.facebook.com/sharer.php?u='+u+'&t='+t+'" title="Поделиться в Facebook"','"http://www.liveinternet.ru/journal_post.php?action=n_add&cnurl='+u+'&cntitle='+t+'" title="Опубликовать в LiveInternet"','"http://www.livejournal.com/update.bml?event='+u+'&subject='+t+'" title="Опубликовать в LiveJournal"','"http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl='+u+'&title='+t+'" title="Добавить в Одноклассники"','"http://twitter.com/share?text='+t+'&url='+u+'" title="Добавить в Twitter"','"#" onclick="window.open(\'http://vkontakte.ru/share.php?url='+u+'\', \'_blank\', \'scrollbars=0, resizable=1, menubar=0, left=200, top=200, width=554, height=421, toolbar=0, status=0\');return false" title="Поделиться В Контакте"','"http://my.ya.ru/posts_add_link.xml?URL='+u+'&title='+t+'" title="Поделиться в Я.ру"');for(i=0;i<s.length;i++)document.write('<a rel="nofollow" style="display:inline-block;width:24px;height:24px;margin:0 7px 0 0;background:url('+f+'icons.png) -'+24*i+'px 0" href='+s[i]+' target="_blank"></a>')}

// final Countdown scripts

function cST(label, vol) //cST=correctStringTime
{
	switch(label)
	{
		case 'days':	string=new Array('день', 'дня', 'дней'); break;
		case 'hors':	string=new Array('час', 'часа', 'часов'); break;
		case 'mins':	string=new Array('минута', 'минуты', 'минут'); break;
		case 'secs':	string=new Array('секунда', 'секунды', 'секунд'); break;
		default:return '';
	}
	volX=vol+'';
	volX=volX.substring(volX.length-1);
	if ((vol>9) && (vol<21)) return string['2'];
	if ((volX>0) && (volX<2)) return string['0'];
	if ((volX>1) && (volX<5)) return string['1'];
	if ((volX>4) || (volX==0)) return string['2'];
	
	return '';
}

function finalCountdown(finalTime) 
{ 
obj=document.getElementById('countDown');
days=Math.floor(finalTime/60/60/24);
hors=Math.floor((finalTime-(days*60*60*24))/60/60);
mins=Math.floor((finalTime-(days*60*60*24)-(hors*60*60))/60);
secs=Math.floor(finalTime-(days*60*60*24)-(hors*60*60)-(mins*60));
str='До конца регистрации осталось: <br/><span style="color:#aa0000">'+days+' '+cST('days',days)+', '+hors+' '+cST('hors',hors)+', '+mins+' '+cST('mins',mins)+', '+secs+' '+cST('secs',secs)+'<span>';
finalTime--;
if ((finalTime<0) && (finalTime>-8100)) 
{ obj.innerHTML=''; return false;}

document.getElementById('countDown').innerHTML=str;
setTimeout('finalCountdown('+finalTime+')',1000); 
}

