$(document).ready(function() {
	$().adaptive()
}); (function(a) {
	a.fn.tab = function(d, b, c,cls2) {
		var e, f;
		e = c.split(",");
		a.each(e,
		function(h, g) {
			if (h == 0) {
				a("#pdv_" + g).show();
			} else {
				a("#pdv_" + g).hide();
			}
		});
		//a("#" + d + ">li").first().removeClass(b).addClass(b + "_current");

		$('#'+d+'>li').removeClass(b);
		$('#'+d+'>li').addClass(cls2);
		$('#'+d+'>li').first().addClass(b);


		a("#" + d + ">li").bind("mouseover",
		function() {
			f = this.id.substr(4);
			//a("#" + d + ">li").removeClass(b + "_current").addClass(b);
			//a(this).removeClass(b).addClass(b + "_current");
			$('#'+d+'>li').removeClass(b);
			$(this).addClass(b);
			a.each(e,
			function(h, g) {
				if (g == f) {
					a("#pdv_" + g).show();
				} else {
					a("#pdv_" + g).hide();
				}
			})
		})
	}
})(jQuery); (function(a) {
	a.fn.adaptive = function() {
		var g = a("div.pdv_class");
		g.each(function(i) {
			var n = this.id;
			if (a("#s" + n)[0].style.overflow == "visible") {
				a("#" + n)[0].style.height = a("#s" + n)[0].offsetHeight + "px";
				var k = 0;
				var s = a("#" + n)[0].offsetLeft;
				var m = a("#" + n)[0].offsetTop;
				var o = a("#" + n)[0].offsetLeft + a("#" + n)[0].offsetWidth;
				var j = a("#" + n)[0].offsetTop + a("#" + n)[0].offsetHeight;
				var r = a("#" + n).siblings(".pdv_class");
				/*r.each(function(y) {
					var x = this.id;
					var t = a("#" + x)[0].offsetLeft;
					var u = a("#" + x)[0].offsetTop;
					var v = a("#" + x)[0].offsetHeight;
					var w = a("#" + x)[0].offsetLeft + a("#" + x)[0].offsetWidth;
					if (((t < s && w > s) || (t > s && t < o) || t == s) && u > m) {
						a("#" + x)[0].style.top = j + k + 10 + "px";
						k = k + v + 10
					}
				});*/
			} else {
				var q = a("#s" + n)[0].offsetHeight;
				var h = a("#s" + n).find(".pdv_border").css("borderWidth");
				var l = a("#s" + n).find(".pdv_border").css("padding");
				var p = a("#s" + n).find(".pdv_border").css("margin");
				if (p == "auto") {
					p = 0
				}
				h ? q -= parseInt(h) * 1 : q -= 0;
				l ? q -= parseInt(l) * 1 : q -= 0;
				p ? q -= parseInt(p) * 1 : q -= 0;
				//a("#s" + n).children(".pdv_border")[0].style.height = q + "px";
			}
		});
		var f = a("div.pdv_top");
		var e = 0,
		d = 0;
		f.each(function(i) {
			var h = this.id;
			d = a("#" + h).parents()[0].offsetTop + a("#" + h).parents()[0].offsetHeight;
			e = e > d ? e: d
		});
		a("#top")[0].style.height = e + "px";
		var f = a("div.pdv_middle");
		var c = 0,
		d = 0;
		f.each(function(i) {
			var h = this.id;
			d = a("#" + h).parents()[0].offsetTop + a("#" + h).parents()[0].offsetHeight;
			c = c > d ? c: d
		});
		a("#middle")[0].style.height = c + "px";
		var f = a("div.pdv_bottom");
		var b = 0,
		d = 0;
		f.each(function(i) {
			var h = this.id;
			d = a("#" + h).parents()[0].offsetTop + a("#" + h).parents()[0].offsetHeight;
			b = b > d ? b: d;
		});
		a("#bottom")[0].style.height = b + "px";
	}
})(jQuery);
