function twitter()
{
	var url   = ''+document.location;
	var temp  = url.split('/');
	
	var url_s = 'http://www.pantip.com/t.php?'+temp[6];
	
	var title = document.title;
	var param = title+' : '+url_s+' via @pantip1996';
	
	if(param.length > 140)
	{
		var over = param.length-137;
		title = title.length > over ? title.substr(0,(title.length-over))+'...' : '';
		param = title+' : '+url_s+' via @pantip1996';
	}
	window.open('http://twitter.com/home?status='+encodeURIComponent(param));
}

function subHtml(url)
{
	var temp  = url.split('/');
	return 'http://www.pantip.com/t.php?'+temp[6];
}

function goAdd(type)
{   
	var xurl  = ''+document.location;
	var url	= subHtml(xurl);
	var title	= document.title;

	switch(type)
	{
		case "facebook" :
			while(('http://www.facebook.com/share.php?src=bm&u='+encodeURIComponent(url)+'&t='+encodeURIComponent(title)+'&v=3').length > 1185)
			{
				 title = title.substr(0,(title.length-1));
			}
			window.open('http://www.facebook.com/share.php?src=bm&u='+encodeURIComponent(url)+'&t='+encodeURIComponent(title)+'&v=3');
		break;

		case "live" :
			while(('https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&top=1').length > 1185)
			{
				 title = title.substr(0,(title.length-1));
			}
			window.open('https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&top=1');
		break;

		case "google" :
			while(('http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&annotation=').length > 1185)
			{
				 title = title.substr(0,(title.length-1));
			}
			window.open('http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&annotation=');
		break;

		case "dig" :
			window.open('http://digg.com/submit?partner=addthis&url='+url+'&title='+encodeURIComponent('Please insert subject here !!')+'&bodytext='+encodeURIComponent(url));
		break;

		case "del" :
			while(('http://del.icio.us/post?partner=addthis&url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&notes=').length > 1185)
			{
				 title = title.substr(0,(title.length-1));
			}
			window.open('http://del.icio.us/post?partner=addthis&url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&notes=');
		break;

		case "multiply" :
			while(('http://multiply.com/gus/journal/compose/?body=&url='+encodeURIComponent(url)+'&subject='+encodeURIComponent(title)).length > 1185)
			{
				 title = title.substr(0,(title.length-1));
			}
			window.open('http://multiply.com/gus/journal/compose/?body=&url='+encodeURIComponent(url)+'&subject='+encodeURIComponent(title));
		break;

		case "blogger" :
			while(('http://www.blogger.com/blog_this.pyra?t=&u='+encodeURIComponent(url)+'&l&n='+encodeURIComponent(title)).length > 1185)
			{
				 title = title.substr(0,(title.length-1));
			}
			window.open('http://www.blogger.com/blog_this.pyra?t=&u='+encodeURIComponent(url)+'&l&n='+encodeURIComponent(title));
		break;

		case "technorati" :
			window.open('http://technorati.com/faves?add='+encodeURIComponent(url));
		break;

		case "wordpress" :
			var answer = prompt("¡ÃØ³ÒãÊè URL Blog Wordpress ¢Í§¤Ø³´éÇÂ¤ÃÑº :");
			if(answer)
			{
				answer = (answer.indexOf("http://") == 0 ? answer.substring(7,answer.length) : answer ); // µÑ´ HTTP://
				while(('http://'+answer+'/wp-admin/press-this.php?u='+encodeURIComponent(url)+'&t='+encodeURIComponent(title)+'&s=&v=2').length > 1185)
				{
					 title = title.substr(0,(title.length-1));
				}
				window.open('http://'+answer+'/wp-admin/press-this.php?u='+encodeURIComponent(url)+'&t='+encodeURIComponent(title)+'&s=&v=2');	
			}
		break;
	}
}
