function getAbsolutePosition(el) {
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent) {
		var tmp = getAbsolutePosition(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
}
function Mail() {
	var n = 'vanntrade';
	var s = '@';
	var m = 'yandex.ru';
	document.write(n + s + m);
}

$.fn.overlay=function(cl) {
	var el=$(this);
	$('body').prepend('<div id="overlay"></div>');
	if (cl) {$('#overlay').addClass(cl);}
	$('#overlay').click(function(){el.hide();$('#overlay').remove();});
	$('#overlay').show('slow');
	return this;
}

$.fn.centering=function() {
	this.css("position","absolute");
	this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
	this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
	return this;
}


$(document).ready(function(){

	$('div.pp h3 .x').click(function(){
		$(this).parents("div.pp").hide();
		$('#overlay').remove();
		return false;
	});
	
	$('a.for-pp-plitka-country').click(function(){
		$('#pp-plitka-country').overlay('black').show().centering();
		return false;
	});
	$('a.for-pp-plitka-proizv').click(function(){
		$('#pp-plitka-proizv').overlay('black').show().centering();
		return false;
	});
	$('a.for-pp-plitka-size').click(function(){
		$('#pp-plitka-size').overlay('black').show().centering();
		return false;
	});
		
});
