$(function() {

/*if($(".ContentDisplay_Title").html() === ''){
	$('.ContentDisplay_Title').addClass('nomargin');
}
if($('.ContentDisplay_Title').text() == ''){
	$('.ContentDisplay_Title').addClass('nomargin');
};*/

query = (window.location.search);
query = query.split('&');
items = {};
$(query).each(function(i, item){
  item = item.replace(/\?/, '');
  item = item.split('=');
  items[item[0]]  = item[1];
});
  if (items['NewsItemID'] && (items['GroupId'] == '1486' || items['Groupid'] == '1486' ) && (items['TabId'] == '1496' || items['tabid'] == '1496' )) {
    $('.ContentDisplay').css('display', 'none')
  }
  else
  {
        $('.ContentDisplay').css('display', 'block')    
  }

$('.ContentDisplay_Title').each(function () {
	if($(this).text() == '')
	{
		$(this).addClass('nomargin');
	}
});

if (($('.NewsModuleFooter').text() == "") || ($('.NewsModuleFooter').text() == "    ") || ($.trim($('.NewsModuleFooter').text()) == "")) {
	$('.NewsModuleFooter').addClass('nomargin');
	$('.NewsModuleFooter').hide();
}

$('.RightCol > ul li ul li div > a').click(function()
{
	return true;
});

$('.RightCol > ul > li > div > a').click(function()
{

	$('.RightCol ul li ul').hide();
	$('.RightCol li ul').removeClass('Children');
	$('.RightCol li').removeClass('Active');

	$(this).parent().parent().addClass('Active');
	$('.RightCol li.Active > ul').addClass('Children');
	$('.RightCol ul li ul.Children').show();

	return false;
});

$('.RightCol ul li ul').hide(); 


var str = document.URL;
str = str.replace("http://"+document.domain,"");
$('.RightCol ul li a').each(function(){
if($(this).attr('href')==str)
{
	$(this).parent().parent().parent().parent().addClass('Active');
	$(this).parent().parent().addClass('Active');
}

});


$('.RightCol li.Active > ul').addClass('Children');
$('.RightCol ul li ul.Children').show();

$('.RightCol li.Active').parents().filter('li').addClass('RootInPath');




$('.LeftCol .Plus ul li a').each(function(){
if(str.indexOf($(this).attr('href')) >= 0)
{
	$(this).parent().parent().addClass('Selected');
}

});


$('.LeftCol .Plus_English ul li a').each(function(){
if(str.indexOf($(this).attr('href')) >= 0)
{
	$(this).parent().parent().addClass('Selected');
}

});


$('.Footer .Before').hover(
	function () {
		$('.infoHover').show();
  	},
  	function () {
		$('.infoHover').hide();
  	}
	);

	$('.LeftCol .Plus ul li a').hover(function()
	{
	    $(this).parent().addClass('hover')
	    },
	    function(){$(this).parent().removeClass('hover')
	});
	
	$('.LeftCol .Plus ul li img').hover(function()
	{
	    $(this).parent().addClass('hover')
	    },
	    function(){$(this).parent().removeClass('hover')
	});

});
