/* ----------------------------------------------------------------------------------------------------------------- */
//      param

        var imgs			= getChild('img'); 	// нужно ставить условие на нежность этого параметра
	var start			= null;
	var func_event			= null;


//	каллендарь
	var cal_w = cal_w_tmp		= 246;
	var cal_h = cal_h_tmp		= 100;
	var cal_w_max			= 980;
	var cal_h_max			= 740;
	var cal_w_step			= 20;
	var cal_h_step			= 15;
	var cal_time			= 10;
	var cal_event			= null;

//      блок каллендарь
        var img_w			= 62;			// должно соответствовать ширине картинки в cal.css
        var img_h			= 33;			// должно соответствовать высоте картинки в cal.css
        var img_w_max			= 200;
        var img_h_max			= 100;
        var img_w_step			= 10;
        var img_h_step			= 6;
        var img_time			= 10;
        var img_start			= [];
        var img_event			= [];

//      блок more
        var more_w			= 28;			// должно соответствовать width видимой части блока "a href" в more.css
        var more_m			= 833;			// должно соответствовать margin для #more в index.css 
	var more_w_min			= 153;			// должно соответствовать width для #more в index.css 
        var more_w_max			= 985;
        var more_w_div_max		= 170;
        var more_w_step			= 10;
        var more_time			= 50;
        var more_event			= null;
        var more_start			= [];

//	анимация ссылки
	var arr_pos = arr_pos_tmp	= 100;
	var href_pos = href_pos_tmp	= 0;
	var arr_pos_min			= -5;
	var arr_pos_end			= 105;
	var href_pos_end		= 20;
	var arr_step			= 1;
	var href_step			= 2;
	var href_event			= 0;

//	анимация падания новостей на первой странице
//	скорее всего нужны start и func_event
	var blocks_m_step		= 114;
	var blocks_m = blocks_m_max	= -(20*blocks_m_step);
	var blocks_start		=null;

//	востановление пароля
	var repair_m = repair_m_tmp	= -170;
	var repair_step			= 10;
	var start_repair		= null;

//	пролистывание страниц в more
	var page 			= 4;
				
/* ------------------------------------------------------------------------------------------------------ */



        function $(id)
        {
                return document.getElementById(id);
        }

        function $$(id)
        {
                return window.top.document.getElementById(id);
        }

        function _(str)
	{
		alert(str);
	}
					
					
        function getChild(tag, id)
        {
                if (tag)
		{
                        return elems = !id ? document.getElementsByTagName(tag) : $(id).getElementsByTagName(tag);
		}else{
		        return false;
		}
        }


//	searchId	- то что ищим
//	cnt		- просматривать количество уровней вверх
	function searchParent(t, searchId, cnt)
	{
		var p = t;
		var id = false;

		while (cnt)
		{
			if (p.parentNode)
			{
				p = p.parentNode;

				if (p.id && p.id == searchId)
				{
					id = p.id;
					break;
				}
			}else{
				break;
			}

			cnt--;
		}

		return id;
	}



//	определяем наличие в массиве  arr значения val
//	одномерный массив
        function index_of(arr, val)
        {
		for (i=0; i<arr.length; i++)
                {
		        if (arr[i] == val)
			{
		                return val;
			}
		}

                return false;
        }

//	получаем цифровую составляющую из строки
	function parseNum(str)
	{
                return str.replace(/\D+/g, '', str);
	}



//	получаем параметры из url или строкм
	function parseUrl(part, param, level, str)
	{
                var result = '';
                var url = level == 'top' ? window.top.location : (str ? str : window.location);

                switch (part)
                {
                        case 'get':
                                var srch = url.search.replace('?', '');
                                srch = srch.split("&");

                                for (i in srch)
                                {
                                        if (srch[i].replace(param+'=', '').length != srch[i].length)
                                        {
                                                result = srch[i].replace(param+'=', '');
                                        }
                                }
    				break;
	
	                case 'hash':
			        result = url.hash == param ? 1 : 0;
			        break;
                }

                return result;
        }

