var Site = {
	init: function() {
		Site.textSize.init({'id':'siteUtil', 'cookieName':'textSize', 'target': 'contentColumn'});
		ReMooz.assign('a.lightbox', {
			'origin': 'img',
			'shadow': 'onOpenEnd', // fx is faster because shadow appears after resize animation
			'resizeFactor': 0.8, // resize to maximum 80% of screen size
			'cutOut': false, // don't hide the original
			'opacityResize': 0.4, // opaque resize
			'dragging': false, // disable dragging
			'centered': true // resize to center of the screen, not relative to the source element
		});

	},
	
	textSize: {
		cName: null,
		opts: { duration: 60 },
		scale: ['0.75em','1.0em','1.15em'],
		myScale: null,
		els: null,
		curr: 0,
		init: function(obj) {
			if (!$(obj.id)) return;
			
			this.targetEl = $(obj['target']) || $(document.body)
			this.cName = obj.cookieName
			//if doesnt exist, set to 0
			if (!$chk(Cookie.read(this.cName))) Cookie.write(this.cName, 0, this.opts)
			
			this.myScale = parseInt(Cookie.read(this.cName))
			
			this.els = $(obj.id).getElements('#txtSize span.txtSize')
						
			this.els.each(function(el, i) {
				el.set('href', 'javascript:void(0);')
				el.store('size', i)
				el.addEvent('click', function() {
					this.processScale(el)
				}.bind(this))
			}, this)
			
			this.processScale(this.els[this.myScale]);
			//this.targetEl.setStyle('font-size', this.scale[this.myScale])			
		},
		setCookie: function() {
			Cookie.write(this.cName, this.myScale, this.opts)
		},
		processScale: function(el) {
			if (this.els[this.myScale].hasClass("selected")) this.els[this.myScale].removeClass("selected");		
			
			this.myScale = el.retrieve('size');						
			this.setCookie();
			
			this.els[this.myScale].addClass("selected");
			this.targetEl.setStyle('font-size', this.scale[this.myScale]);
		}		
	}		
	
};


window.addEvent("domready", function() {
	Site.init();	
});


// movie functions
function thisMovie(movieName) {
	 if (navigator.appName.indexOf("Microsoft") != -1) {
		 return document.getElementById(movieName);//window[movieName];
	 } else {
		 return document[movieName];
	 }
}
function skipIntro()
{
    thisMovie("videoSection").skipIntro();
}
