/** COPYRIGHT 2011 ADMX V.O.F., BAARLE-NASSAU, SCHIJF, THE NETHERLANDS  */
/** * */var px = 'px';var LegioXGemina = Class.create();LegioXGemina.prototype = {tabOpenWidth: 0,tabNormalWidth : 0,initialize: function (){var loc = String(window.location).split('/');var pageOpen = (!loc[3] || loc[3] == 'start')?'home':loc[3];this.main = $('main');this.stageSize = Element.getDimensions(this.main);this.mainBackground = $$('div.mainBackground')[0];this.tabsArray = $$('div.menuTab');this.objectArray = [];this.tabOpenWidth = this.stageSize.width;this.tabNormalWidth = 135;this.tabOpenWidth = this.tabOpenWidth - (this.tabNormalWidth * (this.tabsArray.length-1));var w,a,b;var self = this;for(var i = 0; i < this.tabsArray.length; i++){var item = this.tabsArray[i];var obj = {};obj.item = item;obj.name = item.id;obj.head = this.getItemFromObject(item, 'contentHead');Event.observe(obj.head, 'click', this.eOpenLocation.bind(this, obj));obj.body = this.getItemFromObject(item, 'contentBody');obj.label = this.getItemFromObject(item, 'tabLabel');obj.bgStyle = String('mainBackground-' + obj.name).camelize();if (item.id == pageOpen){w = this.tabOpenWidth;a = 100;b = 0;this.mainBackground.id = obj.bgStyle;}else{w = this.tabNormalWidth;a = 0;b = 100;}obj.tWidth = new Tween(obj.item.style,'width',Tween.regularEaseOut, w, w, .1, 'px').start();obj.tHead = new OpacityTween(obj.head, Tween.regularEaseOut,a, a, 0.1).start();obj.tBody = new OpacityTween(obj.body, Tween.regularEaseOut,a, a, 0.1).start();obj.tLabel = new OpacityTween(obj.label, Tween.regularEaseOut,b, b, 1).start();obj.tBody.onMotionFinished = function (){self.inMotion = false;};Event.observe(obj.label, 'click', this.eOpen.bind(this, obj));this.objectArray.push(obj);}},eOpen : function (obj){this.setActiveTab(obj.name);},setActiveTab : function (activeTab){if(this.inMotion == true){return;}this.inMotion = true;for(var i = 0; i < this.objectArray.length; i++){var obj = this.objectArray[i];if (obj.name == activeTab){this.tabOpen(obj);}else{this.tabClose(obj);}}},inMotion: false,eOpenLocation: function (obj){window.location = '/' + ((obj.name == 'home')?'start':obj.name);},tabOpen : function (obj){var t = 1;var w = this.tabOpenWidth;var obj = obj;obj.tWidth.continueTo(w,t);obj.tLabel.continueTo(0, t);obj.tWidth.onMotionFinished = function (){obj.tHead.continueTo(100, t);obj.tBody.continueTo(100, t);};obj.tHead.onMotionFinished = this.eOpenLocation.bind(this, obj);var itemBg = Dom.div(null, {'class':'mainBackground'});itemBg.id = obj.bgStyle;this.main.insertBefore(itemBg, this.mainBackground);var oldBg = this.mainBackground;var self = this;var tween = new OpacityTween(oldBg, Tween.regularEaseOut,100, 0, 0.5).start();tween.onMotionFinished = function (){Dom.un(oldBg);self.mainBackground = itemBg;};},tabClose : function (obj){var t = 1;var w = this.tabNormalWidth;var object = obj;obj.tHead.continueTo(0, t);obj.tBody.continueTo(0, t);obj.tLabel.continueTo(100, t);obj.tWidth.continueTo(w, t);obj.tHead.onMotionFinished = function (){};obj.tWidth.onMotionFinished = function (){};},getItemFromObject : function(obj, name){if (obj && obj.childNodes){var x = obj.childNodes;for(var i in x){var z = x[i];if (z.className && z.className == name){return z;}}}return null;}};ReadMore = Class.create();ReadMore.prototype = {initialize: function (){var arrText = $$('div.moreInfo');var arrRM = $$('div.readMore');for(var i = 0; i< arrText.length; i++){var obj = {txt : arrText[i],click : arrRM[i],open: true};Event.observe(obj.click, 'click', this.openText.bind(this, obj));this.openText(obj);}},openText : function (obj){if (obj.open == false){obj.open = true;with(obj.txt.style){overflow = 'visible';height = 'auto';width = '100%';}obj.click.innerHTML = '[X] Sluiten';}else{obj.open = false;with(obj.txt.style){overflow = 'hidden';height = '120px';}obj.click.innerHTML = '&gt; Lees meer..';}}};Event.observe(window, 'load', function (){if (lgxReader == undefined){new LegioXGemina();new ReadMore();}});