//	изменение высоты фрейма (iframe) - родителя, в зависимомти от контента содержащегося в нем (src)
	function autoIframeParent(frameId)
	{
	        try
		{
			if ($$(frameId))
			{
		        	frame			= $$(frameId);
				innerDoc		= (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
	            		objToResize		= (frame.style) ? frame.style : frame;
				frame.style.height	= innerDoc.body.scrollHeight < 500 ? 500 : innerDoc.body.scrollHeight + 10;
				frame.style.height 	= objToResize.height+'px';
			}

		}catch(err){
                	window.status = err.message;
		}
	}

/* ------------------------------------------------------------------------------------------------------ */


        function Class()
        {
                var obj = this;

// ---------------------------------------------------------------------------------------------------------
//		new

                this.animCal = function()
		{
			if ($$('bg_white') && $$('callendar') && $('clips_title'))
			{
				$('clips_title').onclick = function()
				{
					$$('callendar').style.position	= 'absolute';
					$$('callendar').style.zIndex	= 100;
				
					if (!window.top.cal_event)
					{
						$('clips_title').style.display	= 'none';

						$$('bg_white').className	= '';

						window.top.cal_start = setInterval("anim_cal_over()", window.top.cal_time);

						obj.upCalImg();
					}
				}
			}
		}


                this.animMore = function()
		{
			if (window.top.$('bg_white') && window.top.$('more'))
			{
				var elems = imgs;
				
				if (elems)
				{
					for (var i=0; i<elems.length; i++)
					{
						elems[i].onclick = function()
						{
							if (!window.top.more_event)
							{
								$$('bg_white').className 	= '';
								$$('more').style.width 		= more_w_max+'px';
								$$('more').style.marginLeft	= 0+'px';
								$$('callendar').className	= 'unvis';

								for (var ii=0; ii<elems.length; ii++)
								{
									$(elems[ii].id).more_w		= more_w;
									more_start[elems[ii].id]	= setInterval("anim_more_over('"+elems[ii].id+"')", more_time);
								}
								return false;
							}else{
								window.top.location.href = this.parentNode.parentNode.href;
							}
						}
					}
				}
			}
		}
																																																																																																																																																															
                this.closeAnim = function()
		{
			var body = window.top.document.getElementsByTagName('body')[0];

                        body.onmouseover = function()
                        {
                                if (ifr_c1.document.getElementById('clips_title') && ifr_c1.document.getElementById('clips_title').style.display == 'block')
                                {
                                        ifr_c1.document.getElementById('clips_title').style.display = 'none';
                                }
			}
		
			if ($('cal_close'))
			{
				$('cal_close').onclick = function()
				{
					if (cal_event)
					{

						cal_event	= null;
					
						start = setInterval("anim_cal_out()", cal_time);

						obj.downCalImg();
						
						$('cal_close').className = 'unvis';
					}
				}
			}
		}

                this.upCalImg = function()
		{
			var elems = imgs;
		
			if(elems)
			{
				for (var i=0; i<elems.length; i++)
				{
					if(!img_event[elems[i].id])
					{
						elems[i].img_w		= img_w;
						elems[i].img_h		= img_h;
						img_start[elems[i].id]	= setInterval("anim_img_over('"+elems[i].id+"')", img_time);
						img_event[elems[i].id]	= 1;
					}
				}
			}
		}

		this.downCalImg = function()
		{
			if(ifr_c1.imgs)
			{
				var elems = ifr_c1.imgs;

				for (var i=0; i<elems.length; i++)
				{
					if(ifr_c1.img_event[elems[i].id])
					{
						ifr_c1.img_start[elems[i].id]	= setInterval("anim_img_out('"+elems[i].id+"')", ifr_c1.img_time);

						ifr_c1.img_event[elems[i].id]	= 0;

						ifr_c1.$('clips').className	= '';
					}
				}
			}
		}

		this.closeMore = function()
		{
			$('more_close').onclick = function()
			{
				if (more_event)
				{
					more_event				= null;
					
					$('more').style.height			= '125px';

					if ($('col3'))
					{
						$('col3').style.display		= 'block';
					}

					if ($('pr_block'))
					{
						$('pr_block').style.display	= 'block';
					}

					obj.downMoreImg();
				}
			}
		}

		this.downMoreImg = function()
		{
			if(ifr_c3.imgs)
			{
				var elems = ifr_c3.imgs;
				
				ifr_c3.$('clips').className	= '';

				for (var i=0; i<elems.length; i++)
				{
					if (elems[i].id)
					{
						more_start[elems[i].id]	= setInterval("anim_more_out('"+elems[i].id+"')", more_time);
					}
				}
			}
		}


		this.animNext = function(f, s, p)
		{
			page = p;
			
			$(f).onclick = function()
			{
				if(page < 4 && $('p'+page))
				{
					$('p'+page).className		= 'unvis';

					page += 1;

					$(s).style.color		= '';

					if (page == 4)
					{
						$(f).style.color	= '#aaa';
					}

					if ($('p'+page))
					{
						$('p'+page).className	= '';
					}
				}

				return false;
			}

			$(s).onclick = function()
			{
				if(page > 1 && $('p'+page))
				{
					$('p'+page).className		= 'unvis';

					page -= 1;

					$(f).style.color		= '';

					if (page == 1)
					{
						$(s).style.color	= '#aaa';
					}

					if ($('p'+page))
					{
						$('p'+page).className	= '';
					}
				}

				return false;
			}
		}


// ---------------------------------------------------------------------------------------------------------

//		при наведении на каллендарь появляется полупрозрачное окно с кнопкой
        	this.calTitle = function()
		{
		        if ($('clips') && $('clips_title'))
		        {
		                $('clips').onmouseover = function()
		                {
		                        if ($$('callendar') && $$('callendar').style.position != 'absolute')
					{
					        $('clips_title').style.display = 'block';
					}
				}
			}
		}


//		анимация заголовка новости на первой стр
		this.overTitle = function()
		{
			var elems =  getChild('a');
			
                        if (elems.length)
                        {
				for(var i=0; i<elems.length; i++)
				{
					if (elems[i].className == 'v_title')
					{
						elems[i].onmouseover = function()
						{
							arr_pos = arr_pos_min;
						
							if (href_event && href_event != this.id)
							{
								for(var ii=0; ii<elems.length; ii++)
								{
									if (elems[ii].className == 'v_title')
									{
										anim_title_drop(elems[ii].id);
									}
								}
							}
							
							href_event = this.id;

							if (start)
							{
								clearInterval(start);
								start = null;
							}

							this.style.backgroundPosition = '-5% 50%';

							start = setInterval("title_href('"+this.id+"')", 1);
						}


						elems[i].onmouseout = function()
						{
							if (this.className == 'v_title')
							{
								if (start)
								{
									clearInterval(start);
									start = null;
								}
								start = setInterval("title_href_out('"+this.id+"')", 1);
							}
						}
					}
				}
			}
		}

//		анмация ссылки
                this.overHref = function()
                {
			var elems =  getChild('a');

                        if (elems.length)
                        {
				for(var i=0; i<elems.length; i++)
				{
					elems[i].onmouseover = function()
					{
						if (this.className == 'anim')
						{
							if (href_event && href_event != this.id)
							{
								for(var ii=0; ii<elems.length; ii++)
								{
									if (elems[ii].className == 'anim')
									{
										anim_href_drop(elems[ii].id);
									}
								}
							}
							
							href_event = this.id;
						
							if (start)
							{
								clearInterval(start);
								start = null;
							}

							this.style.backgroundPosition = '100% 50%';

							start = setInterval("anim_href('"+this.id+"')", 1);
						}
					}

					elems[i].onmouseout = function()
					{
						if (this.className == 'anim')
						{
							if (start)
							{
								clearInterval(start);
								start = null;
							}
							start = setInterval("anim_href_out('"+this.id+"')", 1);
						}
					}
				}
			}
		}

//		падающие блоки новостей на первой стр
		this.blocks = function()
		{
			if($('blocks'))
			{
				var elem		= $('blocks');
				elem.style.marginTop	= !elem.style.marginTop ? blocks_m_max+'px' : elem.style.marginTop;

				if (blocks_start)
				{
					clearInterval(blocks_start);
					start	= null;
				}

				blocks_start	= setInterval("animBlocks()", 3000);
			}else{
				return false;
			}
		}

//		запуск ролика на первой стр. для IE
		this.prPlay = function()
		{
			$('pr_play').onclick = function()
			{
				window.location.href	= this.parentNode.parentNode.href;
			}
		}


//		все что ниже относится только к пользователю, регистрации и т.п.
		this.signin = function()
		{
			if($('signin') && $('frm_signin'))
			{
				if ($('email') && $('pass'))
				{
					if($('email').value && $('email').value != 'E-mail')
					{
						$('pass').value	= '';
					}
				
					$('email').onfocus = function()
					{
						if ($('email').value == 'E-mail')
						{
							$('email').value	= '';
							$('pass').value		= '';
						}
					}
					
					$('email').onblur = function()
					{
						if ($('email').value == '' && $('pass').value == '')
						{
							$('email').value	= 'E-mail';
							$('pass').value		= 'password';
						}
					}

					$('pass').onfocus = function()
					{
						if ($('email').value == 'E-mail')
						{
							$('email').value	= '';
							$('pass').value		= '';
						}
					}

					$('pass').onblur = function()
					{
						if ($('email').value == '' && $('pass').value == '')
						{
							$('email').value	= 'E-mail';
							$('pass').value		= 'password';
						}
					}
				}
			
				$('signin').onclick = function()
				{
					$('frm_signin').submit();
				}
			}
		}
		

		this.signout = function()
		{
			if($('signout') && $('frm_signout'))
			{
				$('signout').onclick = function()
				{
					$('frm_signout').submit();
				}
			}
		}

		this.reg = function()
		{
			if($('registration') && $('frm_reg'))
			{
				$('registration').onclick = function()
				{
					if ($('pass1') && $('pass2') && $('pass1').value == $('pass2').value)
					{
						$('frm_reg').submit();
					}else{
						_('Пароли не совпадают, введите их заново!');
						$('pass1').value = $('pass2').value = '';
					}
				}
			}
		}
		
		this.pass_forgot = function()
		{
			if($('pass_forgot') && $('frm_repair') && $('frm_repair_div') && $('login_div') && $('repair'))
			{
				$('pass_forgot').onclick = function()
				{
					$('login_div').style.visibility = 'hidden';

					if (!$('frm_repair_div').style.marginTop)
					{
						$('frm_repair_div').style.marginTop = repair_m+'px';
					}

					if (start_repair)
					{
						clearInterval(start_repair);
						start_repair = null;
					}
					
					start_repair = setInterval("animRepair('frm_repair_div')", 40);
				}
				
				$('repair_cancel').onclick = function()
				{
					if (start_repair)
					{
						clearInterval(start);
						start_repair = null;
					}

					if ($('frm_repair_div').style.marginTop)
					{
						start_repair = setInterval("animRepairCancel('frm_repair_div')", 40);
					}
				}
				
				$('repair').onclick = function()
				{
					$('frm_repair').submit();
				}
			}
		}

		this.pass_login = function()
		{
			if($('login') && $('frm_signin') && $('frm_signin_div') && $('login_div') && $('signin'))
			{
				$('login').onclick = function()
				{
					$('login_div').style.visibility = 'hidden';

					if (!$('frm_signin_div').style.marginTop)
					{
						$('frm_signin_div').style.marginTop = repair_m+'px';
					}

					if (start_repair)
					{
						clearInterval(start_repair);
						start_repair = null;
					}
					
					start_repair = setInterval("animRepair('frm_signin_div')", 40);
				}
				
				$('signin_cancel').onclick = function()
				{
					if (start_repair)
					{
						clearInterval(start);
						start_repair = null;
					}

					if ($('frm_signin_div').style.marginTop)
					{
						start_repair = setInterval("animRepairCancel('frm_signin_div')", 40);
					}
				}
				
				$('signin').onclick = function()
				{
					$('frm_signin').submit();
				}
			}
		}

		
		this.history_clear = function()
		{
			if($('history_clear') && ifr_c2.$('frm_history_clear'))
			{
				$('history_clear').onclick = function()
				{
					$('clip_func').style.display = 'none';
					ifr_c2.$('frm_history_clear').submit();
					return false;
				}
			}
		}
		
		this.playlist_clear = function()
		{
			if ($('playlist_clear') && ifr_c2.$('frm_pl'))
			{
				$('playlist_clear').onclick = function()
				{	
					$('clip_func').style.display = 'none';
					ifr_c2.$('frm_pl').submit();
					return false;
				}
			}
		}

		this.playlist = function()
		{
			if ($('frm_pl'))
			{
				var block		= $('blocks') ? $('blocks') : ($('frm_pl') ? $('frm_pl') : '');
				var kind		= $('blocks') ? 'add' : ($('frm_pl') ? 'delete' : '');
				var alert_string	= kind == 'add' ? 'добавлено в плейлист' : 'удалено из плейлиста';

				if (block && kind)
				{
					var elems = getChild('img', block.id);
					
					if(elems.length)
					{
						for(var i=0; i<elems.length; i++)
						{
							elems[i].onclick = function()
							{
								var parent = this.parentNode;
							
								if (parent.className == 'pl')
								{
									var id = parseNum(this.id);

									if (id)
									{
										parent.style.display	= 'none';
										$('frm_pl').action	= '/playlist.php?clip='+id+'&kind='+kind+'&simple=1';
										$('frm_pl').submit();
									}
									_('Видео '+alert_string);
									return false;
								}
							}
						}
					}
					else if ($('f4'))
					{
						var elem = getChild('img', 'f4');
				
						el = elem[0];

						el.onclick = function()
						{
							var id = parseNum(this.id);
					
				    			if (id)
							{
								$('f4').style.display	= 'none';
								$('frm_pl').action	= '/playlist.php?clip='+id+'&kind=add&simple=1';
								$('frm_pl').submit();
								_('Видео добавлено в плейлист');
								return false;
							}
						}
					}
				}
			}
		}
		
		this.chgProfile = function()
		{

			if($('chg') && $('frm_chg'))
			{
				$('chg').onclick = function()
				{
					$('frm_chg').submit();
				}
			}
			
			if($('del') && $('frm_del'))
			{
				$('del').onclick = function()
				{
					$('frm_del').submit();
				}
			}
			
		}
		
		this.clip_add = function()
		{
			if($('clip_add') && $('frm_clip_add'))
			{
                                $('clip_add').onclick = function()
				{
				        $('frm_clip_add').submit();
				}
			}
		}

		this.clip_description = function()
		{
			if($('clip_del') && $('frm_clip_del'))
			{
				$('clip_del').onclick = function()
				{
					$('frm_clip_del').submit();
				}
			}

			if($('clip_add') && $('frm_clip_add'))
			{
				$('clip_add').onclick = function()
				{
					$('frm_clip_add').submit();
				}
			}
		}
		
		this.blog_save = function()
		{
			if($('blog_save') && $('frm_blog_save'))
			{
				$('blog_save').onclick = function()
				{
					$('frm_blog_save').submit();
				}
			}
		}
		
		this.fullscreen = function(clipUrl, clipImgUrl)
		{
			if($('f1_div') && $('f2_div') && $('f3_div') && $('f1') && $('f2') && $('f3') && $('f1_close') && $('f2_close') && $('f3_close') && $('clip_fullscreen') && ($('clip_place_fullscreen') || $('clipPlace'))&& $('bg_white'))
			{

				$('f1').onclick = function()
				{
					$('f1_div').className	= '';
					$('bg_white').className	= '';
					$('f2_div').className	= 'unvis';
					$('f3_div').className	= 'unvis';
                                        $('anim').style.opacity	= 0.1;
                                        $('anim').style.filter	= 'alpha(opacity=10)';
					func_event		= 1;

					return false;
				}

				$('f3').onclick = function()
				{
					$('f3_div').className	= '';
					$('bg_white').className	= '';
					$('f1_div').className 	= 'unvis';
					$('f2_div').className 	= 'unvis';
                                        $('anim').style.opacity	= 0.1;
                                        $('anim').style.filter	= 'alpha(opacity=10)';
					func_event		= 1;
					return false;
				}

				$('f2').onclick = function()
				{
					$('clip').innerHTML	= '<div id="clipPlace"></div>';
					$('f2_div').className	= '';
					$('bg_white').className	= '';
					$('f1_div').className 	= 'unvis';
					$('f3_div').className 	= 'unvis';
                                        $('anim').style.opacity	= 0.1;
                                        $('anim').style.filter	= 'alpha(opacity=10)';
					func_event		= 1;

					createPlayer ('single', 800, 600, clipUrl, clipImgUrl, '/img/skin.swf', true, false, false, 'uniform', 'clip_place_fullscreen');

					return false;
				}

				$('f1_close').onclick = $('f3_close').onclick = $('f2_close').onclick = document.onkeydown = function(event)
				{
                    			var e = event || window.event;

			                code = e.keyCode ? e.keyCode : e.charCode;

		                        if ((!$('f1_div').className || !$('f2_div').className || !$('f3_div').className) && (code == 27 || !code))
		                        {
						$('clip_fullscreen').innerHTML	= '<div id="clip_place_fullscreen"></div>';
						$('f1_div').className	= 'unvis';
						$('f2_div').className	= 'unvis';
						$('f3_div').className	= 'unvis';
						$('bg_white').className	= 'unvis';
                                    		$('anim').style.opacity	= 1;
                                    		$('anim').style.filter	= 'alpha(opacity=100)';
						func_event		= 0;

						setTimeout("createPlayer ('single', 580, 345, '"+clipUrl+"', '"+clipImgUrl+"', '/img/skin.swf', true, false, false, 'uniform', 'clipPlace')", 1);
		                        }
				}
			}
		}
	}
	


/* ------------------------------------------------------------------------------------------------------ */

//	востановление пароля
	animRepair = function(id)
	{
		repair_m += repair_step;
		
		$(id).style.marginTop = repair_m+'px';
		
		if (repair_m >= 0)
		{
			clearInterval(start_repair);
			start_repair	= null;
		}
	}
	
	animRepairCancel = function(id)
	{
		repair_m -= repair_step;

		$(id).style.marginTop = repair_m+'px';

		if (repair_m <= repair_m_tmp)
		{

			clearInterval(start_repair);
			start_repair	= null;
			repair_m	= repair_m_tmp;
			$('login_div').style.visibility = 'visible';
		}
	}


//	анимация ссылки
	anim_href = function(id)
	{
		var obj		= $(id);

		if (arr_pos < 0 || arr_pos > 0 && arr_pos < arr_pos_end)
		{
			arr_pos 	+= arr_step;
			href_pos	+= href_step;

			obj.style.backgroundPosition	= arr_pos+'% 50%';
			obj.style.paddingLeft		= href_pos+'px';
			obj.style.paddingRight		= (href_pos_end-href_pos)+'px';

		}else{
			clearInterval(start);
			start 		= null;

			if (arr_pos >= arr_pos_end)
			{
				arr_pos	= arr_pos_min;
				start	= setInterval("anim_href('"+id+"')", 1);
			}
		}
	}
	
	
	anim_href_out = function(id)
	{
		var obj = $(id);

		if (arr_pos < 0 && arr_pos >= (arr_pos_min+1) || arr_pos == 0 || arr_pos > arr_pos_tmp)
		{
			arr_pos 	-= arr_step;
			href_pos	-= href_step;

			obj.style.backgroundPosition	= arr_pos+'% 50%';
			obj.style.paddingLeft		= href_pos+'px';
			obj.style.paddingRight		= (href_pos_end-href_pos)+'px';

		}else{
			clearInterval(start);
			start		= null;
			
			if (arr_pos < (arr_pos_min+1))
			{
				arr_pos = arr_pos_end;
				start	= setInterval("anim_href_out('"+id+"')", 1);
			}else{
				href_event = null;
			}
		}
	}
	

	anim_href_drop = function(id)
	{
		if (id)
		{
			var elem = $(id);
			
			elem.style.paddingLeft		= href_pos_tmp+'px';
			elem.style.paddingRight		= href_pos_end+'px';
			elem.style.backgroundPosition	= arr_pos_tmp+'% 50%';
		}
	}


	


//	анимация заголовка новости на первой стр
	title_href = function(id)
	{
		var obj		= $(id);

		if (arr_pos < 0)
		{
			arr_pos 	+= arr_step;
			href_pos	+= href_step;

			obj.style.backgroundPosition	= arr_pos+'% 50%';
			obj.style.paddingLeft		= href_pos+'px';

		}else{
			clearInterval(start);
			start 		= null;
		}
	}


	title_href_out = function(id)
	{
		var obj = $(id);
		
		if (arr_pos <= 0 && arr_pos >= arr_pos_min)
		{
			arr_pos 	-= arr_step;
			href_pos	-= href_step;

			obj.style.backgroundPosition	= '-5% 50%';
			obj.style.paddingLeft		= '0px';

		}else{
			clearInterval(start);
			start		= null;
			href_event	= null;
			arr_pos		= arr_pos_tmp;
			href_pos	= href_pos_tmp;
		}
	}


	anim_title_drop = function(id)
	{
		if(id)
		{
			var elem = $(id);
			
			elem.style.paddingLeft		= '0px';
			elem.style.backgroundPosition	= '-5% 50%';
		}
	}

//	падающие новости на первой стр
	animBlocks = function()
	{
		blocks_m += blocks_m_step;

		$('blocks').style.marginTop = blocks_m+'px';

		if (blocks_m >= 0)
		{
			clearInterval(blocks_start);
			start	= null;

			$('blocks').style.marginTop = '0px'; 
		}
	}


//      more
        anim_more_over = function(id)
        {
                var obj		= $(id);
		var pObj	= obj.parentNode;
		var ppObj	= pObj.parentNode;

                if (obj.more_w < more_w_div_max)
                {
                        obj.more_w		+= more_w_step;
			pObj.style.width	= ppObj.style.width	= obj.more_w+'px';

                }else{
                        clearTimeout(more_start[id]);

                        more_start[id]			= null;
                        window.top.more_event		= 1;
                        $('clips').className		= 'div_sel';
			$('more_title').style.display	= 'block';
			$$('more_close').className	= '';
			$$('more').style.height		= '200px';
			if ($$('col3'))
			{
				$$('col3').style.display	= 'none';
			}
			
			if ($$('pr_block'))
			{
				$$('pr_block').style.display	= 'none';
			}
                }
	}

	anim_more_out = function(id)
	{
		var obj		= ifr_c3.$(id);
		var pObj	= obj.parentNode;
		var ppObj	= pObj.parentNode;

		if (obj.more_w > more_w)
		{
			obj.more_w				-= more_w_step;
			pObj.style.width = ppObj.style.width	= obj.more_w+'px';
		}else{
			clearTimeout(more_start[id]);
			more_start[id]				= null;

			obj.more_w				= more_w;
			pObj.style.width = ppObj.style.width	= obj.more_w+'px';
			$('more').style.width			= more_w_min+'px';
			$('more').style.marginLeft		= more_m+'px';
			
			$('more_close').className		= 'unvis';
			ifr_c3.$('more_title').style.display	= 'none';
			$('bg_white').className			= 'unvis';
			$('callendar').className		= '';

		}
	}

//      каллендарь
        anim_img_over = function(id)
        {
                var obj = $(id);

                if (obj.img_w < img_w_max)
                {
                        obj.img_w			+= img_w_step;
			obj.img_h			+= img_h_step;

                        obj.style.width			= obj.img_w+'px';
                        obj.style.height		= obj.img_h+'px';
                }else{
                        clearTimeout(img_start[id]);
                        img_start[id]			= null;

			obj.img_w			= img_w_max;
			obj.img_h			= img_h_max;

                        obj.style.width			= obj.img_w+'px';
                        obj.style.height		= obj.img_h+'px';
		}
	}


        anim_cal_over = function()
        {
		if ($$('callendar') && $('search') && $('clips'))
		{
			$('search').className 		= '';
			$$('callendar').style.marginTop	= '-150px';		

			var elems = $('clips').getElementsByTagName('a');
		
			for (var i=0; i<elems.length; i++)
			{
				elems[i].style.height	= '27%';
			}

            		if (window.top.cal_w < cal_w_max)
            		{
                    		window.top.cal_w	+= cal_w_step;

				if (window.top.cal_h < cal_h_max)
				{
                    			window.top.cal_h	+= cal_h_step;
				}else{
                    			window.top.cal_h	= cal_h_max;
				}

                    		$$('callendar').style.width	= window.top.cal_w+'px';
                    		$$('callendar').style.height	= window.top.cal_h+'px';

            		}else{
                    		clearTimeout(window.top.cal_start);
                    		window.top.cal_start		= null;
                    		window.top.cal_event		= 1;

				$('clips').className		= 'div_sel';
				$$('cal_close').className	= '';
			}
		}
	}


	anim_cal_out = function()
	{
		$('callendar').style.marginTop		= '0px';
		ifr_c1.$('search').className 		= 'unvis';

		var elems = ifr_c1.$('clips').getElementsByTagName('a');
		
		for (var i=0; i<elems.length; i++)
		{
			elems[i].style.height			= '33%';
		}

		if (cal_w > cal_w_tmp)
		{
			cal_w		-= cal_w_step;

			if (window.top.cal_h > cal_h_tmp)
			{
				cal_h	-= cal_h_step;
			}else{
				cal_h	= cal_h_tmp;
			}	

			$('callendar').style.width	= cal_w+'px';
			$('callendar').style.height	= cal_h+'px';
		}else{
			clearTimeout(start);
			start				= null;
			cal_w				= cal_w_tmp;
			cal_h				= cal_h_tmp;
			$('callendar').style.position	= '';
			$('callendar').style.zIndex	= 0;
			$('bg_white').className		= 'unvis';
		}
	}


	anim_img_out = function(id)
	{
		var obj = ifr_c1.$(id);

		if (obj.img_w > ifr_c1.img_w)
		{
			obj.img_w		-= ifr_c1.img_w_step;
			obj.img_h		-= ifr_c1.img_h_step;

			obj.style.width		= obj.img_w+'px';
			obj.style.height	= obj.img_h+'px';

		}else{
			clearTimeout(ifr_c1.img_start[id]);
			ifr_c1.img_start[id]	= null;
			obj.img_w		= ifr_c1.img_w;
			obj.img_h		= ifr_c1.img_h;

			obj.style.width		= ifr_c1.img_w+'px';
			obj.style.height	= ifr_c1.img_h+'px';
		}
	}



