/************************************************
  
    Site Name: 
	Description: common script
	Version: 
	Author: 
	Last Modified :

************************************************/

/*google analytics*/

 var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24419429-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


/*include*/

$(function(){
		     
		   $('#header_inc').load('http://amarcord.jp/index.html #header');
		   $('#footer_inc').load('http://amarcord.jp/index.html #footer');
		   $('#header_en_inc').load('http://amarcord.jp/en/index.html #header');
		   $('#footer_en_inc').load('http://amarcord.jp/en/index.html #footer');
});

/*マウスオーバーで画像を変更*/
/*画像名の最後に、通常時の画像には「_off」を、マウスオーバー時の画像には「_on」を付けて保存
*/

$(function(){
     $('a img').hover(function(){
        $(this).attr('src', $(this).attr('src').replace('_off', '_on'));
          }, function(){
             if (!$(this).hasClass('currentPage')) {
             $(this).attr('src', $(this).attr('src').replace('_on', '_off'));
        }
   });
});

/*外部リンクを別タブで開く*/
/*<span><a href="<a class="linkclass" href="http://google.com">http://google.com</a>">Google検索</a>
</span>
*/

/*$(function(){
     $("a[href^='http://']").attr("target","_blank");
});
*/


/*ページトップへスクロールする*/
/*使い方
<p id="toTop"><a href="#wrapper">ページトップへ</a></p>
*/

$(function(){
     $(".pagetop a, #nav a").click(function(){
     $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'slow','swing');
     return false;
     })
});

/* index */
/* プルダウン */

$(function(){
$("#twitterLink").click(function(){
	if ($("#twitterArea").is(":hidden")){
		$("#twitterArea").slideDown("slow");
		$("#rssArea").slideUp("slow");
		$("#box3Area").slideUp("slow");
	}
	else{
		$("#twitterArea").slideUp("slow");
	}
});
$("#rssLink").click(function(){
	if ($("#rssArea").is(":hidden")){
		$("#rssArea").slideDown("slow");
		$("#twitterArea").slideUp("slow");
		$("#box3Area").slideUp("slow");
	}
	else{
		$("#rssArea").slideUp("slow");
	}
});
$("#box3Link").click(function(){
	if ($("#box3Area").is(":hidden")){
		$("#box3Area").slideDown("slow");
		$("#rssArea").slideUp("slow");
		$("#twitterArea").slideUp("slow");
	}
	else{
		$("#box3Area").slideUp("slow");
	}
});
});

/*access*/
/*google map*/

  function initialize() {
	
	//マップの中心
	var maplatlng = new google.maps.LatLng(35.692063, 139.708127);
	//お店の場所
    var latlng = new google.maps.LatLng(35.691063, 139.708127);

    var myOptions = {
      zoom: 17,
      center: maplatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
	
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

	var contentString =	
	'<div class="googlemap"><p class="googlemap_title">Gallery Bar AMARCORD</p>'+
	'<p>東京都 新宿区 新宿 2-18-7 S3ビル1F</p>'+
	'<p>TEL: (03)6457-7477</p>'+
	'<p>＊新宿三丁目駅C8出口より徒歩3分</p>'+
	'<p>＊新宿駅東口、または、東新宿より15分</p>'+
	'<p class="txtR"><a href="http://maps.google.co.jp/maps?f=q&amp;source=embed&amp;hl=ja&amp;geocode=&amp;q=%E6%9D%B1%E4%BA%AC%E9%83%BD+%E6%96%B0%E5%AE%BF%E5%8C%BA+%E6%96%B0%E5%AE%BF+2-18-7&amp;aq=&amp;sll=35.469302,139.619587&amp;sspn=0.009594,0.021136&amp;brcurrent=3,0x60188cdcc414c6a9:0x8821fbaa5100a0e,0,0x60188cdcc59a52cd:0x9b844fef282e14b&amp;ie=UTF8&amp;hq=&amp;hnear=%E6%9D%B1%E4%BA%AC%E9%83%BD%E6%96%B0%E5%AE%BF%E5%8C%BA%E6%96%B0%E5%AE%BF%EF%BC%92%E4%B8%81%E7%9B%AE%EF%BC%91%EF%BC%98%E2%88%92%EF%BC%97&amp;ll=35.691063,139.708127&amp;spn=0.002392,0.005284&amp;z=18" target="_blank">大きな地図で見る</a></p></div>'
	;

	var infowindow = new google.maps.InfoWindow({
		content: contentString
	});		
	
	var marker = new google.maps.Marker({
      position: latlng, 
      map: map, 
      title:"Gallery Bar AMARCORD",
	});   

	infowindow.open(map,marker);

  }

