/*
 * js.js
 *
 * Copyright (c) 2007 Media Promotion Link
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Since:     2007-08-31
 */

/*----------------------------------------------------------------------------
スタートアップ
----------------------------------------------------------------------------*/
$(function(){

  //スムーズスクロール設定(jQuery)
  $('a[@href^="#"]').click(function(){$('#'+($(this).attr("href").split('#')[1])).ScrollTo(900,'easeout'); return false;});
  
  //title属性自動設定(jQuery)
  for(var i=0; i<$('img').length; i++)  {  $('img')[i].title = ($('img')[i].alt) ? $('img')[i].alt : "";  }

  //別ウィンドウ自動設定(jQuery)
  $('a[@href^="http://"]').click(function(){ window.open(this.href, '_blank');	return false; });

	//別ウィンドウ自動設定(jQuery)
  $('a[@href^="https://"]').click(function(){ window.open(this.href, '_blank');	return false; });

	//別ウィンドウ自動設定:class="externalLink"(jQuery)
  $('a[@class^="externalLink"]').click(function(){ window.open(this.href, '_blank');	return false; });

});

/*----------------------------------------------------------------------------
googleAnalytics
----------------------------------------------------------------------------*/

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23428332-6']);
  _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);
  })();
