if (top.location != location) {
   top.location.href = document.location.href;
}

var title = "歐雅旅遊";
var href = "http://www.euratour.com";
title = encodeURIComponent(title);

function AddToSocial(a_type,a_title,a_link)
{
	if(a_title != 'undefined')
	{
		title = encodeURIComponent(a_title);
	}
	if(a_link != 'undefined')
	{
		share_link = encodeURIComponent(a_link);
	}
	else
	{
		share_link = GetURL();
	}
	switch(a_type)
	{
		case 'facebook':
			window.open('http://www.facebook.com/sharer.php?u=' + share_link + '&t=' + title + '','sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		break;
		
		case 'delicious':
			var url = 'http://del.icio.us/post?url='+share_link+'&title='+title;
			window.open(url);
			return false;
		break;
		
		case 'digg':
			var url = 'http://digg.com/submit?phase=2&url='+share_link;
			window.open(url);
			return false;
		break;
		
		case 'reddit':
			var url = 'http://reddit.com/submit?url='+share_link+'&title'+title; 
			window.open(url);
			return false;
		break;
		
		case 'twitter':
			window.open('http://twitter.com/home/?status=' + title + ' ' + share_link);
			return false;
		break;
		
		case 'plurk':
			window.open('http://www.plurk.com/?qualifier=shares&status=' + share_link + ' ( ' + title + ' ) ');
			return false;
		break;
		
		case 'funp':
			window.open('http://funp.com/push/submit/add.php?via=tools');
			return false;
		break;
		
		case 'hd':
		 	window.open('http://www.hemidemi.com/user_bookmark/new?title='+title+'&url='+share_link);
  			return false;
		break;
	}
}


function GetURL()
{
	return encodeURIComponent(href);
}

function AddToFavorite()
{
	if (document.all)
	{
		// For IE
		window.external.AddFavorite(href, document.title);
	}
	else if (window.sidebar)
	{
		// For Firefox
		window.sidebar.addPanel(document.title, href, "");
	}
}