$(document).ready(function() {
	$.ifixpng('img/p.gif');
	$('.png').ifixpng();

	$('.with-text').each(function(){
								  
		$(this).focus(function(){
			if (this.value==this.defaultValue) {
				this.value="";
			}
		});

		$(this).blur(function(){
			if (this.value=="") {
				this.value=this.defaultValue;
			}
		});
		
	});

	//$('.languages a').dropShadow( {color:'#ffffff', left:0, top:0, blur:2, opacity:1} );
	$(window).resize(onResize);
	$(window).resize();	
	
	$('div.alphabet span.letter a').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();

		$('div.alphabet span.letter a').each(function() {
			$(this).removeClass('active');
		});
		
		$(this).addClass('active');
		
		var termsId = $(this).attr('href').toString();
		termsId = termsId.substr(1);

		$('.terms').removeClass('visible');
		$('#terms' + termsId).addClass('visible');
	});
	
	$('div.articles-toc div.link a').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();

		$('div.articles-toc div.link a').each(function() {
			$(this).removeClass('active');
		});
		
		$(this).addClass('active');
		
		var articleIndex = $(this).attr('href').toString();
		articleIndex = articleIndex.substr(1);
		$('.article').removeClass('visible');
		$('#article' + articleIndex).addClass('visible');
	});
	
});

function onResize()
{
	if ($.browser.msie && $.browser.version<=6)
	{
		if ($('body').width()<=990) 
			$('.all').css('width','990px');
		else 
			$('.all').css('width','auto');		
	}
	
	if ($('body').width()<=1150) 
		$('.head-2 h6').css('display','none');
	else
		$('.head-2 h6').css('display','block');
		
	if ($('body').width()<=1440) 
		$('.head-2 .ramka').css('display','none');
	else
		$('.head-2 .ramka').css('display','block');		
}

