/*	JavaScript Document для проекта vmoralez.biz
	============================================
	Разработчик и программист: Шевцов Евгений
					 web-сайт: http://wwww.sitespring.ru
					   e-mail: info@sitespring.ru
	
	Любое использование или копирование запрещено правообладателем и автором кода. 
	Так что НЕХУЙ тут читать!!!
*/

$(document).ready(initPage);
$.ajaxSetup({cache:'false',global:'true',type:'POST',method:"POST",dataType:'html'});

function initPage()
{
	$(document.body).show();
	if(title = $('#replacedPageTitleBlock').html())
	{
		$('#replacedPageTitleBlock').hide();
		$('.pageTitleBlock_wrap02').html(title);
	}

	
	
	
	var currentHref = location.href.replace('http://'+location.host,'');
	
	// AutoMarked left menu
	$('.partTitle').each(function(){
		var pregPattern = new RegExp('^'+$(this).attr('href'));
		if(pregPattern.test(currentHref))
		{
			$(this).parent().addClass('dropped');
		}
	});
	
	
	// Get short current page 
	$('.navigationContainer a[href!=/]').each(function(){
		var pregPattern = new RegExp('^'+$(this).attr('href'));
		if(pregPattern.test(currentHref))
		{
			currentHref = $(this).attr('href');
		}
	});
		
		
	// AutoMarked current page top menu
	var navigationContainerLink = $('.navigationContainer a[href=' + currentHref + ']');
	if(navigationContainerLink)
	{
		$('.navigationContainer a').removeClass('marked');
		navigationContainerLink.addClass('marked');
	};
	
	
	// AutoMarked bottom menu
	var bottomNavigationContainerLink = $('.bottomNavigationContainer a[href=' + currentHref + ']');
	if(bottomNavigationContainerLink)
	{
			$('.bottomNavigationContainer a').removeClass('marked');
			bottomNavigationContainerLink.addClass('marked');
	}	
	
	
	
	
	
	// Drop down left menu
	$('.partTitle').click(function()
	{
		$(this).parent().toggleClass('dropped');
		//return false;
	});
}
