// JavaScript Document
var gcommeURL = encodeURIComponent(location.href);
var enquURL = encodeURIComponent(location.href);
var sendURL;

//twitter
function twitterShare(mode){
	if(mode == 1){
		sendURL = 'http://twitter.com/intent/tweet?original_referer=' + gcommeURL + '&text=' + gcommeURL;
	}else{
		sendURL = 'http://twitter.com/intent/tweet?original_referer=' + enquURL + '&text=' + enquURL;
	}

	window.open(
		sendURL,
		'share',
		['width=550','height=420','location=yes','resizable=yes','toolbar=no','menubar=no','scrollbars=no','status=no'].join(',')
	);
}

//facebook
function facebookShare(mode,title){
	if(mode == 1){
		sendURL = 'http://www.facebook.com/share.php?u=' + gcommeURL + '&t=%92n%88%e6%8f%ee%95%f1%94z%90MWEB%20%8aX%83s%83%5e' + '@' + title;
	}else{
		sendURL = 'http://www.facebook.com/share.php?u=' + enquURL + '&t=%92n%88%e6%8f%ee%95%f1%94z%90MWEB%20%8aX%83s%83%5e' + encodeURIComponent('@' + title);
	}
	window.open(
		sendURL,
		'share',
		['width=632','height=456','location=yes','resizable=yes','toolbar=no','menubar=no','scrollbars=no','status=no'].join(',')
	);
}

//mail
function startMailer(title){
	location.href = 'mailto:?subject=%92n%88%e6%8f%ee%95%f1%94z%90MWEB%20%8aX%83s%83%5e' + '&body=' + title + (encodeURIComponent(location.href));
}

