﻿(function($j){

	Code.registerNamespace('Website');

	Website.Core = {
	
		content: null,
		_defaultURL: 'main.html?fs=true',
		
		
		checkBrowser: function(){
			if(Code.UserAgent.isSafari){
				$j('body').addClass('safari');
			}
		},
		
		injectStyleSheet: function(){
			$j('head').prepend('<link type="text/css" rel="stylesheet" href="/templates/_Client/Styles/JSHide.css" media="screen" />');
		},
		
		
		launchFlashButtons: function(){
			var _self = this;
			var _URL = _self._defaultURL;
			
			$j('#launch-full-screen')
				.click(function() {
					Website.Core._openWindow(_URL, 'main');
					return false;
				});
		},
		
		
		onReady: function(){
		
			var _self = this;
			_self.checkBrowser();
			_self.launchFlashButtons();
			
		},
		
		_openWindow: function(URL, page){
		
			var pageURL = String(URL);
			var wWidth = screen.width;
			var wHeight = screen.height;
			
			if(page != 'main'){
				wWidth = '400';
				wHeight = '680';
			}
			
			var randId =	new Date();
			var unId = randId.getDate();
			
			params  = 'width=' + wWidth;
			params += ', height=' + wHeight;
			params += ', top=0, left=0'
			params += ', fullscreen=yes';

			newwin=window.open(pageURL,'SkinBliss'+unId, params);
				if (window.focus) {newwin.focus()}
			//	return false;
			
			return false;
			
			}
		
		
	};

	$j().ready(function(){
		Website.Core.onReady();
	});

})(jQuery);	

