var share = {
	// required
	url: null,
	title: null,
	
	// optional
	description: null,
	
	// specific
	tweet: null,
	
	send: function (site)
	{
		var url = null;
		switch (site) {
			case 'delicious':
				if (this.url && this.title) {
					var url = 'http://delicious.com/save?url=' + escape(this.url) + '&title=' + escape(this.title) + '&notes=' + escape(this.description);
				}
				break;
			case 'digg':
				if (this.url && this.title) {
					var url = 'http://digg.com/submit?phase=2&partner=[partner]&url=' + escape(this.url) + '&title=' + escape(this.title);
				}
				break;
			case 'facebook':
				if (this.url) {
					var url = 'http://www.facebook.com/sharer.php?u=' + escape(this.url) + '&t=' + escape(this.title);
				}
				break;
			case 'myspace':
				if (this.url && this.title) {
					var url = 'http://www.myspace.com/Modules/PostTo/Pages/?u=' + escape(this.url) + '&t=' + escape(this.title);
				}
				break;
			case 'stumbleupon':
				if (this.url && this.title) {
					var url = 'http://www.stumbleupon.com/submit?url=' + escape(this.url) + '&title=' + escape(this.title);
				}
				break;
			case 'twitter':
				if (this.tweet) {
					var url = 'http://twitter.com/home?status=' + escape(this.tweet);
				}
				break;
		}
		//if (url) window.location = url;
		if (url) {
			if ( window.open(url) ) {
				return true;
			}
			return false;
		}
	}
	
};


var popUp = function (url,name,windowWidth,windowHeight){
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;
	mytop=(screen.height)?(screen.height-windowHeight)/2:100;
	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=yes, top="+mytop+",left="+myleft;
	var windowRef = window.open(url,name,properties)
	if (windowRef.location.href == url) windowRef.focus();
}
var facebookShare = function (shareID) {
	var title;
	switch (shareID) {
		case 0:
			title = 'I believe you, Michael. Check out The Stepfather, in theaters October 16.';
			break;
		case 1:
			title = 'Welcome to the Family. Check out The Stepfather, in theaters October 16.';
			break;
		case 2:
			title = 'Who\'s your Daddy? Check out The Stepfather, in theaters October 16.';
			break;
	}
	var url = 'http://www.sonypictures.com/movies/thestepfather/socialmedia/facebook/share/' + shareID + '.html?v=1.0';
	popUp('http://www.facebook.com/sharer.php?u=' + url + '&t=' + escape(title), 'share', 626, 436);
}
