/*************************************************************
 *
 * functions.js - サイト全体の基本的な機能を提供
 *
 * Last Modified: 2010/02/22
 * Copyright (c) 2010 OSHIMA Nozomi All Rights Reserved.
 *
 * !require jQuery v 1.4
 *
 *************************************************************/

$(function(){

	// 吹き出し（トップページのみ）
	if( !$.browser.msie )
	{
		function emph() {
			$(this).unbind("mouseover",emph)
			$(this).stop().clearQueue()
				.css({"position":"relative","top":-30,"left":-20})
				.animate({"top":0,"left":0},600,"easeOutElastic",
					function(){ $(this).bind("mouseover",emph)});
		}
		
		$("#qrMessage").bind("mouseover",emph);
		
		$("#index #qrMessage")
			.css({"position":"relative","opacity":0,"top":-20,"left":-12})
			.delay(300).animate({"opacity":1,"top":0,"left":0},600,"easeOutElastic");
	}
	
	// アドレス入力フォーム
	/*
	(function(){
		$("#userAddressForm").hide();
		var defaultText = $("#openUserAddressForm").text();
		$("#openUserAddressForm").toggle(
			function()
			{
				$(this).text("キャンセル").blur();
				$("#userAddressForm").show();
				return false;
			},
			function()
			{
				$("#userAddressForm").hide();
				$(this).text(defaultText).blur();
				return false;
			}
		);
		var helpText = "メールアドレスを入力";
		$("#user_address")
			.attr("value", helpText).css("color","#999")
			.bind("focus", function(){
				if( $(this).attr("value") == helpText )
					$(this).css("color","#333").attr("value","");
			}).bind("blur", function(){
				if( $(this).attr("value") == "" )
					$(this).css("color","#999").attr("value",helpText);
			});
	})();
	*/

	// 画面トップへ戻るボタン
	$('.btnTop a').each(function(){
		$(this)
			.attr("href","javascript:;")
			.attr("title", $(this).text())
			.bind("click", function(){
				$($.browser.safari ? "body" : "html")
					.animate({scrollTop:0}, 400, "easeInOutQuad");
				return false;
			});
	});



	
});

/* EOF */
