/* ロールオーバー　必須　jquery.js　*/
function initRollOverImages() {
  var image_cache = new Object();
  $("img.swap").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '-o' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}

$(document).ready(initRollOverImages);


/* フォント拡大・縮小　*/

function fsc( COMMAND ){
	var font_size = document.body.style.fontSize;
	if(font_size == ""){
		size = 100;
	}else{
		size = eval(font_size.replace('%',''));
	}
	
	if( COMMAND == "larger") {
	size = size + 10 ;
	}else if( COMMAND == "small"){
	size = size - 10 ;
	}else{
	size = 100;
	}
	document.body.style.fontSize=size + "%";
}


/*新しいウィンドウを開く
param  url            開くURL
param  windowname     ウィンドウ名
param  width          ウィンドウの幅
param  height         ウィンドウの高さ
*/
function m_win(url,windowname,width,height) {
 var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,windowname,features);
}

/*google*/
var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-21578609-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);
  })();


