DaikonStudio = function () {
	
	var page;
	var minHeight = 1200;
	var minimum = 558;
	
	this.switchTo = function (options) {
		var name = options.name || 'home';

		var current = $('.text').filter( function() { return $(this).is(':visible'); });
		current.fadeOut( function () {
			$('.text.' + name).fadeIn();
		});
	};
	
	var init = function () {
		page = $('.page');
		resizePage();
		registerEvents();
		
		DaikonStudio.Menu = new DaikonStudio.Menu();
		DaikonStudio.SkypeBlocker = new DaikonStudio.SkypeBlocker();		
	};
	
	var resizePage = function () {
		var height = $(window).height();
		//height = (height < minimum) ? minimum : minHeight;
		
		page.css({
			'height' : height
		});
	};
	
	var registerEvents = function () {
		$(window).bind('resize', function () {
			resizePage();
		});
	};
	
	init();
};

DaikonStudio.Menu = function () {

	var items;

	var init = function () {
		items = $('.menuItem');
		initEvents();
	};
	
	var initEvents = function () {
		items.bind('click', function (e) {
			items.removeClass('selected');
			$(this).addClass('selected');
			
			DaikonStudio.switchTo({
				name: $(this).attr('id')
			});
			
			e.stopPropagation();
			return false;
		});		
	
		items.bind('mouseover', function () {
			$(this).addClass('hovered');
		});
		
		items.bind('mouseout', function () {
			$(this).removeClass('hovered');
		});		
	};
	
	init ();
};

DaikonStudio.SkypeBlocker = function () {
	
	var Items = {};
	
	var init = function () {
		Items.mobileVisible = $('span.skype_pnh_print_container');
		Items.mobileHidden = $('span.skype_pnh_container ');
		
		setCss();
	};
	
	var setCss = function () {
		Items.mobileVisible.attr('style', 'display: inline !important');
		Items.mobileHidden.attr('style', 'display: none !important');	
		/*
		Items.mobileVisible.css({
			display : 'inline !important'
		});
		
		Items.mobileHidden.css({
			display : 'none !important'
		});
		*/
	};
	
	window.setTimeout( function () {
		init ();
	}, 1000);
};


