/* ================================================================================
* Title: Jquery Function
*
* Copyright (c) 2010 Astra The Studio Inc.
* http://www.studio.co.jp/
* Date: Mar.26, 2010
* @author: Chihiro Mori
* @version: 1.0.4
*
* jQuery 1.4.2
*
* 確認済ブラウザ: [Mac] FireFox3.0, Safari3.1.2 [Win] IE6.0, 7.0, 8.0
* Macで作業するときの注意：バックスラッシュ\を入力するときはoptionを押しながらエンマーク
================================================================================ */
(function($)
{
//---------------------------------------------------------------------
	$(function()
	{
		function init(){
			$.ASconf.menuRollover();
			$.ASconf.btnRollover();
			$.ASconf.homeEffect();
			$.ASconf.voiceSideHeight();
		};
		if($('#g_navi').length)
		{
			$("#g_navi").load("/header.html", function()
			{
				init();
			});
		}else {
			init();
		};
	});
//---------------------------------------------------------------------
	$.ASconf =
	{
	//---------------------------------------------------------------------
		menuRollover: function()
		{
			$('div#g_navi a img').each(function()
			{
				$(this).hover(function(){
				$(this).not(':animated').fadeTo('fast', 0);}
				,function(){
				$(this).fadeTo('fast', 1);});

			});
		}
		,
		//---------------------------------------------------------------------
		btnRollover: function()
		{
			$('div#headerWrapper a img, div#footer a img, body#home div#mainCon2 a img, .btn, #sideBox a img').each(function()
			{
				$(this).hover(function(){
				$(this).not(':animated').fadeTo('fast', 0.6);}
				,function(){
				$(this).fadeTo('fast', 1);});

			});
		}
		,
		//---------------------------------------------------------------------
		homeEffect: function()
		{
			$('body#home').each(function()
			{
				$(this).find('div#pane1').jScrollPane({scrollbarWidth:7, scrollbarMargin:13});
//				$(this).find('div.voiceCont').each(function()
//				{
//					var url = $(this).find('a').attr('href');
//					$(this).css('cursor','pointer')
//					.hover(function()
//					{
//						$(this).not(':animated').fadeTo('fast', 0.6);
//					}
//					,function()
//					{
//						$(this).fadeTo('fast', 1);
//					})
//					.click(function()
//					{
//						if(url.indexOf('#')!= -1)
//						{
//							$($.browser.safari ? 'body' : 'html')
//							.animate({scrollTop: $(url).offset().top}, 500);
//						}
//						else
//						{
//							location.href = url;
//						}
//					});
//				});
			});
		}
		,
		//---------------------------------------------------------------------
		voiceSideHeight: function()
		{
			$('div#sideBox.voice').each(function()
			{
				var h = $(this).height() + 15;
				var conH = $('div#mainCon').height();
				if(h > conH){
					$('div#mainCon').css('height', h);
				}
				//$(this).find('dl.clearfix').jScrollPane({scrollbarWidth:7, scrollbarMargin:13});
			});
		}
		,
		//---------------------------------------------------------------------
		collection_price: function(priceNum, num)
		{
			var box = $('span#price' + num);
			$(box).text(priceNum);
		}
	//-----------------------------------------------------------------
	};
//---------------------------------------------------------------------
})(jQuery);
