/**
 * Sharkworld - Project Management Game
 * Copyright (c) 2010 RANJ Serious Games
 * 
 * @id			$Id: sharkworld.js 218 2010-11-23 13:13:15Z timk $
 * @author		Tim Kurvers <timk@ranj.nl>
 */

/**
 * Sharkworld JavaScript
 */
var Sharkworld = function() {
	
	/**
	 * Convenience singleton
	 */
	Sharkworld.instance = this;
	
	/**
	 * Self-reference
	 */
	var self = this;
	
	/**
	 * Constructor
	 */
	var _construct = function() {
		Cufon.replace('h2');
		Cufon.replace('h5');
		Cufon.replace('#navigation li a');
		Cufon.replace('.hlink', {color: '#720000'});
		Cufon.now();
		
		$('#playbutton').click(function() {
			self.popup('http://www.sharkworldgame.nl/client/', 'sharkworldclient', 1000, 760);
		});
		
		$('#quoterotate').innerfade({
			speed: 'slow',
			timeout: 8000,
			type: 'sequence'
		});
	};
	
	/**
	 * Launches a popup
	 */
	this.popup = function(link, identifier, width, height) {
		width = width || 1000;
		height = height || 760;
		var params = 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes,resizable=yes,fullscreen=yes';		
		window.open(link, identifier, params);
	};
	
	_construct();
	
};

