function log (logMsg) {
	if(console)
		log(logMsg);
}
(function() {//console.log("111");
	window.UIDelegateOptional = 0;
	window.UIDelegateRequired = 1;
	function a() {//console.log("111222");
		this.init.apply(this, arguments)
	}
	a.prototype.init = function() {
		this.delegates = [];
		this.virtuals = [];
		this.cancelable = false
	};
	a.prototype.bubble = function(e, d) {
		d.unshift(e);
		for ( var c = 0, b = this.virtuals.length; c < b; c++) {
			this.virtuals[c].invoke.apply(this.virtuals[c], d)
		}
	};
	a.prototype.delegate = function(d) {
		var e = false;
		for ( var c = 0, b = this.delegates.length; c < b; ++c) {
			if (this.delegates[c] === d) {
				this.delegates.splice(c, 1);
				e = true;
				break
			}
		}
		if (!e) {
			if (this._implements(d)) {
				this.delegates[this.delegates.length] = d;
				this._delegateWasRegistered(d)
			}
		}
	};
	a.prototype.invoke = function(f) {
		if (!this._supports(f)) {
			return false
		}
		var e = Array.prototype.splice.call(arguments, 1, arguments.length);
		e.unshift(this);
		var d = false;
		for ( var c = 0, b = this.delegates.length; c < b; ++c) {
			if (this.delegates[c]) {
				if (typeof this.delegates[c][f] === "function") {
					d = this.delegates[c][f].apply(this.delegates[c], e)
				}
				if (this.cancelable && d) {
					break
				}
			}
		}
		if (this.virtuals.length > 0) {
			this.bubble(f, e)
		}
		return true
	};
	a.prototype.protocol = function(b) {
		this._protocol = b
	};
	a.prototype.virtual = function(e) {
		if (e instanceof a) {
			var d = false;
			for ( var c = 0, b = this.virtuals.length; c < b; c++) {
				if (this.virtuals[c] === e) {
					this.virtuals[c].splice(c, 1);
					d = true;
					break
				}
			}
			if (!d) {
				this.virtuals[this.virtuals.length] = e
			}
		}
	};
	a.prototype._delegateWasRegistered = function(b) {
	};
	a.prototype._implements = function(c) {
		var d = true;
		if (this._protocol !== undefined) {
			for ( var b in this._protocol) {
				if (this._protocol[b] === UIDelegateRequired) {
					if (typeof c[b] !== "function") {
						d = false;
						break
					}
				}
			}
		}
		return d
	};
	a.prototype._supports = function(c) {
		var b = true;
		if (this._protocol !== undefined) {
			b = typeof this._protocol[c] === "function"
		}
		return b
	};
	window.UIDelegate = a
})();
(function() {//console.log("222");
	var b = $("#home .article .companyLogo").attr("href");
	var a = {};
	a.trackOnPageLoad = function(c) {//alert("222333"+c);
		var c = c.split("|")[1];
		if (!c) {
			_gaq.push([ "_trackPageview" ])
		} else {
			//c = c.replace("baseajax.", "");
			c = c.replace("baseajax", "");
			if (c == window.location.pathname) {
				_gaq.push([ "_trackPageview", c ])
			}
		}
	};
	a.trackOnSegmentOpen = function(c) {//console.log("aaaaaaaaaaaa")
		//var c = c.replace("baseajax.", "");
		var c = c.replace("baseajax", "");
		_gaq.push([ "_trackPageview", c ])
	};
	a.trackOnSegmentClose = function() {
		//_gaq.push([ "_trackPageview", b ]);alert("bbbbbbbbbbbbb")
	};
	window.GATracking = a
})();
(function() {//console.log("333");
	a.prototype = new UIDelegate();
	a.prototype.constructor = a;
	a.superclass = UIDelegate.prototype;
	function a() {
		this.init.apply(this, arguments)
	}
	a.prototype.init = function() {
		if (a.superclass && a.superclass.init) {
			a.superclass.init.call(this)
		}
		this.cancelable = true;
		this.event_based = false;
		this.started = false;
		this.start();
		this.refresh()
	};
	a.prototype.check = function(c) {
		var b = this.decode(c);//console.log('history:',b);
		if (this.location_hash != b) {
			this.invoke("hashDidChange", b);
			this.refresh()
		}
		if (!this.started) {
			GATracking.trackOnPageLoad(b)
		}
	};
	a.prototype.decode = function(b) {
		return decodeURIComponent(decodeURIComponent(b))
	};
	a.prototype.encode = function(b) {
		return encodeURIComponent(b)
	};
	a.prototype.hash = function() {
		return this.decode(this.normalise(window.location.hash))
	};
	a.prototype.normalise = function(b) {
		return b.replace(/^\#/, "")
	};
	a.prototype.previous = function() {
		if (this._stack.length > 1) {
			var b = this._stack[this._stack.length - 2];
			$.history.load(b)
		} else {
			window.history.go(-1)
		}
	};
	a.prototype.push = function(b) { 
		this.location_hash = this.normalise(b);
		if (this._stack[this._stack.length - 1] != this.location_hash) {
			this._stack[this._stack.length] = this.location_hash
		}
		var c = this.encode(this.location_hash);
		$.history.load(c)
	};
	a.prototype.refresh = function() {
		this.location_hash = this.hash()
	};
	a.prototype.start = function() {
		if (this.started) {
			return false
		}
		this._stack = [];
		var b = this;
		$.history.init(function(c) {//console.log('history');
			b.check(c)
		}, {
			unescape : false
		});
		this.started = true
	};
	a.prototype.stop = function() {
		if (this.event_based) {
			window.onhashchange = null
		} else {
			clearInterval(this.interval)
		}
		this.started = false
	};
	a.prototype._delegateWasRegistered = function(b) {
		if (typeof b.hashDidChange === "function") {
			b.hashDidChange(this, this.hash())
		}
	};
	window.SAHistoryMonitor = new a
})();
(function() {//console.log("444");
	var j = /^[a-zA-Z]+\:(?=\/\/)/g;
	var k = /^[^\/]+/g;
	var c = /\:[0-9]+$/g;
	var d = /.*\//g;
	var f = /.*?\.([^\.]+)$/;
	var g = /\/+/g;
	var b = window.location.protocol;
	var a = window.location.hostname;
	var e = window.location.pathname.match(d)[0];
	var i = window.location.port;
	function h() {
		this.init.apply(this, arguments)
	}
	h.get = function(l) {
		var m = new h(l);
		return m.href
	};
	h.prototype.init = function(o) {
		if (!o) {
			o = window.location.href
		}
		this.protocol = b;
		var p = o.match(j);
		if (p) {
			this.protocol = p[0];
			o = o.replace(this.protocol + "//", "")
		}
		this.port = i;
		this.hostname = a;
		var n = o.match(k);
		if (p && n) {
			var l = n[0].match(c);
			if (l) {
				this.port = l[0].substr(1)
			}
			this.hostname = n[0].replace(":" + this.port, "");
			o = o.replace(n[0], "")
		}
		this.host = this.hostname;
		this.path = p && n ? "/" : e;
		var q = o.match(d);
		if (q) {
			this.path = q[0].indexOf("/") == 0 ? q[0] : this.path + "/" + q[0];
			o = o.replace(this.path, "")
		}
		this.hash = "";
		var m = o.split("#");
		if (m.length > 1) {
			this.hash = "#" + m[1];
			o = m[0]
		}
		this.search = "";
		var r = o.split("?");
		if (r.length > 1) {
			this.search = "?" + r[1];
			o = r[0]
		}
		this.file = o ? o : "";
		this.extension = this.file.replace(f, "$1");
		this.pathname = (this.path + "/" + this.file).replace(g, "/");
		this.href = [
				this.protocol + "//",
				(this.hostname + (this.port ? ":" + this.port : "") + "/" + this.pathname)
						.replace(g, "/"), this.search, this.hash ].join("")
	};
	h.prototype.isExtensionInArray = function(n) {
		n = n ? n : [];
		for ( var m = 0, l = n.length; m < l; m++) {
			if (n[m].toLowerCase() === this.extension.toLowerCase()) {
				return true
			}
		}
		return false
	};
	h.prototype.isInternal = function() {
		return this.hostname === a
	};
	h.prototype.param = function() {
		var l = {
			search : this._params(this.search.split("?")[1]),
			hash : this._params(this.hash.split("#")[1])
		};
		this.param = function(m) {
			return l.search[m] || l.hash[m]
		};
		return this.param(arguments[0])
	};
	h.prototype._params = function(o) {
		var n = {}, p;
		if (o) {
			o = o.split("&");
			for ( var m = 0, l = o.length; m < l; m++) {
				p = o[m].split("=");
				n[p[0]] = p[1]
			}
		}
		return n
	};
	window.SAResourceLocation = h
})();
(function() {//console.log("555");
	window.UIResourceType = {
		Image : 1,
		Static : 2,
		Dynamic : 3,
		Element : 4
	};
	a.prototype = new UIDelegate();
	a.prototype.constructor = a;
	a.superclass = UIDelegate.prototype;
	function a() {
		this.init.apply(this, arguments)
	}
	a.GLOBAL_CACHE = {};
	a.prototype.init = function(b) {
		if (a.superclass && a.superclass.init) {
			a.superclass.init.call(this)
		}
		this.options = b || {};
		if (this.options.cache === undefined) {
			this.options.cache = true
		}
		if (this.options.size === undefined) {
			this.options.size = 3
		}
	};
	a.prototype.cache = function(f, e, b, g) {
		f = SAResourceLocation.get(f);
		if (e === undefined) {
			var d = a.GLOBAL_CACHE[f];
			if (d !== undefined) {
				var c = d.request;
				if (this.isNodeType(d.type)) {
					d = d.response.clone()
				} else {
					d = d.response
				}
				a.GLOBAL_CACHE[f].timestamp = new Date().getTime();
				return [ d, c ]
			} else {
				return undefined
			}
		} else {
			b = b !== undefined ? b : UIResourceType.Static;
			if (!this.cacheable(b)) {
				return undefined
			}
			if (this.isNodeType(b)) {
				e = e.clone()
			}
			var d = {
				response : e,
				type : b,
				timestamp : new Date().getTime(),
				request : g
			};
			a.GLOBAL_CACHE[f] = d;
			this.clean()
		}
	};
	a.prototype.cacheable = function(b) {
		return this.options.cache && b !== UIResourceType.Dynamic
	};
	a.prototype.clean = function() {
		if (this.count() <= this.options.size) {
			return false
		}
		var b = [];
		for ( var c in a.GLOBAL_CACHE) {
			var d = a.GLOBAL_CACHE[c];
			b[b.length] = {
				name : c,
				time : d.timestamp
			}
		}
		b = b.sort(function(e, f) {
			return e.time < f.time ? -1 : 1
		});
		while (b.length > this.options.size) {
			delete a.GLOBAL_CACHE[b[0].name];
			b.shift()
		}
	};
	a.prototype.complete = function(d, c, f, b, e) {
		if (this.isNodeType(b)) {
			c = $(c)
		}
		this.cache(d, c, b, e);
		f(c, e)
	};
	a.prototype.count = function() {
		var c = 0;
		for ( var b in a.GLOBAL_CACHE) {
			c++
		}
		return c
	};
	a.prototype.get = function(c, f, b) {
		var d = this.cache(c);
		if (d !== undefined) {
			return f(d[0], d[1])
		} else {
			if (b === undefined) {
				b = UIResourceType.Static
			}
			if (b === UIResourceType.Image) {
				this.complete(c, '<img src="' + c + '" />', f, b)
			} else {
				var e = this;
				setTimeout(function() {
					var g = $.get(c, function(h) {
						e.complete(c, h, f, b, g)
					})
				}, 0)
			}
		}
	};
	a.prototype.isNodeType = function(b) {
		return b === UIResourceType.Element || b === UIResourceType.Image
	};
	window.UIResourceFactory = a
})();
(function() {//console.log("666");
	var c = [ "shtml", "html", "htm", "php" ];
	var a = "X-Section-Name";
	b.prototype = new UIDelegate();
	b.prototype.constructor = b;
	b.superclass = UIDelegate.prototype;
	function b() { //log("b",this, arguments);
		this.init.apply(this, arguments)
	}
	b.prototype.init = function(f, d, e) {
		if (b.superclass && b.superclass.init) {
			b.superclass.init.call(this)
		}
		this.controller = d;
		this.segment = $(f);
		//console.log(this.segment)
		this.defaults(e);
		if (this.options.container) {
			this.container = this.options.container
		} else {
			this.container = this.segment.find(".segment-content")
		}
		this.container_width = this.container.width();
		this.hub_page = this.segment.find(
				".content-container .segment-expander").attr("href");
				console.log(this.hub_page)
		this.hub_page = this.baseAjax(this.hub_page);
		//console.log("hub:",this.hub_page);
		this.background = $();
		//console.log(f.id)
		this.segment_name = f.id;
		this.capture();
		if (this.options.intro) {
			this.intro = this.options.intro
		} else {
			if (!this.selected) {
				this.intro = this.container.html()
			} else {
				this.last_content = this.container.html();
				this.last_content_url = this.baseAjax(window.location.pathname)
			}
		}
		if (this.isSelected()) {
			this.current_node = this.container.children()
		}
	};
	b.prototype.baseAjax = function(d) {
		//return d ? d.replace(/\.([^\.]+)$/, ".baseajax.$1") : d
		return d ? d.replace('page', "pagebaseajax") : d
	};
	b.prototype.click = function(d, e) {
		if (!this.bindings) {
			this.bindings = {}
		}
		this.bindings[d] = e
	};
	b.prototype.capture = function() {
		var d = this;
		this.segment.bind("click", function(e) {
			d._click(e)
		});
		if (this.segment[0] !== this.root[0]) {
			this.root.bind("click", function(e) {
				d._click(e)
			})
		}
	};
	b.prototype.defaults = function(d) {
		d = d ? d : {};
		if (this.options) {
			for ( var e in d) {
				if (this.options[e] === undefined) {
					this.options[e] = d[e]
				}
			}
		} else {
			this.options = d;
			this.cache = this.options.cache ? this.options.cache
					: new UIResourceFactory({
						cache : true
					})
		}
		this.root = this.options.virtual_root ? $(this.options.virtual_root)
				: this.segment;
		this.populated = false;
		if (this.isSelected()) {
			this.selected = true;
			if (this.intro) {
				this.populated = true
			}
		} else {
			this.selected = false
		}
	};
	b.prototype.deselect = function() {
		if (this.isSelected()) {
			var d = this;
			this.container.animate({
				height : "0px"
			}, function() {
				d.container.css({
					height : "0"
				});
				if (d.current_node) {
					d.current_node.remove()
				}
				d.preloader(false);
				d.invoke("segmentWasDeselected", d.segment, d.container);
				d.invoke("segmentDidFinishAnimating")
			});
			this.root.removeClass("segment-expanded");
			this.selected = false;
			this.background.fadeOut()
		}
	};
	b.prototype.focus = function(h, d) {
		d = (d === undefined ? true : d);
		if (d) {
			var f = this;
			var e = (this.segment_name == "home") ? 0
					: this.segment.offset().top;
			var g = Math.abs($(window).scrollTop() - e) / 2;
			g = g < 500 ? 500 : (g > 1000 ? 1000 : g);
			$("html, body").animate({
				scrollTop : e
			}, g, "easieEaseOutSine", function() {
				f.invoke("segmentWasFocused", f.segment, f.container);
				if (h !== undefined) {
					h.apply(this, arguments)
				}
			})
		} else {
			this.invoke("segmentWasFocused", this.segment, this.container);
			if (h !== undefined) {
				h()
			}
		}
	};
	b.prototype.getName = function() {
		return this.segment_name
	};
	b.prototype.getOffset = function() {
		return this.segment.offset()
	};
	b.prototype.insert = function(h, o) {
		try {
			this.preloader(false);
			var l = $(h);
			if (this.current_node && o && this.options.transition_internals) {
				this.slide(l)
			} else {
				var d = this.container.height() + "px";
				if (this.current_node) {
					this.current_node.remove()
				}
				try {
					this.container.append(l)
				} catch (e) {
				}
				this.current_node = l;
				var p = 0;
				for ( var g = 0, f = l.length; g < f; g++) {
					p += $(l[g]).outerHeight()
				}
				var n = $(window).height() + 100;
				if (p < n) {
					n = p
				}
				var m = this;
				this.invoke("segmentDidBeginAnimating");
				this.container.animate({
					height : n
				}, {
					duration : 500,
					easing : "easieEaseInQuint",
					step : function() {
						m.invoke("segmentWasAnimated")
					},
					complete : function() {
						m.container.css({
							height : "auto"
						});
						m.invoke("segmentDidFinishAnimating"); //alert("trtrt");
					}
				})
			}
		} catch (k) {
		}
		if (this.fade_in) {
			if (this.background.length) {
				var m = this;
				this.background.fadeIn(function() {
					m.root.addClass("segment-expanded")
				})
			} else {
				this.root.addClass("segment-expanded")
			}
			this.fade_in = false
		}
		if (o) {
			var m = this;
			this.focus(function() {
				m._loaded(h)
			});
			if (!this.selected && !this.intro) {
				this.intro = h
			} else {
				this.last_content = h
			}
		} else {
			this._loaded(h)
		}
	};
	b.prototype.isNamed = function(d) {
		return this.segment_name === d
	};
	b.prototype.isSelected = function() {
		return this.root.hasClass("segment-expanded")
	};
	b.prototype.load = function(g, d) {
		g = decodeURIComponent(g);
		d = d !== undefined ? d : true;
		this.invoke("didBeginFetchingContent", g);
		try {
			var f = this;
			this.cache.get(g, function(h, i) {
				if (i !== undefined) {
					if (i.getResponseHeader) {
						var j = i.getResponseHeader(a);
						if (j) {
							j = decodeURIComponent(j);
							if (!f.isNamed(j)
									&& f.controller.getSegmentWithName(j)) {
								return f.controller
										.loadSegmentPath(j + "|" + g)
							}
						}
					}
				}
				f.insert(h, true);
				if (d) {
					f.last_content_url = g
				}
			}, UIResourceType.Static)
		} catch (e) {
		}
		GATracking.trackOnSegmentOpen(g)
	};
	b.prototype.preloader = function() {
		if (this.options.preloader !== undefined && !this.options.preloader) {
			return false
		}
		var d = [
				'<div class="preloader-container">',
				'<div class="preloader-background"></div>',
				'<img class="preloader-animator" src="img/preloader.png" alt="Loading..." />',
				"</div>" ].join("");
		this._preloader = $(d);
		this.preloader = function(e) {
			if (e) {
				var g = $(window).height() + 100;
				this.p_run_time = new Date().getTime();
				this.focus();
				this.container.append(this._preloader);
				this._preloader.show();
				this.container.animate({
					height : g + "px"
				})
			} else {
				if (this.p_run_time) {
					if ((new Date().getTime() - this.p_run_time) < 1000) {
						this.p_run_time = undefined;
						return this._preloader.remove()
					}
				}
				var f = this;
				this._preloader.fadeOut(function() {
					f._preloader.remove()
				});
				this.p_run_time = undefined
			}
		};
		return this.preloader(arguments[0])
	};
	b.prototype.select = function(d) {
		if (!this.controller.shouldOpenSegment(this, d)) {
			return false
		}
		if (!this.isSelected()) {
			this.preloader(true);
			this.fade_in = true;
			if (d === undefined) {
				this.load(this.hub_page);//alert("333"+this.hub_page);
				this.populated = true
			}
		} else {
			this.focus()
		}
		this.pending_resource = d;
		if (d !== undefined) {//alert("444");
			this.load(d);
			this.populated = true
		}
		this.selected = true;
		this.invoke("segmentWasSelected", this.segment, this.container)
	};
	b.prototype.setOption = function(d, e) { //log('setOption');
		this.options[d] = e
	};
	b.prototype.setOptions = function(d) {
		this.defaults(d)
	};
	b.prototype.slide = function(e) {
		this.container.append(e);
		var d = this;
		this.container.animate({
			left : -this.current_node.width() + "px"
		}, 300, function() {
			d.current_node.remove();
			d.current_node = e;
			d.container.css({
				left : 0
			})
		})
	};
	b.prototype.toggle = function() {
		if (this.isSelected()) {
			GATracking.trackOnSegmentClose()
		}
		return this.isSelected() ? this.deselect() : this.select()
	};
	b.prototype._click = function(g) {
		var j = $(g.target).filter("a, input");
		if (!j.length) {
			j = $(g.target).parents("a")
		}
		var i = false;
		for ( var e in this.bindings) {
			if (j.filter(e).length > 0) {
				this.bindings[e].call(j, g, this);
				i = true
			}
		}
		if (!i) {
			var d = j.attr("href"), f = false;
			if (j.hasClass("segment-expander")) {
				f = true;
				this.toggle();
				
			} else {
				if (j.hasClass("companyLogo")) {
					f = true
				} else { 
					if (d && d !== "#" && !j.hasClass("noajax")) {
						var h = new SAResourceLocation(d);
						if (h.isInternal() && h.isExtensionInArray(c)) {
							f = true;
							if (this.options.forceload && !this.isSelected()) {
								this.select(this.baseAjax(d))
							} else {
								if (this.isSelected()) {
									this.load(this.baseAjax(d))
								}
							}
						}
					}
				}
			}
			if (f) {
				g.preventDefault();
				
			}
		}
		
		return false
	};
	b.prototype._loaded = function(d) { //alert('_loaded')
		this.invoke("contentWasLoaded", this.segment, this.container, d)
		
		//add prettyphoto to loaded content
		if ($("a[rel^='prettyPhoto']").length) {
			$("a[rel^='prettyPhoto']").prettyPhoto({
				allow_resize: true,
				default_width: 900
			});
		
		}
		
		
		//local scroll for portfolio
		$("#navigation a:first").addClass('active');
		if ($('.slider_section').length){
			$.localScroll.defaults.axis = 'xy';
			
			$.localScroll.hash({
				target: '#content', // Could be a selector or a jQuery object too.
				queue:true,
				duration:1500
			});
			
			$.localScroll({
				target: '#content', // could be a selector or a jQuery object too.
				queue:true,
				duration:1000,
				hash:true,
				filter:':not(.info)',
				onBefore:function( e, anchor, $target ){
					// The 'this' is the settings object, can be modified
					//console.log('1:',e, anchor, $target)
					//alert("anchor.id:"+anchor.id);
					//alert("anchor.id substring:"+anchor.id.substring(0,8));
					if ($('ul#navigation li a.active').length){
						$("ul#navigation li a").removeClass('active');
					}
					$("a[href$=#"+anchor.id.substring(0,8)+"]").addClass('active');
				},
				onAfter:function( anchor, settings ){
					// The 'this' contains the scrolled element (#content)
				}
			});
		}
		if ($('#contactform').length){
			$('#contactform input, #contactform textarea, #contactform input[type="checkbox"], #contactform input[type="radio"], #contactform input[type="file"]').uniform();
			$('select[multiple="multiple"]').multiselect({ header: false, noneSelectedText: "Select..", selectedList: 3 });
			$('select:not([multiple="multiple"])').multiselect({ multiple: false, header: false, selectedList: 3 });
			$('#contactform').validate();
			$('.datepicker').datepicker();
		}
	};
	window.UISegment = b
})();
(function() {//console.log("777");
	a.prototype = new UIDelegate();
	a.prototype.constructor = a;
	a.superclass = UIDelegate.prototype;
	function a() {
		this.init.apply(this, arguments)
	}
	a.prototype.init = function(b) {
		if (a.superclass && a.superclass.init) {
			a.superclass.init.call(this)
		}
		this.options = b ? b : {};
		segments = arguments[1];
		this.createSegments(segments);
		if (SAHistoryMonitor) {
			this.history_enabled = true;
			SAHistoryMonitor.delegate(this)
		}
	};
	a.prototype.addSegment = function(b) {
		this.segments[this.segments.length] = b;
		b.virtual(this);
		b.delegate(this);
		b.controller = this;
		b.setOptions(this._segmentOptions());
		this.spoof(b);
		this.hashDidChange(SAHistoryMonitor, SAHistoryMonitor.hash())
	};
	a.prototype.bindClick = function(b, e) {
		for ( var d = 0, c = this.segments.length; d < c; d++) {
			this.segments[d].click(b, e)
		}
	};
	a.prototype.createSegments = function(c) { //log('uisegment')
		var e = this._segmentOptions();
		c = c ? c : $(".uisegment").not("#footer");
		
		this.segments = [];
		//log("before for");
		for ( var d = 0, b = c.length; d < b; d++) {
			var f = new UISegment(c[d], this, e);
			////log('for', c[d])
			f.virtual(this);
			f.delegate(this);
			this.spoof(f);
			this.segments[this.segments.length] = f
		}
		return this.segments
	};
	a.prototype.closeSegments = function(c) {
		var b = this.getCurrentSegment();
		if (b && b.isSelected()) {
			this.deselection_callback = c;
			b.deselect()
		} else {
			if (c !== undefined) {
				c()
			}
		}
	};
	a.prototype.closeSegmentAtIndex = function(b) {
		var c = this.getSegmentAtIndex(b);
		if (c) {
			c.deselect()
		}
	};
	a.prototype.closeSegmentWithName = function(b) {
		var c = this.getSegmentWithName(b);
		if (c !== undefined && c.isSelected()) {
			c.deselect()
		}
	};
	a.prototype.didBeginFetchingContent = function(b, d) {
		if (this.history_enabled) {
			var c = b.getName() + "|" + d;
			this.current_page = c;
			SAHistoryMonitor.push(c)
		}
	};
	a.prototype.getCurrentSegment = function() {
		for ( var c = 0, b = this.segments.length; c < b; c++) {
			if (this.segments[c].isSelected()) {
				return this.segments[c]
			}
		}
	};
	a.prototype.getSegmentAtIndex = function(b) {
		//log('getSegmentAtIndex: ', this.segments[b]);
		return this.segments[b]
	};
	a.prototype.getSegmentWithName = function(c) {
		for ( var d = 0, b = this.segments.length; d < b; d++) {
			if (this.segments[d].isNamed(c)) {
				return this.segments[d]
			}
		}
		return false
	};
	a.prototype.hashDidChange = function(b, c) {
		if (this.spoofing || this.current_page === c) {
			return false
		}
		this.loadSegmentPath(c)
	};
	a.prototype.loadSegmentPath = function(e) {
		var d = e.split("|");
		//alert('1'+d[0]);
		
		//removing slider links in portfolio
		if (d[0].indexOf('section') > -1) { d[0] = 'gallery';}
		//alert('2'+d[0]);
		
		var c = this.getSegmentWithName(d[0]);
		if (c) {
			if (d.length < 2) {
				if (c.isSelected()) {
					c.deselect()
				}
				setTimeout(function() {
					c.focus(undefined, false)
				}, 0)
			} else {
				if (this.pending_fetch === e) {
					return false
				}
				this.pending_fetch = e;
				var b = this;
				setTimeout(function() {
					c.select(d[1]);
					b.pending_fetch = undefined
				}, 0)
			}
		}
	};
	a.prototype.openSegmentAtIndex = function(b) {
		var c = this.getSegmentAtIndex(b);
		if (c) {
			c.select()
		}
	};
	a.prototype.openSegmentWithName = function(b) {
		var c = this.getSegmentWithName(b);
		if (c !== undefined) {
			c.select()
		}
	};
	a.prototype.removeSegment = function(d) {
		var e = false;
		for ( var c = 0, b = this.segments.length; c < b; c++) {
			if (this.segments[c] === d) {
				this.segments[c].virtual(this);
				this.segments[c].delegate(this);
				if (this.segments[c].controller === this) {
					this.segments[c].controller = undefined
				}
				this.segments.splice(c, 1);
				e = true
			}
		}
		return e
	};
	a.prototype.shouldOpenSegment = function(c, d) {
		var b = true;
		if (this.options.accordion && this.current_segment) {
			if (this.current_segment !== c && this.current_segment.isSelected()) {
				b = false;
				this.pending_segment = c;
				this.pending_position = this.pending_segment.getOffset();
				this.pending_resource = d;
				this.pending_scroll = $("html, body").scrollTop();
				this.current_segment.deselect()
			}
		}
		return b
	};
	a.prototype.segmentWasAnimated = function(d) {
		if (this.pending_segment) {
			var c = this.pending_segment.getOffset();
			var b = this.pending_position.top - c.top;
			$("html, body").scrollTop(this.pending_scroll - b)
		}
	};
	a.prototype.segmentWasDeselected = function(c) {
		if (this.deselection_callback) {
			try {
				this.deselection_callback(this, c)
			} catch (b) {
			}
			this.deselection_callback = undefined
		}
		if (this.current_segment && this.current_segment === c) {
			this.current_segment = undefined;
			if (this.pending_segment !== undefined) {
				this.pending_segment.select(this.pending_resource);
				this.pending_segment = undefined;
				this.pending_position = undefined;
				this.pending_scroll = undefined;
				this.pending_resource = undefined
			} else {
				SAHistoryMonitor.push(c.getName())
			}
		}
	};
	a.prototype.segmentWasSelected = function(b) {
		this.current_segment = b
	};
	a.prototype.spoof = function(c) {
		if (c.isSelected()) {
			this.spoofing = true;
			var b = SAHistoryMonitor.hash();
			SAHistoryMonitor.push(c.getName() + "|"
					+ c.baseAjax(window.location.pathname));
			this.current_page = SAHistoryMonitor.hash();
			this.current_segment = c;
			if (b) {
				SAHistoryMonitor.push(b)
			}
			c.focus();
			this.spoofing = false
		}
	};
	a.prototype._segmentOptions = function() {
		var b = {};
		b.cache = new UIResourceFactory({
			cache : true
		});
		b.transition_internals = this.options.transition_internals;
		b.retain_state = this.options.retain_state;
		b.tracker = this.options.tracker;
		b.preloader = this.options.preloader;
		this._segmentOptions = function() {
			return b
		};
		return this._segmentOptions()
	};
	window.UISegmentController = a
})();
var LBI = window.LBI || {};
LBI.functions = {
	init : function() {;
		isRunningIE6OrBelow = window.isRunningIE6OrBelow || false;
		LBI.controller = new UISegmentController({
			accordion : true,
			preloader : true
		});
		LBI.controller.getSegmentWithName("home").setOption("forceload", true);
		var b = document.createElement("script");
		b.src = "http://s7.addthis.com/js/250/addthis_widget.js#domready=1";
		var d;
		var c = this;
		LBI.controller.delegate({
			contentWasLoaded : function(e, f) {
				$("#tabs").tabs();
				if (window.addthis) {
					window.addthis = null
				}
				if (d && d.parentNode) {
					d.parentNode.removeChild(d)
				}
				d = b.cloneNode(true);
				document.getElementsByTagName("head")[0].appendChild(d);
				if (f.isSelected()) {
					$(document.body).addClass("no_print")
				}
				LBI.functions.setWorldMapState()
			},
			segmentWasDeselected : function(e, f) {
				$(document.body).removeClass("no_print");
				LBI.functions.setWorldMapState()
			}
		});
		var a = [ ".multimedia-collection a", ".assetteaser a",
				".sectionpromote a", ".internalvideoteaser a",
				".multimedia-library .search-by a", "#contact_form .button" ].join(", ");
		LBI.controller.bindClick(a, function(e, g) {
			var f = $(this).attr("href");
			if (f) {
				f = f.replace(/\.(htm|html|shtml)/, ".baseajax.$1");
				g.load(f);
				e.preventDefault()
			}
		});
		this.history();
		this.setUpSearch();
		document.write = document.writeln = function(e) {
			$(document.body).append(e)
		}//alert('00')
	},
	carousel : function(a) {
		if (a === undefined) {
			var b = LBI.functions;
			LBI.controller.bindClick(".carousel-previous, .carousel-next",
					function(c) {
						c.preventDefault();
						var d = $(this);
						if (!d.data("carousel")) {
							b.carousel($(".carousel-previous, .carousel-next"))
						}
						var e = d.data("carousel");
						if (d.hasClass("carousel-previous")) {
							e.prev()
						} else {
							e.next()
						}
					})
		} else {
			if (a.data("carousel") === undefined) {
				$(".carousel").jcarousel({
					scroll : 2,
					initCallback : function(c) {
						a.data("carousel", c)
					},
					buttonNextHTML : null,
					buttonPrevHTML : null,
					wrap : "circular"
				})
			}
		}
	},
	history : function() { 
		LBI.controller.bindClick(".sahistory-previous", function(a) {
			a.preventDefault();
			SAHistoryMonitor.previous()
		})
	},
	setUpSearch : function() {
		LBI.controller.bindClick(".more-options", function(a) {
			a.preventDefault();
			var b = $(this).parents(".search-module");
			if (b.hasClass("advanced-search")) {
				b.removeClass("advanced-search")
			} else {
				b.addClass("advanced-search")
			}
		});
		LBI.controller.bindClick(".search-module input[type=checkbox]",
				function(a) {
					var b = $(this);
					if (b.attr("checked")) {
						b.parents("li").addClass("selected")
					} else {
						b.parents("li").removeClass("selected")
					}
				});
		$(".search-module form").live(
				"submit",
				function(b) {
					b.preventDefault();
					var c = LBI.controller.getCurrentSegment();
					if (c) {
						var a = new SAResourceLocation($(this).attr("action"));
						a = a.protocol + "//" + a.hostname
								+ (a.port ? ":" + a.port : "") + a.pathname;
						a = c.baseAjax(a);
						c.load(a + "?" + $(this).serialize())
					}
				})
	},
	setWorldMapState : function(a) {
		if (a || ($("#world-map").length > 0 && a === undefined)) {
			$(document.body).addClass("world-map").find(
					".segment-content-container:eq(0)").css("height", 0)
		} else {
			$(document.body).removeClass("world-map").find(
					".segment-content-container:eq(0)").css("height", "")
		}
	},
	getLang : function() {
		return window.SA_LOCALE
	},
	isRTL : function() {
		return (window.SA_DIRECTION || "").toLowerCase() === "rtl"
	}
};
$(document).ready(function() {
	LBI.common.dynamicInputText();
	LBI.common.getNewWindowLinks();
	LBI.common.getPrintLinks();
	//LBI.backgroundPostLoad.init();
	LBI.primaryNav.init();
	LBI.expandablePanel.init();
	//LBI.Timeline && LBI.Timeline.init();
	//LBI.WorldMap && LBI.WorldMap.init();
	//LBI.searchPanel.init();
	//$("#tabs").tabs()
	
	//go to top arrow
	$(window).scroll(function() {
		if($(this).scrollTop() != 0) {
			$('#toTop').fadeIn();	
		} else {
			$('#toTop').fadeOut();
		}
	});
 	$('#toTop').click(function() {
		$('body,html').animate({scrollTop:0},4000);
	});
	$('#contactform').live('submit', function(e) {
			e.preventDefault(); // <-- important
			//console.log("11111",$('#contactform').formSerialize())
			$(this).ajaxSubmit({
				url:"/contactajax",
				type: "POST",
				data: $('#contactform').formSerialize(),
				//target: '#contact_form',
				success:    function(html) { 
					$('#contact_form').append(html);
				} 
			});
		});
	
	
	//slider navigation 
	//if ($('.slider_section').length)
	/*$('#navigation a').click(function(){
		alert('click');
	});*/
	
});
$(window)
		.load(
				function() {
					if (isRunningIE6OrBelow) {
						DD_belatedPNG
								.fix("#home .companyLogo, .nav ul, .nav li, .nav ul li.active span, .nav ul li span .home, .section .section-inner, .segment-cross, .expandSegment, .nextSegment, #footer")
					}
				});
LBI.backgroundPostLoad = function() {//console.log("999");
	var a = this;
	this.init = function() {
		if (!isRunningIE6OrBelow) {
			a.segmentPos = [];
			a.segmentCompleted = [];
			a.segmentLength = 0;
			$(".alternative-background").each(function() {
				a.segmentPos.push($(this).offset().top);
				a.segmentLength++
			});
			$(window).bind("scroll.toLoad", this.scrollEvent);
			this.scrollEvent()
		}
	};
	this.scrollEvent = function() { 
		var d = $(window).scrollTop() + $(window).height();
		////log("scrool2",d);
		var c = -1;
		for ( var b = 0; b < a.segmentPos.length; b++) {
			if (d >= a.segmentPos[b]) {
				c = b
			}
		}
		if (c > -1) {
			this.loadImage(c)
		}
	};
	this.loadImage = function(b) {
		if ($.inArray(b, a.segmentCompleted) < 0) {
			$(".alternative-background:eq(" + b + ")").find(".section-inner")
					.find(".article").andSelf().each(function() {
						var c = $(this).attr("style");
						if (c.indexOf("important") < 0) {
							c = c.replace(";", "");
							c += "!important;";
							$(this).attr("style", c)
						}
					});
			a.segmentCompleted.push(b);
			if (a.segmentCompleted.length == a.segmentLength) {
				$(window).unbind("scroll.toLoad")
			}
		}
	};
	return this
}();
LBI.primaryNav = function() {
	var d = {};
	var j, a = [], c = 70, f = ($.browser.safari && LBI.functions.getLang() == "ar_sa");
	d.init = function() {
		this.navigation_menus = $(".nav");
		this.offset_parent = this.navigation_menus.offsetParent();
		this.sections = this.navigation_menus.parent(".section");
		this.navigation_menus.each(function(l) {
			$(this).find("li").each(function(m) {
				$(this).data("index", m)
			});
			$(this).parent().data("index", l)
		});
		this.sections.css("position", "static");
		if ($(document.body).hasClass("rtl")) {
			this.setBoundaryTop($(".companyLogo"), true)
		} else {
			this.setBoundaryTop($("#home"), false)
		}
		this.setBoundaryBottom($(".lastSection"), true);
		this.setFixedPosition(c);
		//var k = (isRunningIE6OrBelow || f) ? "absolute" : "fixed";
		var k = (isRunningIE6OrBelow || f) ? "static" : "static";
		this.navigation_menus.css("position", k);
		this.contentWasLoaded();
		//$(window).bind("scroll", this.scrollEvent);
		$(window).live("scroll", this.scrollEvent);
		//$("a", ".nav").bind("click", this.clickEvent); 
		$("a", ".nav").live("click", this.clickEvent); 
		$(".section").delegate(".nextSegment", "click", this.clickEvent);
		LBI.controller.delegate(this)
	};
	d.contentWasLoaded = function(k, l) {
		this.sections.each(function(m) {//console.log('11111');
			a[m] = $(this).offset().top
		});
		this.scrollEvent()
	};
	d.segmentDidFinishAnimating = d.contentWasLoaded;
	d.clickEvent = function(k) { //console.log('click')
		k.stopPropagation();
		k.preventDefault();
		//console.log('index: ',$(this).parents("div").html());
		var m = $(this).parent("li"), l = (typeof m.data("index") !== "undefined") ? m
					.data("index")
					: $(this).closest(".section").index() - 1;  /*$(this).closest(".section").data("index") + 1;*/
		if ($(this).parents("div").hasClass("menu_second")){
			
			//console.log("second menu", m.find('a').attr('href'), m.index() + 1); 
			l = m.index();
		}
		
		//console.log(m.html(), m.data("index"), $(this).closest(".section").data("index") + 1, $(this).html(), $(this).closest(".section"),$(this).closest(".section").index())
		//console.log('click2'+ LBI.controller.getSegmentAtIndex(l), l, this.hash)
		var n = {
			hash : this.hash,
			segment : LBI.controller.getSegmentAtIndex(l)
		};
		////log(this.hash, LBI.controller.getSegmentAtIndex(l))
		LBI.controller.closeSegments(function() {
			n.segment.focus(function() {
				SAHistoryMonitor.push(n.hash)
			})
		});
		if (LBI.controller.current_segment != undefined) {
			GATracking.trackOnSegmentClose()
		}
	};
	d.onHistoryRestore = function(k) {
		LBI.controller.closeSegments()
	};
	d.scrollEvent = function() { //console.log('2222');
		var m = c + $(window).scrollTop() + (d.navigation_menus.height() / 2)
				- 40;
		var k;
		if (m < a[0]) {
			k = 0
		} else {
			for ( var l = a.length - 1; l >= 0; l--) {
				if (m >= a[l]) {
					k = l;
					break
				}
			}
		}
		if (($(window).scrollTop() + $(window).height()) == $(document)
				.height()) {
			k = a.length - 1
		}
		j = $(d.navigation_menus[k]);
		//d.navigation_menus.not(j).css("visibility", "hidden");
		d.navigation_menus.not(j).css("visibility", "visible");
		j.css("visibility", "visible");
		d.positionWithinBoundaries()
		////log(d)
		//j = $(d.navigation_menus[k]);
		////log(j);
		//d.navigation_menus.not(j).css("visibility", "hidden");
		//d.navigation_menus.not(j).css("visibility", "visible");
		//j.css("visibility", "visible");
		//d.positionWithinBoundaries()
	};
	var g, e, b;
	var i, h;
	d.setBoundaryBottom = function(l, k) {
		//log('l:'+ l)
		g = $(l);
		h = k
	};
	d.setBoundaryTop = function(l, k) {
		e = $(l);
		i = k
	};
	d.setFixedPosition = function(k) {
		b = k
	};
	d.positionWithinBoundaries = function() { //log('positionWithinBoundaries');
		//var p = e.offset().top + (i ? e.height() : 0) + 30;
		//var o = g.offset().top + (h ? g.height() : 0) - 30;
		var p = e.offset().top + (i ? e.height() : 0);
		var o = g.offset().top + (h ? g.height() : 0);
		/*var p = 0;
		var o = 0;*/
		var l = b;
		var m = $(window).scrollTop();
		var n = false;
		var k = m + l;
		if (k < p) {
			l = p;
			if (!isRunningIE6OrBelow && !f) {
				l -= m
			}
			n = true
		}
		if (k + this.navigation_menus.height() > o) {
			l = o - this.navigation_menus.height();
			if (!isRunningIE6OrBelow && !f) {
				l -= m
			}
			n = true
		}
		if (this.navigation_menus.css("position") === "absolute") {
			l -= this.offset_parent.offset().top
		}
		if ((isRunningIE6OrBelow || f) && !n) {
			l += m
		}
		//this.navigation_menus.css("top", l + "px")
		this.navigation_menus.css("top", 0 + "px")
	};
	d.getTopOffset = function() {
		return c
	};
	return d
}();
LBI.expandablePanel = function() {
	var d = {}, a, c, b = 70, e = ($.browser.safari && LBI.functions.getLang() == "ar_sa");
	d.init = function() {
		d.initHeader();
		d.initFooter()
	};
	d.initHeader = function() {
		var f = $(".header").next(".segment-content-container");
		var h = {
			forceload : true,
			intro : "<div></div>",
			container : f,
			virtual_root : f,
			preloader : false
		};
		var j = new UISegment($("#searchpanel")[0], undefined, h);
		LBI.controller.addSegment(j);
		var i = $(".globalNav a");
		j.delegate({
			segmentDidBeginAnimating : function() {
				$(".nav").css({
					position : "absolute",
					top : "30px"
				})
			},
			segmentDidFinishAnimating : function() {
				var m = (isRunningIE6OrBelow || e) ? "absolute" : "fixed";
				$(".nav").css({
					position : m
				})
			},
			segmentWasDeselected : function() {
				i.removeClass("selected")
			},
			didBeginFetchingContent : function(m, n) {
				var o = SAResourceLocation.get(n);
				i.removeClass("selected");
				i
						.each(function() {
							if (this.href
									&& SAResourceLocation.get(j
											.baseAjax(this.href)) === o) {
								$(this).addClass("selected")
							}
						})
			}
		});
		var l = $("#search-field"), k = l.attr("name"), g = $("#global-search label");
		LBI.primaryNav.contentWasLoaded();
		if (l.val() === "") {
			g.removeClass("postit")
		}
		l.bind({
			focus : function() {
				g.addClass("postit")
			},
			blur : function() {
				if (this.value === "") {
					g.removeClass("postit")
				}
			}
		});
		$("#global-search").bind("submit", function(m) {
			var n = l.val();
			m.preventDefault();
			if (n !== "") {
				j.select(j.baseAjax(this.action) + "?" + k + "=" + n)
			}
		})
		
		
	};
	d.initFooter = function() {
		var f = {
			forceload : true,
			intro : "<div></div>",
			preloader : false
		};
		var g = new UISegment($("#footer")[0], undefined, f);
		LBI.controller.addSegment(g)
	};
	return d
}();
LBI.searchPanel = {
	init : function() {
		var a = this;
		LBI.controller.delegate({
			contentWasLoaded : function() {
				a.resize()
			}
		});
		this.resize()
	},
	resize : function() {
		$(".search-module").each(function() {
			var f = $(this);
			var a = f.find(".search-box-container");
			var e = f.find(".more-options");
			var d = f.find(".search-go");
			var c = f.find(".search-box");
			var g = f.width();
			if (e.length > 0) {
				g -= (e.outerWidth() + 40)
			}
			if (d.length > 0) {
				g -= (d.outerWidth())
			}
			var b = c.outerWidth() - c.width();
			g -= b;
			c.width(g)
		})
	}
};
var LBI = window.LBI || {};
LBI.WorldMap = function() {
	var a = {
		detailsCss : {
			width : 309,
			height : 440,
			xOffset : 70,
			shadow : "{w}px 1px 6px 3px rgba(0, 0, 0, 0.08)"
		},
		moreFacilitiesText : {
			en : "More facilities",
			ar_sa : "المزيد من المرافق"
		},
		folders : {
			contentImages : "/etc/designs/aramco/assets/img/f___p_images/worldmap/",
			images : "/etc/designs/aramco/assets/img/world_map/",
			content : "/apps/aramco/components/content/worldmap/"
		},
		containerCss : {
			width : 739,
			height : 548
		},
		dotRadius : 6.5,
		font : (LBI.functions.getLang() == "ar_sa") ? "tahoma, sans-serif"
				: $.browser.msie ? "Arial, sans-serif"
						: $(".wf_active").length ? "ff-dax-web-1, ff-dax-web-2,sans-serif"
								: "dax-reg ,sans-serif",
		defaultLabelCoords : {
			region : {
				x : 16,
				y : -1
			},
			line : {
				x : 13,
				y : 0,
				colour : "#dadada"
			}
		},
		caption : {
			path : [ [ 0, 0 ], [ 0, -49 ], [ "width", -49 ], [ "width", -17 ],
					[ 7, -17 ] ],
			paddingTop : 16,
			paddingSide : 10,
			boxHeight : 49
		},
		detailsHeadingLevel : 1
	};
	function b() {
		if ($("#world-map").length) {
			this.fetchData()
		} else {
			if ($(".worldmap-listing").length) {
				this.fetchData()
			}
			return
		}
		LBI.functions.setWorldMapState(true);
		var c = new SAResourceLocation(SAHistoryMonitor.hash())
				.param("mapType");
		if (c === undefined) {
			c = new SAResourceLocation().param("mapType")
		}
		this.config.RTL = LBI.functions.isRTL();
		this.config.initialMap = c || "global";
		$("#world-map")
				.tabs(
						{
							selected : $(
									"[href$=#" + this.config.initialMap
											+ "Map]", "#world-map").parent()
									.prevAll().length,
							select : function(f, g) {
								var d = g.panel.id.replace("Map", ""), e = decodeURIComponent(
										decodeURIComponent(window.location.hash))
										.split("|")[1];
								e = e.split("#")[0] + "#" + d;
								LBI.WorldMap.showMap(d);
								GATracking.trackOnSegmentOpen(e)
							}
						});
		$(".sahistory-previous", "#world-map").click(function() {
			$("#world-map").fadeOut();
			LBI.functions.setWorldMapState(false);
			if ($.browser.msie) {
				LBI.WorldMap.maps = null
			}
		});
		this.setDetailsCoords();
		this.constructPrototypes();
		this.maps = {};
		$.when(LBI.mapData).then(function(d) {
			LBI.WorldMap.rawMapsData = $.extend(true, {}, d);
			LBI.WorldMap.showMap(LBI.WorldMap.config.initialMap);
			$("html,body").animate({
				scrollTop : $("#world-map").offset().top - 150
			}, 500)
		})
	}
	return {
		init : b,
		stopEvent : function(c) {
			if (c.stopPropagation) {
				c.stopPropagation()
			} else {
				c.cancelBubble = true
			}
		},
		showMap : function(c) {
			if (this.maps[c]) {
				this.maps[c].attachToDOM()
			} else {
				this.maps[c] = new LBI.WorldMap.Map(this.rawMapsData[c])
			}
			this.Filter.switchToMap(this.maps[c])
		},
		setDetailsCoords : function() {
			var d = this.config;
			d.detailsCss.top = (d.containerCss.height - d.detailsCss.height) / 2;
			d.detailsCss.bottom = d.detailsCss.top + d.detailsCss.height
		},
		pathFromArray : function(c) {
			var f = "M" + c[0][0] + " " + c[0][1];
			for ( var e = 1, d = c.length; e < d; e++) {
				f += "L" + c[e][0] + " " + c[e][1]
			}
			return f
		},
		closedPathFromArray : function(c) {
			c.push(c[0]);
			return this.pathFromArray(c)
		},
		fetchData : function() {
			LBI.mapData = LBI.mapData
					|| $.ajax({
						url : LBI.WorldMap.config.folders.content
								+ LBI.functions.getLang()
								+ "/wm_002_maps_json.txt",
						dataType : "json",
						dataFilter : LBI.WorldMap.cleanUpJson
					})
		},
		cleanUpJson : function(k) {
			var g, c, f, i = function() {
				f += 1;
				c = k.charAt(f)
			}, d = function() {
				do {
					i()
				} while (c && (c <= " "))
			}, e = function() {
				g += c
			}, j = function() {
				while (true) {
					i();
					e();
					if (!c || (c === '"')) {
						return
					}
					if (c === "\\") {
						i();
						e()
					}
				}
			}, h = function() {
				g = "";
				f = -1
			};
			h();
			d();
			while (c) {
				e();
				if (c === '"') {
					j()
				}
				d()
			}
			return g
		},
		config : a
	}
}();
LBI.WorldMap.constructPrototypes = function() {
	var a = LBI.WorldMap;
	a.Map = function(b) {
		this.$container = $("#" + b.region + "Map");
		this.$container.css(a.config.containerCss);
		this.canvas = Raphael(b.region + "Map", a.config.containerCss.width,
				a.config.containerCss.height);
		this.params = b;
		this.init()
	};
	a.Map.prototype = {
		init : function() {
			var b = this, c = this.params.markers;
			this.markerType = this.params.markerType || "Simple";
			this.markers = [];
			if ($.browser.msie && parseInt($.browser.version, 10) < 8) {
				while (c.length) {
					this.markers.push(new a.Marker[this.markerType](c.shift(),
							this))
				}
			} else {
				var d = setInterval(function() {
					if (c.length) {
						b.markers
								.push(new a.Marker[b.markerType](c.shift(), b))
					} else {
						clearInterval(d)
					}
				}, 1)
			}
			this.preloadImages();
			this.detailsPanel = new a.DetailsPanel(this);
			this.$container.delegate("circle, oval", "grabDetailsPanel",
					function(e) {
						b.detailsPanel.attach($(this).data("marker"))
					}).delegate("circle, oval", "loseDetailsPanel",
					function(e) {
						b.detailsPanel.detach()
					})
		},
		preloadImages : function() {
			var b = this.params.categories;
			for (key in b) {
				if (b.hasOwnProperty(key)) {
					b[key].mapImg && c(b[key].mapImg);
					b[key].noDot && c(b[key].noDot)
				}
			}
			function c(d) {
				var e = document.createElement("img");
				e.src = a.config.folders.images + d
			}
		},
		attachToDOM : function() {
			if (!$.contains(document.getElementsByTagName("body")[0],
					this.$container[0])) {
				$("#" + this.params.region + "Map")
						.replaceWith(this.$container)
			}
			return this
		}
	};
	a.DetailsPanel = function(b) {
		this.map = b;
		this.init()
	};
	a.DetailsPanel.prototype = {
		init : function() {
			var b = this.map.canvas;
			this.topHeading = a.config.detailsHeadingLevel;
			this.wedge = b.wedge = b.path("M0 0").attr({
				fill : "#737782",
				opacity : "0.72",
				"stroke-width" : 0,
				stroke : "none"
			}).click(function(c) {
				c.cancelBubble = true;
				return false
			});
			this.fancyDot = b.set(b.circle(-50000, -50000, 14).attr({
				"stroke-width" : 1,
				fill : "#ffffff",
				cursor : "pointer"
			}), b.circle(-50000, -50000, 4).attr({
				"stroke-width" : 6,
				fill : "#ffffff",
				cursor : "pointer"
			}));
			this.$container = $(
					'<div class="details-panel"><h'
							+ this.topHeading
							+ "></h"
							+ this.topHeading
							+ '><div class="accordion-wrapper" ><ul class="content"></ul></div><a class="close" title="close" href="#"></a></div>')
					.css({
						position : "absolute",
						display : "none",
						"z-index" : 100,
						height : a.config.detailsCss.height,
						width : a.config.detailsCss.width,
						top : a.config.detailsCss.top
					}).appendTo(this.map.$container);
			this.$heading = $("h" + this.topHeading, this.$container[0]);
			this.$content = $(".content", this.$container[0]);
			this.$wrapper = $(".accordion-wrapper", this.$container[0]);
			this.fancyDot.click(this.detach, this);
			$(".close", this.$container[0]).click($.proxy(this, "detach"));
			$.fn.switcheroo = function(e) {
				function d(g, i) {
					var f = i.filter("h2").outerHeight(), j = i.filter("div"), h = g
							- (f + parseInt(j.css("padding-top"), 10) + parseInt(
									j.css("padding-bottom"), 10));
					j.height(h);
					return h
				}
				function c(j) {
					var k = 0;
					for ( var g = 0, f = j.length; g < f; g++) {
						k += j.eq(g).outerHeight()
					}
					return k
				}
				return this.each(function() {
					function f(k) {
						var m = k.addClass("live").siblings().removeClass(
								"live").css("height", "");
						if (h.hasClass("contracted")) {
							m = h.parent().find(".expand")
						}
						var l = i - c(m);
						contentHeight = d(l, k.children());
						h.css({
							"padding-top" : l
						}).trigger("showNewLi");
						if (g.length == 1) {
							k.children("div").height(contentHeight - 5)
						} else {
							k.children("div").height(contentHeight)
						}
					}
					function j() {
						var k = h.clone().addClass("dropdown");
						expander = $('<p class="expand"><a href="#">'
								+ a.config.moreFacilitiesText[LBI.functions
										.getLang()] + "</a></p>");
						h.addClass("contracted").after(k, expander);
						k.css({
							position : "absolute",
							left : 0,
							bottom : expander.outerHeight()
						}).delegate("h2", "click", function() {
							f(g.eq($(this).closest("li").prevAll().length));
							k.hide();
							return false
						});
						expander.add(k).hover(function() {
							k.stop(true).slideDown()
						}, function() {
							k.stop(true).slideUp(k.height() * 1.5, function() {
								k.css("height", "")
							})
						})
					}
					var h = $(this);
					if (e && e == "destroy") {
						h.undelegate(":not(.live) h2", "click").css({
							padding : 0,
							position : "static"
						});
						h.filter(".contracted").removeClass("contracted")
								.siblings().remove();
						return
					}
					var i = h.parent().height(), g = h.children();
					if (g.length > 3) {
						j()
					}
					f(g.eq(0));
					$("h2", h[0]).append('<span class="icon"></span>');
					h.css({
						position : "relative"
					}).delegate("li:not('.live,.expand') h2", "click",
							function() {
								f($(this).closest("li"))
							})
				})
			}
		},
		getDetails : function() {
			var c = {}, b = a.config.folders.content + LBI.functions.getLang()
					+ "/";
			return function(d) {
				return c[d] || (c[d] = $.ajax({
					url : b + d + ".txt",
					type : "GET",
					dataFilter : a.cleanUpJson,
					dataType : "json"
				}))
			}
		}(),
		attach : function(b) {
			this.marker && (this.marker.isDisplayingDetails = false);
			this.marker = b;
			this.marker.isDisplayingDetails = true;
			this.depopulatePanel();
			this.$heading.html(this.marker.params.label).css("color",
					this.marker.colour);
			var c = $.Deferred();
			$.when(this.getDetails(this.marker.params.ref), c).then(
					$.proxy(this, "populatePanel"));
			this.marker.unHover();
			this.setLR();
			this.wedge.attr(
					{
						path : a.closedPathFromArray([
								[ this.marker.params.x, this.marker.params.y ],
								[
										this.marker.params.x + this.LR
												* a.config.detailsCss.xOffset,
										a.config.detailsCss.top ],
								[
										this.marker.params.x + this.LR
												* a.config.detailsCss.xOffset,
										a.config.detailsCss.bottom ] ])
					}).toFront();
			this.fancyDot.attr({
				stroke : this.marker.colour,
				cx : this.marker.params.x,
				cy : this.marker.params.y
			}).toFront();
			this.$container.css({
				left : (this.marker.params.x + this.LR
						* a.config.detailsCss.xOffset)
						+ ((this.LR == 1) ? 0 : -a.config.detailsCss.width),
				display : "block",
				"box-shadow" : a.config.detailsCss.shadow.replace("{w}",
						this.LR)
			});
			c.resolve()
		},
		detach : function(b) {
			if (this.marker) {
				b && b.preventDefault();
				this.$container.css("display", "none");
				this.wedge.translate(-50000, 0);
				this.fancyDot.attr({
					cx : -50000,
					cy : -50000
				});
				this.marker.isDisplayingDetails = false;
				this.marker = null;
				this.depopulatePanel()
			}
			b && a.stopEvent(b);
			return false
		},
		populatePanel : function() {
			var b = {};
			return function(c) {
				var g = b[this.marker.params.ref];
				if (!g) {
					var k = c[0], h = "", n, f, l, d, e, m = "";
					for (f = 0, l = k.length; f < l; f++) {
						n = k[f];
						h += '<li class="'
								+ m
								+ '"><h'
								+ (this.topHeading + 1)
								+ ">"
								+ n.heading
								+ (n.subHeading ? ("<small>" + n.subHeading + "</small>")
										: "")
								+ "</h"
								+ (this.topHeading + 1)
								+ "><div>"
								+ (n.img ? ('<img src="'
										+ a.config.folders.contentImages
										+ n.img + '" />') : "");
						for (d = 0, e = n.content.length; d < e; d++) {
							h += "<p>" + n.content[d] + "</p>"
						}
						h += "</div></li>"
					}
					g = b[this.marker.params.ref] = h
				}
				this.$wrapper.css("height", a.config.detailsCss.height
						- this.$heading.outerHeight());
				this.$content.html(g).switcheroo()
			}
		}(),
		depopulatePanel : function() {
			this.$heading.html("");
			this.$content.html("").switcheroo("destroy")
		},
		setLR : function() {
			this.LR = (this.marker.params.x < a.config.containerCss.width / 2) ? 1
					: -1
		}
	};
	a.Marker = {
		Fancy : function() {
			this.noteParams.apply(this, arguments);
			this.init()
		},
		Simple : function() {
			this.noteParams.apply(this, arguments);
			this.init()
		},
		Proto : {
			noteParams : function(c, b) {
				this.params = c;
				this.map = b;
				this.canvas = b.canvas
			},
			init : function() {
				this.draw();
				this.clickable.click(this.toggleDetails, this).hover(
						this.hover, this.leave, this, this)
			},
			initSVG : function() {
				this.clickable = this.canvas.set();
				this.setDisplayColour();
				this.colouredEls = {};
				this.allEls = this.canvas.set()
			},
			setColoured : function(b, c) {
				this.colouredEls[b] || (this.colouredEls[b] = {});
				this.colouredEls[b][c] = true
			},
			unsetColoured : function(b, c) {
				delete this.colouredEls[b][c]
			},
			setDisplayColour : function(b) {
				b = b
						|| ((this.params.cats.length == 1) ? this.params.cats[0]
								: "multi");
				this.colour = this.map.params.categories[b].colour
			},
			recolourElements : function() {
				var b, c;
				for (b in this.colouredEls) {
					for (c in this.colouredEls[b]) {
						this.colouredEls[b][c] = this.colour
					}
					this[b].attr(this.colouredEls[b])
				}
			},
			drawDot : function() {
				this.dot = this.canvas.circle(this.params.x, this.params.y, 1)
						.attr({
							fill : this.colour,
							"stroke-width" : 0,
							cursor : "pointer",
							stroke : "none"
						}).animate({
							r : a.config.dotRadius
						}, 50);
				this.setColoured("dot", "fill");
				this.dot.mouseovered = false;
				this.clickable.push(this.dot);
				this.allEls.push(this.dot);
				this.dot.className = "marker";
				this.$dot = $(this.dot.node).data("marker", this)
			},
			toggleDetails : function(b) {
				this.isDisplayingDetails ? this.hideDetails() : this
						.showDetails();
				a.stopEvent(b)
			},
			showDetails : function() {
				this.$dot.trigger("grabDetailsPanel")
			},
			hideDetails : function() {
				this.$dot.trigger("loseDetailsPanel")
			},
			hasCategory : function(b) {
				return ($ && $.inArray(b, this.params.cats) > -1)
			},
			showAsCategory : function(b) {
				this.setDisplayColour(b);
				this.recolourElements();
				this.show()
			},
			hide : function() {
				this.allEls.hide()
			},
			show : function() {
				this.allEls.show()
			}
		}
	};
	a.Marker.Fancy.prototype = $
			.extend(
					{},
					a.Marker.Proto,
					{
						draw : function() {
							this.initSVG();
							this.drawDot()
						},
						hover : function() {
							for ( var c = 0, b = this.map.markers.length; c < b; c++) {
								this.map.markers[c].unHover()
							}
							this.caption ? this.showCaption() : this
									.addCaption()
						},
						leave : function() {
							this.hideCaption()
						},
						addCaption : function() {
							this.captionText = this.canvas.text(0, 0,
									this.params.label).attr({
								"font-family" : a.config.font,
								"font-size" : 14,
								"font-weight" : "bold",
								opacity : 0,
								"text-anchor" : "start"
							});
							this.calculateCaptionCoords();
							this.drawCaption()
						},
						calculateCaptionCoords : function() {
							var f = $.extend(true, [], a.config.caption.path), b = this.captionText
									.getBBox().width
									+ 2 * a.config.caption.paddingSide, e = 0, d = f.length, c = [
									f[1][0] + a.config.caption.paddingSide,
									f[1][1] + a.config.caption.paddingTop ];
							f[2][0] = f[3][0] = b;
							if (((a.config.containerCss.width - this.params.x) < a.config.containerCss.width / 6)
									|| (this.params.x + b > a.config.containerCss.width - 20)) {
								for (e = 0; e < d; e++) {
									f[e][0] = -f[e][0]
								}
								c[0] = f[2][0] + a.config.caption.paddingSide
							}
							if (this.params.y - 20 < -f[1][1]) {
								for (e = 0; e < d; e++) {
									f[e][1] = -f[e][1]
								}
								c[1] = f[3][1] + a.config.caption.paddingTop
							}
							for (e = 0; e < d; e++) {
								f[e][0] += this.params.x;
								f[e][1] += this.params.y
							}
							c[0] += this.params.x + ($.browser.msie ? 1 : 0);
							c[1] += this.params.y + ($.browser.msie ? 3 : 0);
							this.textPos = c;
							this.captionPath = a.closedPathFromArray(f)
						},
						drawCaption : function() {
							this.caption = this.canvas.set();
							this.captionBox = this.canvas
									.path(this.captionPath).attr({
										fill : this.colour,
										"stroke-width" : 0,
										cursor : "pointer",
										stroke : "none"
									}).insertBefore(this.clickable);
							this.setColoured("captionBox", "fill");
							this.captionText = this.canvas.text(
									this.textPos[0], this.textPos[1],
									this.params.label).attr({
								"font-family" : a.config.font,
								"font-size" : 14,
								"font-weight" : "bold",
								"text-anchor" : "start",
								fill : "#ffffff",
								cursor : "pointer"
							});
							this.caption
									.push(this.captionBox, this.captionText)
									.click(this.toggleDetails, this).hover(
											this.hover, this.leave, this, this)
									.toFront();
							this.allEls.push(this.captionBox, this.captionText);
							this.captionIsInPlace = true
						},
						showCaption : function() {
							this.dontHideCaption = true;
							this.caption.translate(
									this.captionIsInPlace ? 0 : 50000, 0)
									.animate({
										opacity : 1
									}, 100).show().toFront();
							this.captionIsInPlace = true
						},
						hideCaption : function() {
							var b = this;
							this.dontHideCaption = false;
							setTimeout(
									function() {
										if (!b.dontHideCaption) {
											b.caption
													.animate(
															{
																opacity : 0
															},
															200,
															function() {
																this
																		.translate(
																				b.captionIsInPlace ? -50000
																						: 0,
																				0)
																		.hide();
																b.captionIsInPlace = false
															})
										}
									}, 200)
						},
						unHover : function() {
							if (this.caption && this.captionIsInPlace) {
								this.caption.attr({
									opacity : 0
								}).translate(-50000, 0).hide();
								this.captionIsInPlace = false
							}
						}
					});
	a.Marker.Simple.prototype = $.extend({}, a.Marker.Proto, {
		hover : function() {
			this.line
					&& this.line.insertBefore(this.map.detailsPanel.wedge)
							.attr({
								stroke : this.colour
							});
			this.setColoured("line", "stroke");
			if (this.dot.mouseovered == false) {
				this.dot.mouseovered = true;
				this.dot.insertBefore(this.map.detailsPanel.wedge)
			}
			this.label.attr({
				fill : this.colour
			});
			this.setColoured("label", "fill")
		},
		leave : function() {
			this.dot.insertAfter(this.label);
			this.dot.mousedover = false;
			this.line && this.line.insertBefore(this.label).attr({
				stroke : this.params.labelLine.colour
			});
			this.unsetColoured("line", "stroke");
			this.label.attr({
				fill : "#323334"
			});
			this.unsetColoured("label", "fill")
		},
		unHover : function() {
			this.leave()
		},
		draw : function() {
			this.initSVG();
			this.convertToAbsoluteCoords();
			this.drawDot();
			this.drawLabel()
		},
		drawLabel : function() {
			var b;
			this.label = this.canvas.text(
					this.params.labelCoords.x + ($.browser.msie ? 1 : 0),
					this.params.labelCoords.y + ($.browser.msie ? 3 : 0),
					this.params.label).attr({
				"font-family" : a.config.font,
				"font-size" : 13,
				fill : "#323334",
				"text-anchor" : (this.reversed == 1) ? "start" : "end"
			});
			this.labelBox = this.canvas.rect().attr(this.label.getBBox()).attr(
					{
						fill : "#000",
						opacity : 0,
						cursor : "pointer"
					});
			this.clickable.push(this.labelBox);
			this.allEls.push(this.labelBox, this.label);
			if (b = this.params.labelLine) {
				this.line = this.canvas.path(
						a.pathFromArray([ [ this.params.x, this.params.y ],
								[ b.x, b.y ] ])).attr({
					stroke : b.colour
				}).insertBefore(this.dot);
				this.allEls.push(this.line)
			}
		},
		convertToAbsoluteCoords : function() {
			var c = this.params, b = this.reversed = c.reversed ? -1 : 1;
			c.labelCoords = c.labelCoords
					|| $.extend({}, a.config.defaultLabelCoords.region);
			c.labelCoords = {
				x : c.x + b * c.labelCoords.x,
				y : c.y + c.labelCoords.y
			};
			if (!c.noLine) {
				if (c.labelLine) {
					c.labelLine.colour = "#a3a3a3"
				} else {
					c.labelLine = $
							.extend({}, a.config.defaultLabelCoords.line)
				}
				c.labelLine.x = c.x + b * c.labelLine.x;
				c.labelLine.y = c.y + c.labelLine.y
			}
		}
	});
	a.Filter = function() {
		var o, d = {}, g, f, i, k, e;
		function p() {
			o = true;
			$nowShowing = $(".categories .category", "#world-map");
			e = $(".picker", "#world-map");
			k = $(".categories ul", "#world-map");
			$(".categories", "#world-map").delegate(".head a", "click",
					function() {
						return false
					}).delegate(".head a, .picker", "mouseover", r).delegate(
					".head a, .picker", "mouseout", j).delegate("li", "click",
					function(s) {
						b($(s.currentTarget))
					})
		}
		function r() {
			e.stop(true).slideDown()
		}
		function j() {
			e.stop(true).slideUp(e.height() * 1.5, function() {
				e.css("height", "")
			})
		}
		function n(s) {
			o || p();
			g = s;
			f = g.params.region;
			i = g.params.categories;
			d[f] || (d[f] = {});
			m();
			c()
		}
		function m() {
			k.children().detach().end().append(d[f].html || h());
			l()
		}
		function q(s) {
			return s.attr("class").split("|")[0]
		}
		function l() {
			if (d[f].iconified) {
				return
			}
			k.children().each(
					function() {
						var w = $(this), t = $(".icon", this), s = i[q(w)];
						if (w.hasClass("noDot")) {
							t.css("background-image", "url("
									+ a.config.folders.images + s.noDot + ")")
						} else {
							var x = Raphael(t[0], 26, 39), v = s.colour, u = x
									.circle(20, 13, 4.5).attr({
										"stroke-width" : 1,
										stroke : v
									});
							w.data({
								dot : u,
								colour : v
							})
						}
					});
			if (!($.browser.msie && parseInt($.browser.version) < 9)) {
				d[f].iconified = true;
				d[f].html = k.children()
			}
		}
		function h() {
			var t = "", s;
			for (s in i) {
				t += '<li class="'
						+ s
						+ "|"
						+ (i[s].noDot ? " noDot" : "")
						+ (i[s].all ? " all" : "")
						+ '"><span>'
						+ i[s].label
						+ '</span><span class="icon"></span>'
						+ ($.browser.msie ? '<span class="iconCover"></span>'
								: "") + "</li>"
			}
			t = $(t);
			if (!($.browser.msie && parseInt($.browser.version) < 9)) {
				d[g.params.region].html = t
			}
			return t
		}
		function c(s) {
			if (typeof d[f].category == "undefined") {
				s = k.children(".all:eq(0)");
				d[f].category = s.prevAll().length
			}
			s = s || k.children().eq(d[f].category);
			s.data("dot") && s.data("dot").attr({
				fill : s.data("colour")
			});
			s.addClass("selected").siblings().removeClass("selected").each(
					function() {
						$this = $(this);
						$this.data("dot") && $this.data("dot").attr({
							fill : "#ffffff"
						})
					});
			$nowShowing.html(s.children("span:eq(0)").text())
		}
		function b(x) {
			var y = x.prevAll().length, t, s, z, w, v, A;
			if (y != d[f].category) {
				d[f].category = y;
				t = q(x), z = u(t);
				c(x);
				e.css({
					display : "none",
					height : ""
				});
				if (s = i[t].mapImg) {
					g.$container.css("background-image", "url("
							+ a.config.folders.images + LBI.functions.getLang()
							+ "/" + s + ")")
				} else {
					g.$container.css("background-image", "")
				}
				for (v = 0, A = g.markers.length; v < A; v++) {
					z(g.markers[v])
				}
				g.detailsPanel.detach()
			}
			function u(B) {
				if (x.hasClass("all")) {
					return function(C) {
						C.showAsCategory()
					}
				} else {
					return function(C) {
						(C.hasCategory(t)) ? C.showAsCategory(t) : C.hide()
					}
				}
			}
		}
		return {
			switchToMap : n
		}
	}()
};
var LBI = window.LBI || {};
LBI.Timeline = function() {
	var a = {
		header : "icon",
		headerSelected : "icon"
	}, f = '<span class="fold"></span><span class="shadow"></span><span class="pointer"></span>';
	function e() {
		if (document.getElementById("timeline-accordion")) {
			$("#timeline-accordion")
					.accordion(
							{
								collapsible : true,
								autoHeight : false,
								icons : a,
								changestart : function(h, i) {
									var k, j = (i.newHeader.length) ? i.newHeader
											: $(h.target).closest(
													".article-content");
									if (i.newContent.length) {
										k = $("ol li h3", i.newContent);
										if (k.length) {
											c.call(k.eq(0))
										}
									}
									$("html, body")
											.animate(
													{
														scrollTop : j.offset().top
																- i.newHeader
																		.closest(
																				"li")
																		.prevAll(
																				"li")
																		.find(
																				".ui-accordion-content-active")
																		.outerHeight()
																- 10
													}, 500)
								},
								animated : $.easie(0.337, 0, 0.352, 1)
							}).delegate("ol>li>h3", "click", c)
					.find(".heading").end().find("ol>li>h3")
					.attr("tabindex", 0);
			$(".timeline-years ol>li:last-child h3", "#timeline-accordion")
					.append('<span class="corner"></span>');
			var g = $("html");
			b({
				lastChild : g.hasClass("no-csslastchild"),
				firstChild : g.hasClass("no-cssfirstchild"),
				descendant : g.hasClass("no-cssdescendant")
			})
		}
	}
	function b(g) {
		if ($.browser.msie) {
			if ($.browser.version.match(/^(6|7|8)/)) {
				$(".timeline-years ol>li:last-child", "#timeline-accordion")
						.addClass("last-child")
			}
			if ($.browser.version.match(/^(6)/)) {
				$(".timeline-years ol>li:first-child, >li:first-child",
						"#timeline-accordion").addClass("first-child")
			}
			if ($.browser.version.indexOf("7") === 0) {
				$(".timeline-years ol", "#timeline-accordion").each(function() {
					var h = 40;
					$(this).children("li").css("z-index", function() {
						return h--
					})
				})
			}
			if ($.browser.version.indexOf("6") === 0) {
				$(".timeline-years ol", "#timeline-accordion").each(
						function() {
							$(this).children().addClass("ol_li").first()
									.addClass("ol_li_fc").end().last()
									.addClass("ol_li_lc")
						});
				$("#timeline-accordion>li").addClass("timeline_li")
			}
		}
	}
	function c(i) {
		i && i.stopPropagation();
		var g, j = $(this).not(":has(.pointer)").append(f).end().closest("li"), h = j
				.hasClass("selected");
		if (!h) {
			j.addClass("selected").removeClass("pre-selected").siblings()
					.removeClass("selected pre-selected").end().prev()
					.addClass("pre-selected")
		}
		if (!(h && i && i.type == "click")) {
			g = j.closest(".timeline-section").find(".current-year").html(
					j.children().clone()).find("ul").accordion({
				collapsible : true,
				active : false,
				autoHeight : false,
				header : "h4",
				icons : a,
				changestart : function(k, l) {
					d(l)
				}
			});
			$(".current-year").find("strong").click(function(k) {
				makeCurrent($(k.target));
				g.accordion("activate", false)
			})
		}
	}
	function d(h) {
		var g;
		if (h.newHeader.length) {
			g = h.newHeader.removeClass("faded").css("opacity", "").closest(
					"li").siblings().children("h4,strong").not(".faded")
		} else {
			g = h.oldHeader
		}
		g.fadeTo(100, 0.5, function() {
			$this = $(this).addClass("faded")
		})
	}
	return {
		init : e
	}
}();

