/* -------------------------------------------------- *
 * Project scripts
 * -------------------------------------------------- *
 * Author: Morozov Igor
 * URL: http://www.morozoff.info/
 * Copyright: 2010 Morozov Igor
** -------------------------------------------------- */
$(document).ready(function() {
	if($('.order-letter').length > 0) {
		$('.order-letter').click(function() {
			$(this).toggleClass('active-letter')
			$('#order-letter').toggle()
			return false;
		});
		$('#order-letter .close').click(function() {
			$('.order-letter').removeClass('active-letter')
		});
	}
	$('.pp-viewer .close').click(function() {
		$('.pp-viewer').hide()
		return false;
	});
	$('.rules-link').click(function() {
		showRules()
		return false;
	});
	$('.rfriend a').click(function() {
		$('#friend-open').toggle();
		return false;
	});
	$('#friend-open .close').click(function() {
		$('#friend-open').hide();
		return false;
	});
	if($('#scroll-main').length > 0) {
		$('#scroll-main').jScrollPane({
			scrollbarWidth:29,
			showArrows:false,
			dragMinHeight:29,
			dragMaxHeight:29
		});
	}
	/* $('.b-navigation a').hover(function() {
		$(this).addClass('hvr');
	}, function() {
		$(this).removeClass('hvr');
	}); */
});

function showRules() {
	$('#rules-show').toggle();
}

function successcomm() {
	var timehide, $smsg = $('#success-msg');
	$smsg.show()
	if(typeof document.body.style.maxHeight != "undefined") {
		$smsg.css('marginTop','-'+$('#success-msg').height()/2+'px');
	}
	
	$('.close',$smsg).click(function() {
		$smsg.hide();
		$('.overlay').hide();
		clearTimeout(timehide)
	});
	$('.overlay').show();
	
	timehide = setTimeout(function(){
		$smsg.hide();
		$('.overlay').hide();
	},2000)
	
}
