if (top.location != location) {
   top.location.href = document.location.href;
}
var maintitle = ('21世紀不動產是家的夢想推手，快來瞧瞧這些真摯感動的故事～');
var title = "感動．分享．愛無限";
var project_url = 'http://www.century21.com.tw/loveshare/';
//var project_url = "http://kt1.kehch.com/200910_century21/";
var share_url = project_url+"Share.aspx";
title = (title);
project_url = encodeURIComponent(project_url);
share_url = encodeURIComponent(share_url);

function GetURL()
{
	return project_url;
}

function GotoIndex()
{
	location.href='http://www.century21.com.tw/loveshare/';	
}
function Goto21Century()
{
	 window.open("http://www.century21.com.tw/");
}

function AddToFacebook(a_type,a_id) 
{
	var url;
	if(a_type=='index')
	{
		url = share_url;
	}
	else
	{
		url = share_url;
		url+='?articleID='+a_id;
		
	}
	window.open('http://www.facebook.com/sharer.php?u='+url+'&t='+(title),'sharer','toolbar=0,status=0,width=626,height=436');return false;
  return false;
}

function AddToTwitter(a_type,a_id,a_title)
{
	var url;
	if(a_type=='index')
	{
		url = project_url;
		var title = maintitle;
	}
	else
	{
		url = share_url;
		url+='?articleID='+a_id;
		var title = a_title;
	}
	
	
	window.open('http://twitter.com/home/?status=' + encodeURIComponent(title) + ' ' + url);
	return false;
}

function AddToPlurk(a_type,a_id,a_title)
{
	if(a_type=='index')
	{
		url = project_url;
		var title = maintitle;//
	}
	else
	{
		url = share_url;
		url+='?articleID='+a_id;
		var title = a_title;
	}
	window.open('http://www.plurk.com/?qualifier=shares&status=' + url + ' ('+encodeURIComponent(title)+')');
	return false;
}

function AddToFunP() 
{
  window.open('http://funp.com/push/submit/add.php?via=tools');
  return false;
}

function AddToHD() 
{
  window.open('http://www.hemidemi.com/user_bookmark/new?title='+title+'&url='+share_url);
  return false;
}

function AddToFavorite()
{
	if (document.all)
	{
		// For IE
		window.external.AddFavorite(share_url, document.title);
	}
	else if (window.sidebar)
	{
		// For Firefox
		window.sidebar.addPanel(document.title, share_url, "");
	}
}
