function changeTab(obj) {
	$("#menu a.active").removeClass("active");
	var activeInn = $("#contentInn div.active");
	activeInn.hide();
	activeInn.removeClass("active");
	var id = "#" + obj.id;
	$(id).addClass("active");

	pageTracker._trackPageview('/topic/' + id + '.html');

	id = id + "Inn";
	$(id).fadeIn();
	$(id).addClass("active");
	return false;
}


function resizeLYO() {
	gW = $.viewportWidth();

	gH = $.viewportHeight();

	if (gH > 789) {
		var delta = gH - 789;
		var h = $('#in-progress').height()
		$('#in-progress').height(h  + delta);
	}

	if (gW <= 1150) {
		$('body').removeClass('gw980');
		$('body').addClass('gw1150');
	}

	if (gW < 1000) {
		$('body').width(998);
		$('body').removeClass('gw1150');
		$('body').addClass('gw980');
	}
}

var resizeTimer = null;

$(document).ready(function(){

	$(".thickbox").lightbox();

	$.viewportHeight = function() {
		return self.innerHeight ||
		jQuery.boxModel && document.documentElement.clientHeight ||
		document.body.clientHeight;
	};

	$.viewportWidth = function() {
		return self.innerWidth ||
		jQuery.boxModel && document.documentElement.clientWidth ||
		document.body.clientWidth;
	};

	resizeLYO();

	var pF = $('#paymentForm');
	if (pF.get(0)) {
		pF.submit(
			function () {
				$.post("/robokassa.php", 
					{ fio: $('#pf_fio').val(), price: $('#pf_price').val() },
					function(data){
						if (data.result == true) {							
							$('#paymentForm').parent('#payInn').html(data.content);
						} else {
							alert(data.error);
						}
					}, 
					"json"
				);
	
				return false;
			}
		)
	}


});

