

Shadowbox.init({
	skipSetup: 	true,
	players:		["flv", "iframe"],
	overlayOpacity: '1'					// 0 - 1 alpha values
});



Utils = {
	
	getSwfReference: function(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	},
	
	getPageUrl: function() {
		return $.jqURL.strip();
	},
	
	sharePage:function(shareType, t, params, desc) {
		var returnUrl = Utils.getPageUrl();
		returnUrl += (params == null) ? '' : '?' + params;
		description = (desc == null) ? '' : encodeURIComponent(desc);
		title = (t == null) ? '' : encodeURIComponent(t);

		switch (shareType) {
			case "facebook":
				url = 'http://www.facebook.com/sharer.php?u=' + returnUrl + '&t=' + title;
				// url = 'http://www.facebook.com/share.php?u=' + returnUrl + '&t=' + title;
				break;
			case "twitter":
				url = 'http://www.twitter.com/home?status=' + returnUrl;
				break;
			case "myspace":
				url = 'http://www.myspace.com/Modules/PostTo/Pages/?' + 't=' + title + '&c=' + description + '&u=' + returnUrl + '&l=' + 6;
				break;
			case "digg":
				url = 'http://digg.com/submit?url=' + returnUrl + '&title=' + title;
				break;
		}
		
		// If jquery is loaded...
		$.jqURL.loc(url, {w:800,h:440,wintype:'_blank'});
		
		// Otherwise, a straight open will do.
		// window.open (url, "social","menubar=0,status=0,toolbar=0,directories=0,resizable=1,width=800,height=440"); 

	},
	
	playHandsVideo: function() {
		Shadowbox.open({
			content:"../../../video/handsonlypromoenglish.flv",
			player:"flv",
			title:"Hands-Only<span style='font-size:.5em'>TM</span> CPR Demonstration Video",
			width:320,
			height:240,
			options:{
				onClose: Utils.handleVidClose
				// onClose: function() { setTimeout("Utils.handleVidClose()", 100) }
			}
		});
	},
	
	
	handleVidClose: function() {
		var swfRef = Utils.getSwfReference("flashContent");
		swfRef.resumePlayback();
	}
	
}
