﻿/* Licuit Interactive SL */
/* main.css */
/* Created July, 2009 */
/* Modified July, 2009
--------------------------------------- */

LicuitCore.LanguageSelector = new Class({
        Extends: LicuitCore.licuit,
		Implements: [Options, Events],
		
		options: {},
		mainLayer: null,
		btn: null,
		opened: false,
		fx: null,

		
		initialize: function(){
            this.parent();			
        },
		
		setup: function(){
			this.mainLayer = $("languageSelector");
			this.btn = this.mainLayer.getFirst("a");
			this.fx = new Fx.Tween(this.mainLayer,{duration: '400', transition:"sine:in:out"});

			var tClass = this;
			
			this.btn.addEvent('click', function(){ tClass.toggle(); });
		},
		
		toggle: function(){			
			if(this.opened){
				//Cerrar
				this.fx.start("height", "11");
			}else{
				//Abrir
				this.fx.start("height", "37");
			}
			
			this.opened = !this.opened;
		}
				
    });

var languageSelector = new LicuitCore.LanguageSelector();
window.addEvent('domready', function(){ languageSelector.setup(); });
