var howToImgs = new Array(); var indexBtns = new Array(); function Init () { if($$('.img-how-to')) { $$('.img-how-to').each(function (el) { howToImgs[el.id] = new Rollover(el); }); } if($$('.btn-index')) { $$('.btn-index').each(function (el) { indexBtns[el.id] = new Rollover(el); }); } function getArgs() { var args = new Object(); var query = location.search.substring(1); var pairs = query.split("&"); for(var i = 0; i < pairs.length; i++) { var pos = pairs[i].indexOf('='); if (pos == -1) continue; var argname = pairs[i].substring(0,pos); var value = pairs[i].substring(pos+1); args[argname] = unescape(value); } return args; } var args = getArgs(); if(args.showGame) showGame(args.showGame); } var Rollover = new Class({ initialize: function(el){ this.el = el; ref = this; this.src = el.getProperty('src'); el.addEvent('mouseover', function (e) { e = new Event(e); el.setProperty('src',this.src.replace(/-off/,'-on')); }.bind(ref)); el.addEvent('mouseout', function (e) { e = new Event(e); el.setProperty('src',this.src); }.bind(ref)); } }); function showGame(language) { Window.onDomReady(function() { $('game-container').setStyle('display','block'); $('filter').setStyle('height',getHeight()); $('filter').setStyle('width',getWidth()); $('filter').setStyle('display','block'); $('game').setStyle('display','block'); var heightChange = new Fx.Style('game', 'height', {duration:1000, onComplete: function() { $('img-no-flash').setStyle('display','block'); so = new SWFObject('/swf/main.swf', 'MediaPlayer', '900', '550', '8', '#990000'); so.addVariable ('languageCode', language); //so.addParam('wmode','transparent'); so.write('game'); } }); heightChange.start(1, 550); }); } function hideGame() { var heightChange = new Fx.Style('game', 'height', {duration:500, onComplete: function() { $('game-container').setStyle('display','none'); $('filter').setStyle('display','none'); if($('img-no-flash')) $('img-no-flash').setStyle('display','none'); $('game').setStyle('display','none'); $('game').empty(); } }); heightChange.start(550, 1); } window.addEvent('domready', Init);