// JavaScript Document
$(function() {
	var ECD_URL = encodeURIComponent(location.href);
	var ECD_TITLE = encodeURIComponent(document.title);
	//var UT_URL = String(location.href).split("/");
	
	//$("#webTool").html("<div id='S-TW' style='width: 85px; float: left;'></div><div id='S-GR' style='width: 80px; float: left;'></div><div id='S-MI' style='width: 80px; float: left;'></div><div id='S-GP' style='width: 80px; float: left;'></div><div id='S-FB' style='width: 80px; float: left;'></div>");
	var sP = "width: 24px; height: 24px; margin-right: 2px; float: left;"
	var sC = "width: 24px; height: 24px; display: block; background: url(http://www.kitamura.jp/common/images/sbm/ico_social_x24.png) no-repeat 0 0;"
	$("#webTool").html("<div id='S-TW' style='"+sP+"'></div><div id='S-FS' style='"+sP+"'></div><div id='S-YA' style='"+sP+"'></div><div id='S-GB' style='"+sP+"'></div><div id='S-HA' style='"+sP+"'></div></div>").parent().parent().append('<div id="webTool2"></div>');
	$("#webTool").css({'margin':'0 0 5px 0'});
	// Tw
	$("#S-TW").append("<a href='http://twitter.com/share?text="+ECD_TITLE+"&lang=ja' target='_blank' title='つぶやく' style='"+sC+"'></a>");
	$("#S-FS").append("<a href='http://www.facebook.com/sharer.php?u="+ECD_URL+"&t="+ECD_TITLE+"' target='_blank' title='FaceBook シェア' style='"+sC+" background-position: -24px 0;'></a>");
	$("#S-YA").append("<a href='http://bookmarks.yahoo.co.jp/action/bookmark?t="+ECD_TITLE+"&amp;u="+ECD_URL+"' target='_blank' title='Yahoo!ブックマークに登録' style='"+sC+" background-position: -48px 0;'></a>");
	$("#S-GB").append("<a href='http://www.google.com/bookmarks/mark?op=add&bkmk="+ECD_URL+"&title="+ECD_TITLE+"' target='_blank' title='Googleブックマークに登録' style='"+sC+" background-position: -72px 0;'></a>");
	$("#S-HA").append("<a href='http://b.hatena.ne.jp/append?"+ECD_URL+"' target='_blank' title='はてなブックマークに登録' style='"+sC+" background-position: -96px 0;'></a>");
	
	$("#webTool2").css({"clear":"both","margin":"15px 0", "padding":"15px 10px","border-top":"1px dotted #ccc"});
	$("#webTool").clone().appendTo("#webTool2");
	$("#webTool2").append("<div id='FB-Nice' style='clear:both; padding: 5px 0;'><iframe src='http://www.facebook.com/plugins/like.php?href="+ECD_URL+"&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=35' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width: 100%; height: 85px;' allowTransparency='true'></iframe></div>");
	
	$("#webTool a").hover(
		function() { $(this).fadeTo(100, 0.75); },
		function(){ $(this).fadeTo(100, 1.0); }
	);

	
	
	// Gre
	//$("#S-GR").append("<div><iframe src='http://share.gree.jp/share?url="+ECD_URL+"&type=0&height=20' scrolling='no' frameborder='0' marginwidth='0' marginheight='0' style='border:none; overflow:hidden; width:80px; height:20px;' allowTransparency='true'></iframe></div>");
	// Mix
	//$("#S-MI").append("<div><iframe scrolling='no' frameborder='0' allowTransparency='true' style='overflow:hidden; border:0; width:100%; height:20px' src='http://plugins.mixi.jp//favorite.pl?href="+ECD_URL+"&service_key=1dde78049f9a60c6195b91a31acfd2b5dfa03f25&show_faces=false&width=100%'></iframe></div>");
	// GP1
	//$("#S-GP").append("<div id='S-GP2'><g:plusone size='medium'></g:plusone></div>");
	// FB
	//$("#S-FB").append("<div><iframe src='http://www.facebook.com/plugins/like.php?href="+location.href+"&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:100px; height:21px;' allowTransparency='true'></iframe></div>");
	
	
	/*
	// GooglePlus1
	var t = document.createElement("script"); 
	t.text="{lang:'ja', parsetags:'explicit'}";
	t.type = "text/javascript";
	t.src = "https://apis.google.com/js/plusone.js";
	$(t).load(function(e) {
		gapi.plusone.go("S-GP2");
	});
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(t, s);
	*/
	
	/*
	var SHOP_CODE = UT_URL[4];
	var PRE_CODE = UT_URL[3].slice(1);
	if((SHOP_CODE.length==4)&&(PRE_CODE==1||PRE_CODE==4||PRE_CODE==7)&&(UT_URL[5]==''||UT_URL[5]=='index.html'))
	$('#wCol1').prepend('<p><b>お見舞い申し上げます</b></p>');
	*/
});
