﻿/// <reference path="jquery-vsdoc.js" />
/// <reference path="lw.js" />

lw.AppendInit(function () {
	lw.menus = $(".menus>div");
	lw.menus.openWait = 1000;
	lw.menus.closeWait = 1000;
	lw.menus.preToggletimeout = null;
	lw.menus.openMenu = null;
	lw.menus.openDuration = 300;
	lw.menus.closeDuration = 300;
	lw.menus.openEasing = "linear";
	lw.menus.closeEasing = "linear";

	lw.menus.each(function () {
		var menu = this;
		menu._$ = $(this);
		menu.nav = this._$.children(".f");
		menu.nav[0].menu = this;
		menu.b = this._$.children(".b");
		menu.h = this._$.children(".h");
		menu.h[0].menu = this;
		menu.b[0].menu = this;
		menu.menuOpen = false;
		menu.preOpen = false;
		menu.preClose = false;

		menu._preToggle = function (a) {
			if (a.type == "mouseover")
				menu.preOpen = true;
			else
				menu.preOpen = false;

			menu.preClose = !menu.preOpen;

			this.menu.preToggle();
		};
		menu.preToggle = function () {
			clearTimeout(lw.menus.preToggletimeout);
			if (menu.preClose)
				lw.menus.preToggletimeout = setTimeout(menu.close, lw.menus.closeWait);
			else
				lw.menus.preToggletimeout = setTimeout(menu.open, lw.menus.openWait);
		};
		menu.open = function () {
			clearTimeout(lw.menus.preToggletimeout);
			if (lw.menus.openMenu) {
				if (lw.menus.openMenu == menu)
					return;
				lw.menus.openMenu.close();
			}
			lw.menus.openMenu = menu;

			menu.menuOpen = true;
			if (menu.b.hasClass("bb")) {
				menu.b.stop().animate({
					height: 60
				}, {
					duration: lw.menus.openDuration,
					easing: lw.menus.openEasing
				});
			}
			else {
				menu.b.stop().animate({
					height: 120
				}, {
					duration: lw.menus.openDuration,
					easing: lw.menus.openEasing
				});
			}
			menu.nav.addClass("factive");
			if (menu.nav.hasClass("ff")) {
				menu.nav.stop().animate({
					"margin-top": 60
				}, {
					duration: lw.menus.openDuration,
					easing: lw.menus.openEasing
				});
			}
			else {
				menu.nav.stop().animate({
					"margin-top": 120
				}, {
					duration: lw.menus.openDuration,
					easing: lw.menus.openEasing
				});
			}
		};
		menu.close = function () {
			clearTimeout(lw.menus.preToggletimeout);
			lw.menus.openMenu = null;
			menu.menuOpen = false;
			menu.b.stop().animate({
				height: 0
			}, {
				duration: lw.menus.closeDuration,
				easing: lw.menus.closeEasing
			});
			menu.nav.removeClass("factive");
			menu.nav.stop().animate({
				"margin-top": 0
			}, {
				duration: lw.menus.closeDuration,
				easing: lw.menus.closeEasing - 5
			});
		};

		menu.nav.bind("mouseover", menu._preToggle);
		menu.b.bind("mouseover", menu._preToggle);
		menu.h.bind("mouseover", menu._preToggle);

		menu.nav.bind("mouseout", menu._preToggle);
		menu.b.bind("mouseout", this._preToggle);
		menu.h.bind("mouseout", this._preToggle);

		menu.nav.bind("click", function () {
			if (this.menu.menuOpen)
				this.menu.close();
			else
				this.menu.open();
		});
		menu.h.bind("click", function () {
			if (!this.menu.menuOpen)
				this.menu.open();
		});
	});


	var gallery = lw.gallery = [{
		index: 0,
		width: 208,
		height: 249,
		widthTo: 450,
		heightTo: 249,
		right: [1, 2, 3, 4, 5],
		posRight: [[1, 3, 4], [2, 5, 5]],
		background: "url(" + lw.vroot + "/images/gallery/bg0.jpg)",
		gsBackground: "url(" + lw.vroot + "/images/gallery/gs/bg0.jpg)",
		backgroundPosition: "-20px -1px",
		activeBackgroundPosition: "-1px -1px",
		shrinkBG: "-50px -1px",
		t: {
			top: 100, left: 153,
			text: "When my parents and I decided to move to Kurdistan, one of the main concerns was which university would be the best for me...",
			c: "h", f: "r"
		}
	}, {
		index: 1,
		width: 174,
		height: 140,
		widthTo: 350,
		heightTo: 180,
		left: [0],
		right: [3, 4, 5],
		down: [2],
		posLeft: [[0]],
		posRight: [[3, 4], [5, 5]],
		posBottom: [[2]],
		stickWidth: 2,
		stickLeft: 2,
		background: "url(" + lw.vroot + "/images/gallery/bg1.jpg)",
		gsBackground: "url(" + lw.vroot + "/images/gallery/gs/bg1.jpg)",
		backgroundPosition: "-180px -1px",
		activeBackgroundPosition: "-20px -1px",
		shrinkBG: "-180px -1px",
		t: {
			top: 12,
			left: 0,
			text: "Honestly, I can say SABIS<sup>&reg;</sup> has changed my life for the better...",
			c: "v", f: "l"
		}
	}, {
		index: 2,
		width: 174,
		height: 86,
		widthTo: 381,
		heightTo: 190,
		left: [0],
		right: [3, 4, 5],
		top: [1],
		posLeft: [[0]],
		posTop: [[1]],
		posRight: [[3, 4], [5, 5]],
		stickWidth: 1,
		stickLeft: 1,
		background: "url(" + lw.vroot + "/images/gallery/bg2.jpg)",
		gsBackground: "url(" + lw.vroot + "/images/gallery/gs/bg2.jpg)",
		backgroundPosition: "-90px -25px",
		activeBackgroundPosition: "-1px -1px",
		t: {
			top: 85,
			left: 10,
			text: "I feel like SABIS<sup>&reg;</sup> University is my second home and family…every one cares and monitors my progress...",
			c: "h", f: "b"
		}
	}, {
		index: 3,
		width: 416,
		height: 120,
		widthTo: 450,
		heightTo: 170,
		left: [0, 1, 2],
		right: [5],
		down: [4],
		posLeft: [[0, 1], [0, 2]],
		posRight: [[4]],
		posBottom: [[5]],
		stickLeft: 5,
		stickHeight: 4,
		background: "url(" + lw.vroot + "/images/gallery/bg3.jpg)",
		gsBackground: "url(" + lw.vroot + "/images/gallery/gs/bg3.jpg)",
		backgroundPosition: "-1px -1px",
		activeBackgroundPosition: "-1px -1px",
		shrinkBG: "-1px -1px",
		t: {
			top: 80,
			left: 140,
			text: "When I first got here I noticed that SABIS<sup>&reg;</sup> University not only wants to provide a good education, but also to ensure that the students know how to think critically...",
			c: "h", f: "b"
		}
	}, {
		index: 4,
		width: 192,
		height: 120,
		widthTo: 350,
		heightTo: 180,
		left: [0, 1, 2, 3],
		down: [4],
		posLeft: [[0, 1, 3], [0, 2]],
		posBottom: [[5]],
		stickHeight: 3,
		background: "url(" + lw.vroot + "/images/gallery/bg4.jpg)",
		gsBackground: "url(" + lw.vroot + "/images/gallery/gs/bg4.jpg)",
		backgroundPosition: "-115px -1px",
		activeBackgroundPosition: "-1px -1px",
		t: {
			top: 84,
			left: 10,
			text: "SABIS<sup>&reg;</sup> University helps you think positively about life and your career...",
			c: "h", f: "b"
		}
	}, {
		index: 5,
		width: 610,
		height: 99,
		widthTo: 620,
		heightTo: 180,
		left: [0, 1, 2],
		posRight: [],
		top: [3, 5],
		posLeft: [[0, 1], [0, 2]],
		posTop: [[3], [4]],
		stickLeft: 3,
		background: "url(" + lw.vroot + "/images/gallery/bg5.jpg)",
		gsBackground: "url(" + lw.vroot + "/images/gallery/gs/bg5.jpg)",
		backgroundPosition: "center center",
		t: {
			top: 75,
			left: 0,
			text: "SABIS<sup>&reg;</sup> University is really different from other universities here in Iraq...",
			c: "h", f: "l"
		}
	}];


	lw.galleryWait = 500;
	lw.galleryTimeout = null;
	lw.lastGalleryItem = null;
	lw.openGalleryItem = null;
	lw.animDuration = 400;
	lw.galleryMouseOver = function () {
		clearInterval(lw.slideShowInterval);
		clearTimeout(lw.galleryTimeout);
		lw.lastGalleryItem = this._index;
		lw.galleryTimeout = setTimeout(lw.galleryExpand, lw.galleryWait);
	};
	lw.galleryMouseout = function () {
		clearTimeout(lw.galleryTimeout);
		lw.galleryTimeout = setTimeout(lw.galleryReset, lw.galleryWait * 2);

		lw.startSlideshowInterval();
	};

	lw.galleryReset = function () {
		return;
		for (var i = 0; i < gallery.length; i++) {
			var d = gallery[i];
			var animateTo = {
				width: d.width,
				height: d.height,
				"margin-top": d.marginTop,
				"margin-left": d.marginLeft,
				backgroundPosition: d.backgroundPosition
			};
			if (!d.activeBackgroundPosition)
				delete animateTo.backgroundPosition;

			gallery[i].div.stop().animate(animateTo, { duration: lw.animDuration });

			delete animateTo["margin-top"];
			delete animateTo["margin-left"];
			delete animateTo["marginLeft"];
			delete animateTo["marginTop"];
			animateTo["opacity"] = 0;

			gallery[i].gs.stop().animate(animateTo, { duration: lw.animDuration });

			if (gallery[i].t.div) {
				var a = {};
				var __d = gallery[i].t.div;

				switch (gallery[i].t.f) {
					case "t":
						$.extend(a, { "height": 0 });
						break;
					case "r":
						$.extend(a, { "margin-left": gallery[i].animateTo.width, width: 0 });
						break;
					case "b":
						$.extend(a, { "margin-top": gallery[i].animateTo.height, height: 0 });
						break;
					default:
						$.extend(a, { "width": 0 });
						break;

				}
				__d.stop().animate(a, { easing: "easeInCubic", duration: lw.animDuration / 2, complete: function () {
					$(this).css("display", "none");
				}
				});
			}
		}

		lw.galleryOverlay.stop().animate(
			{ opacity: 0 },
			{ duration: lw.animDuration, complete: function () {
				lw.galleryOverlay.css("z-index", 500);
			}
			}
		);
	};

	lw.fixBackground = function (g) {
		//if (g.index == 1)
		//debugger;
		if (g.activeBackgroundPosition) {
			if (g.animateTo.width >= g.widthTo - 50) {
				g.animateTo["background-position"] = g.activeBackgroundPosition;
			}
			if (g.shrinkBG) {
				if (g.animateTo.width <= g.width) {
					g.animateTo["background-position"] = g.shrinkBG;
				}
			}
		}
	};

	lw.galleryExpand = function () {
		//if (lw.openGalleryItem)
		//lw.gallery[lw.openGalleryItem].div.css("z-index", 1000);

		if (lw.lastGalleryItem == lw.openGalleryItem)
			return;

		var d = lw.gallery[lw.lastGalleryItem];
		var div = $(d.div);
		lw.openGalleryItem = lw.lastGalleryItem;
		//div.css("z-index", 10000);


		var movementLeft = d.widthTo - d.width;
		var movementTop = d.heightTo - d.height;

		var moveWidthPerItem = parseInt(movementLeft / (
				(d.posLeft && d.posLeft.length > 0 ? d.posLeft[0].length : 0) +
				(d.posRight && d.posRight.length > 0 ? d.posRight[0].length : 0)
			));
		if (isNaN(moveWidthPerItem))
			moveWidthPerItem = movementLeft;

		var moveHeightPerItem = parseInt(movementTop / (
				(d.posTop && d.posTop.length > 0 ? d.posTop[0].length : 0) +
				(d.posBottom && d.posBottom.length > 0 ? d.posBottom[0].length : 0)
			));
		if (isNaN(moveHeightPerItem))
			moveHeightPerItem = movementTop;

		var marginLeftTo = 0;
		if (d.posLeft && d.posLeft.length > 0) {
			marginLeftTo = d.posLeft[0].length > 0 ? movementLeft : 0;
			if (d.posRight && d.posRight.length > 0)
				marginLeftTo = d.posRight[0].length > 0 ?
					marginLeftTo - moveWidthPerItem * d.posRight[0].length :
					marginLeftTo;
		}
		marginLeftTo = d.marginLeft - marginLeftTo;
		var animateTo = {
			"margin-left": marginLeftTo,
			"margin-top": (d.posTop && d.posTop.length > 0) ? d.marginTop - movementTop : d.marginTop,
			width: d.widthTo,
			height: d.heightTo
		};
		if (d.activeBackgroundPosition)
			animateTo["background-position"] = d.activeBackgroundPosition;

		for (var i = 0; i < gallery.length; i++) {
			gallery[i].animateTo = {};
		}

		d.animateTo = animateTo;

		if (d.posTop) {
			for (var j = 0; j < d.posTop.length; j++) {
				for (var k = 0; k < d.posTop[j].length; k++) {
					var _g = gallery[d.posTop[j][k]];
					_g.animateTo.height = _g.animateTo.height ? _g.animateTo.height - moveHeightPerItem : _g.height - moveHeightPerItem;
					if (k > 0)
						_g.animateTo["margin-top"] = _g.marginTop - moveHeightPerItem;
				}
			}
		}

		if (d.posBottom) {
			for (var j = 0; j < d.posBottom.length; j++) {
				for (var k = 0; k < d.posBottom[j].length; k++) {
					var _g = gallery[d.posBottom[j][k]];
					_g.animateTo.height = _g.animateTo.height ? _g.animateTo.height - moveHeightPerItem : _g.height - moveHeightPerItem;
					if (!_g.animateTo["margin-top"])
						_g.animateTo["margin-top"] = _g.marginTop + moveHeightPerItem * (d.posBottom[j].length - k);
				}
			}
		}
		if (d.posLeft) {
			for (var j = 0; j < d.posLeft.length; j++) {
				for (var k = 0; k < d.posLeft[j].length; k++) {
					var _g = gallery[d.posLeft[j][k]];
					_g.animateTo.width = (_g.animateTo.width && false) ? _g.animateTo.width - moveWidthPerItem : _g.width - moveWidthPerItem;
					_g.animateTo["margin-left"] = _g.marginLeft - moveWidthPerItem * k;
				}
			}
		}
		if (d.posRight) {
			for (var j = 0; j < d.posRight.length; j++) {
				for (var k = 0; k < d.posRight[j].length; k++) {
					var _g = gallery[d.posRight[j][k]];
					_g.animateTo.width = _g.animateTo.width ? _g.animateTo.width - moveWidthPerItem : _g.width - moveWidthPerItem;
					if (!_g.animateTo["margin-left"])
						_g.animateTo["margin-left"] = _g.marginLeft + moveWidthPerItem * (d.posRight[j].length - k);
				}
			}
		}

		for (var i = 0; i < gallery.length; i++) {
			var _d = gallery[i];
			if (_d.shrinkBG && _d.index != d.index) {
				_d.animateTo.backgroundPosition = _d.shrinkBG;
				_d.div.css("z-index", 1000);
			}
			if (_d.stickWidth) {
				if (_d.animateTo["width"]) {
					var item = gallery[_d.stickWidth];
					if (!(item.animateTo.stickWidthApplied || item.index == d.index)) {
						item.animateTo.stickWidthApplied = true;
						item.animateTo.width = _d.animateTo.width;
					}
				}
			}

			if (_d.stickLeft) {
				if (_d.animateTo["margin-left"]) {
					var _g = gallery[_d.stickLeft];
					if (!(_g.animateTo.stickLeftApplied || _d.animateTo.stickLeftApplied || _g.index == d.index)) {
						_g.animateTo.stickLeftApplied = true;
						_d.animateTo.stickLeftApplied = true;
						if (!_g.animateTo["width"]) {
							_g.animateTo["width"] = _g.width;
						}
						if (!_g.animateTo["margin-left"]) {
							_g.animateTo["margin-left"] = _g.marginLeft;
						}
						_g.animateTo["width"] = _g.animateTo["width"] +
							(_g.animateTo["margin-left"] - _d.animateTo["margin-left"]);
						_g.animateTo["margin-left"] = _d.animateTo["margin-left"];
					}
				}
			}
			if (_d.stickHeight) {
				if (_d.animateTo["height"]) {
					var item = gallery[_d.stickHeight];
					if (!(item.animateTo.stickHeightApplied || _d.animateTo.stickHeightApplied || item.index == d.index)) {
						item.animateTo.stickHeightApplied = true;
						_d.animateTo.stickHeightApplied = true;
						gallery[_d.stickHeight].animateTo["height"] = _d.animateTo["height"];
					}
				}
			}
			if (_d.stickTop) {
				if (_d.animateTo["margin-top"]) {
					var _g = gallery[_d.stickLeft];
					if (!(_g.animateTo.stickLeftApplied || _d.animateTo.stickLeftApplied || _g.index == d.index)) {
						_g.animateTo.stickLeftApplied = true;
						_d.animateTo.stickLeftApplied = true;
						if (!_g.animateTo["height"]) {
							_g.animateTo["height"] = _g.height;
						}
						if (!_g.animateTo["margin-top"]) {
							_g.animateTo["margin-top"] = _g.marginLeft;
						}
						_g.animateTo["height"] = _g.animateTo["height"] +
							(_g.animateTo["margin-top"] - _d.animateTo["margin-top"]);
						_g.animateTo["margin-top"] = _d.animateTo["margin-top"];
					}
				}
			}

			if (!_d.animateTo["width"])
				_d.animateTo["width"] = _d._css["width"];
			if (!_d.animateTo["margin-left"] && !_d.animateTo["marginLeft"])
				_d.animateTo["margin-left"] = _d._css["margin-left"];
			if (!_d.animateTo["height"])
				_d.animateTo["height"] = _d._css["height"];
			if (!_d.animateTo["margin-top"] && !_d.animateTo["marginTop"])
				_d.animateTo["margin-top"] = _d._css["margin-top"];
		}

		//debugger;

		for (var i = 0; i < gallery.length; i++) {

			lw.fixBackground(gallery[i]);

			if (gallery[i].index != d.index) {
				if (gallery[i].t.div) {
					var a = {};
					var __d = gallery[i].t.div;

					switch (gallery[i].t.f) {
						case "t":
							$.extend(a, { "height": 0 });
							break;
						case "r":
							$.extend(a, { "margin-left": gallery[i].animateTo.width, width: 0 });
							break;
						case "b":
							$.extend(a, { "margin-top": gallery[i].animateTo.height, height: 0 });
							break;
						default:
							$.extend(a, { "width": 0 });
							break;
					}
					__d.stop().animate(a, { easing: "easeInCubic", duration: lw.animDuration / 2, complete: function () {
						$(this).css("display", "none");
					}
					});
				}
			}
			else
				continue;
			gallery[i].div.stop().animate(gallery[i].animateTo, { duration: lw.animDuration });

			delete gallery[i].animateTo["margin-top"];
			delete gallery[i].animateTo["margin-left"];
			delete gallery[i].animateTo["marginLeft"];
			delete gallery[i].animateTo["marginTop"];
			gallery[i].animateTo["opacity"] = 1;

			gallery[i].gs.stop().animate(gallery[i].animateTo, { duration: lw.animDuration });
		}
		d.div.stop().animate(d.animateTo, { duration: lw.animDuration, complete: function () {
			d.t.div.css("display", "block");
			if (d.t.div) {
				var a = {};
				a.height = d.t.c == "h" ? 95 : 157;
				a.width = d.t.c == "h" ? 297 : 155;

				a["margin-left"] = d.t.left;
				a["margin-top"] = d.t.top;

				switch (d.t.f) {
					case "t":
						d.t.div.css("height", 0);
						break;
					case "r":
						d.t.div.css({ "margin-left": d.animateTo.width, width: 0 });
						break;
					case "b":
						d.t.div.css({ "margin-top": d.animateTo.height, height: 0 });
						break;
					default:
						d.t.div.css("width", 0);
						break;

				}

				d.t.div.stop().animate(a, { duration: lw.animDuration, easing: "easeInCubic" });
			}
		}
		});
		delete d.animateTo["margin-top"];
		delete d.animateTo["margin-left"];
		delete d.animateTo["marginLeft"];
		delete d.animateTo["marginTop"];

		d.animateTo["opacity"] = 0;

		d.gs.stop().animate(d.animateTo, { duration: lw.animDuration });

		//lw.galleryOverlay.css("z-index", 1500);
		lw.galleryOverlay.stop().animate(
			{ opacity: 0 },
			{ duration: lw.animDuration }
		);
	};

	lw.header = $(".header");
	for (var i = 0; i < gallery.length; i++) {
		var d = gallery[i];
		d.div = $("<div />");
		d.div.addClass("gallery-item");
		var marginTop = 0;
		if (d.posTop && d.posTop.length > 0) {
			for (var j = 0; j < d.posTop[0].length; j++) {
				marginTop += gallery[d.posTop[0][j]].height + 2;
			}
		}
		d.marginTop = marginTop;

		var marginLeft = 0;
		if (d.posLeft && d.posLeft.length > 0) {
			for (var j = 0; j < d.posLeft[0].length; j++) {
				marginLeft += gallery[d.posLeft[0][j]].width + 2;
			}
		}
		d.marginLeft = marginLeft;

		d._css = {
			width: d.width,
			height: d.height,
			"margin-top": d.marginTop,
			"margin-left": d.marginLeft,
			backgroundImage: d.background,
			backgroundPosition: d.backgroundPosition
		};
		d.div.css(d._css);
		d.div[0]._index = i;
		if (d.t) {
			d.t.div = $("<div />");
			d.t.div.addClass("testimonial-" + d.t.c);
			var p = $("<p />");
			p.html(d.t.text);
			d.t.div.append(p);

			var a = $("<a />");
			a.addClass("more");
			a.attr("href", lw.vroot + "/about-sabis-university/Testimonials.aspx");
			a.html("+ more");
			d.t.div.append(a);

			d.t.div.css({
				"margin-top": d.t.top,
				"margin-left": d.t.left,
				display: "none"
			});

			switch (d.t.f) {
				case "t":
					d.t.div.css({ "height": 0 });
					break;
				case "r":
					d.t.div.css({ width: 0 });
					break;
				case "b":
					d.t.div.css({ height: 0 });
					break;
				default:
					d.t.div.css({ "width": 0 });
					break;

			}

			d.div.append(d.t.div);
		}
		d.animateTo = {};

		var gs = $("<div />");
		gs.addClass("gs");
		gs.css({
			"background-image": d.gsBackground,
			"background-position": d.backgroundPosition,
			width: d.width,
			height: d.height,
			opacity: 0
		});
		d.gs = gs;
		d.div.append(gs);

		d.div.bind("mouseover", lw.galleryMouseOver);
		d.div.bind("mouseout", lw.galleryMouseout);
		lw.header.append(d.div);
	}
	lw.galleryOverlay = $("<div />");
	lw.galleryOverlay.addClass("overlay");
	lw.galleryOverlay.css("opacity", 0);
	lw.galleryOverlay.css("display", "none");
	lw.header.append(lw.galleryOverlay);

	lw.lastGalleryItem = -1;
	lw.intervalTimeout = 6000;
	lw.startSlideshowInterval = function () {
		lw.slideShowInterval = setInterval(function () {
			lw.lastGalleryItem++;
			if (lw.lastGalleryItem >= lw.gallery.length)
				lw.lastGalleryItem = 0;
			lw.galleryExpand();
		}, lw.intervalTimeout);
	}
	lw.startSlideshowInterval();
	lw.intervalTimeout = 5000;


	// Reset Font Size
	lw.area = lw.area = $('.resizable-area');
	lw.originalFontSize = lw.area.css('font-size');
	lw.originalLineHeight = parseFloat(lw.area.css("line-height"));
	$(".resetFont").click(function () {
		lw.area.css('font-size', lw.originalFontSize);
		if (!isNaN(lw.originalLineHeight))
			lw.area.css("line-height", lw.originalLineHeight + "px");
	});
	// Increase Font Size
	$(".increaseFont").click(function () {
		var currentFontSize = lw.area.css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize);
		var newFontSize = currentFontSizeNum * 1.2;
		lw.area.css('font-size', newFontSize);
		var currentLineHeight = parseFloat(lw.area.css("line-height"));
		if (!isNaN(currentLineHeight))
			lw.area.css("line-height", (currentLineHeight * 1.15) + "px");
		return false;
	});
	// Decrease Font Size
	$(".decreaseFont").click(function () {
		var currentFontSize = lw.area.css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum / 1.2;
		lw.area.css('font-size', newFontSize);
		var currentLineHeight = parseFloat(lw.area.css("line-height"));
		if (!isNaN(currentLineHeight))
			lw.area.css("line-height", (currentLineHeight / 1.15) + "px");
		return false;
	});

});
