var SBSUtility = function() {
    return {
		createBookmark: function() {
			title = document.title; //"SBS TV Schedule";
			url = document.location.href; //"http://www.sbs.com.au/schedule";
			
			if (window.sidebar) { // Mozilla Firefox Bookmark
				window.sidebar.addPanel(title, url,"");
			} else if( window.external ) { // IE Favorite
				window.external.AddFavorite( url, title); 
			} else if(window.opera && window.print) { // Opera Hotlist
				return true; 
			}
		},
		
        changeFontSize: function(link, container) {
			var currentFontSize = $(container).css('font-size'); // currently targets universal <p>
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			
			if ($(link).hasClass("increaseFont")) {
				// decrease the font size
				var newFontSize = currentFontSizeNum - 2;
			} else {
				// increase the font by default
				var newFontSize = currentFontSizeNum + 2;
			}
			$(container).css('font-size', newFontSize); // currently targets universal <p>
			$(link).toggleClass("increaseFont");
		},

        printSchedule: function() {
            w = 680;
            h = 600; 
            LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
			TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
			window.open('/print/schedule/', 'print_view', 'width=680,height=600,top=' + TopPosition + ',left=' + LeftPosition + ',resizable=yes,scrollbars=yes');
        },

        printPage: function(print_type, content_id, baseUrl) {
            w = 680;
            h = 600; 
            LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
			TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
			window.open(baseUrl + '/print/index/printType/' + print_type + '/id/' + content_id, 'print_view', 'width=680,height=600,top=' + TopPosition + ',left=' + LeftPosition + ',resizable=yes,scrollbars=yes');
        }
        
    };
}();