// JavaScript Document
document.id = function(id){
	return  $(id);
};

var Bubble = new Class({
											 
	Implements: Options,
	
	options: {
		bubble: 'p.bubble-content'
	},
	
	initialize: function(element){
		
		this.element = document.id(element);
		
		this.bubble = this.element.getElement(this.options.bubble);
		
		this.element.addEvents({
		  'mouseenter': this.show.bind(this),
			'mouseleave': this.hide.bind(this)
		});
		
	},
	
	show: function(){
		this.bubble.setStyle('display','block');
	},
	
	hide: function(){
		this.bubble.setStyle('display', 'none');
	}
	
});

window.addEvent('domready', function(){

// clickable blocks
		$$('.clickable').each(function(item){
				item.setStyle('cursor', 'pointer');
				var anchor = item.getElement('a');
					item.addEvent('click', function(){
						window.location = anchor.getAttribute('href');
					});
					anchor.addEvent('click', function(event){
						event.stopPropagation();
					});

		});
		
		$$('div.bubble').each(function(bubble){
		  new Bubble(bubble);
		});
		
		this.links = $$('a.remooz');
		
		this.links.each(function(link){
			new ReMooz(link,{
				'shadow': 'onOpen',
				'resizeFactor': 0.9,
				'cutOut': false,
				'opacityResize': 0,
				'centered': true,
				'origin' : link.getElement('img')
			});
		});
		
		

if ($('hp-content')){
	swfobject.embedSWF("/flash/video-player.swf", "video", stageW, stageH, "9.0.0", false, flashvars, params, attributes);

	/*
	var playVideo = false;
	var index = document.URL.indexOf('#');
	if (document.URL.substr(index+1) == 'video'){
		playVideo = true;
	};
	var play = $('btn-play');
	var overlay = $('overlay');
	if (playVideo){
		overlay.setStyle('display', 'block');
		var topFlash = new SWFObject("video.swf", "overlay-video", "360", "332", "8");
		topFlash.addParam("wmode","transparent");
		topFlash.write("overlay");
		if (linkList) linkList.setStyles({
			'padding-top': 8,
			'background-position': '0px 7px'
		});
	} else {
		play.addEvent('click', function(event){
			var event = new Event(event);
			overlay.setStyle('display', 'block');
			var topFlash = new SWFObject("video.swf", "overlay-video", "360", "332", "8");
			topFlash.addParam("wmode","transparent");
			topFlash.write("overlay");
		});
	}
	*/
}
});
