$(document).ready( function () {
	if ($.browser.name=='msie' && $.browser.versionX==6){
		
	}
	
$('a[href^="http://"],a[href^="https://{? $SERVER ?}"]').attr("target", "_blank");
$('.c_blank').attr("target", "_blank");

$('#categorygroup li strong a').parent().parent().prev("li").css('background','transparent url(/common/css/b3_a_green/images/categorygroup_sub_strongbg.png) 100% 0 no-repeat');
if($('#categorygroup ul li.second strong').length){

$('#categorygroup li.first a').hover(
  function () {
    $(this).css('background','#ce4a40 url(/common/css/b3_a_green/images/cp4_bg_over.png) 100% 0 no-repeat');
  },
  function () {
    $(this).css('background-color','#FFFFFF');
    $(this).css('background-image','none');
  });
}

if($('#categorygroup ul li.third strong').length){
$('#categorygroup li.second a').hover(
  function () {
    $(this).css('background','#4b7bb4 url(/common/css/b3_a_green/images/cp2_bg_over.png) 100% 0 no-repeat');
  },
  function () {
    $(this).css('background-color','#FFFFFF');
    $(this).css('background-image','none');
  });
}


//flash
$(".flash01").colorbox({href:"/flash_data/ocrepo01.html"});
$(".flash02").colorbox({href:"/flash_data/ocrepo02.html"});
$(".flash03").colorbox({href:"/flash_data/ocrepo03.html"});
$(".flash04").colorbox({href:"/flash_data/ocrepo04.html"});
$(".flash05").colorbox({href:"/flash_data/ocrepo05.html"});
$(".flash06").colorbox({href:"/flash_data/ocrepo06.html"});
$(".flash07").colorbox({href:"/flash_data/ocrepo07.html"});
$(".flash08").colorbox({href:"/flash_data/ocrepo08.html"});
$(".flash09").colorbox({href:"/flash_data/ocrepo09.html"});
$(".flash10").colorbox({href:"/flash_data/ocrepo10.html"});
$(".flash11").colorbox({href:"/flash_data/ocrepo11.html"});
$(".flash99").colorbox({href:"/flash_data/ousensai2010.html"});
$(".flash88").colorbox({href:"/flash_data/yumekagaku2010.html"});
$("a[rel='slide']").colorbox({slideshow:true, slideshowSpeed:4000});

initRollOverImages();
});

// ----------------------------------------------------------------------------
// Font Size Botton
// ----------------------------------------------------------------------------
jQuery(function($){
	function dispFontSizeBtn(){
		var sTmp = '';
		sTmp += '<span class="text"><img src="/common/css/b3_a_green/images/f-size-title.png" width="54" height="16" alt="文字サイズの変更" /></span>';
		sTmp += '<ul class="textresizer">';
		sTmp += '<li class="largeText"><a href="javascript:void(0);" tabindex="100">大</a></li>';
		sTmp += '<li class="mediumText"><a href="javascript:void(0);" tabindex="100">中</a></li>';
		sTmp += '<li class="smallText"><a href="javascript:void(0);" tabindex="100">小</a></li>';
		sTmp += '</ul>';
		$("#fontsize_change").html(sTmp);
	};
	dispFontSizeBtn();
});


// ----------------------------------------------------------------------------
// Font Size Switcher
// ----------------------------------------------------------------------------

jQuery(document).ready( function($) {
	jQuery( "ul.textresizer a" ).textresizer({
		target: "body",
		type: "cssClass",
		sizes: [
			"largeText",
			"mediumText",
			"smallText",
		],
		selectedIndex: 2
	});
});

// ----------------------------------------------------------------------------
// rollOver
// ----------------------------------------------------------------------------
function initRollOverImages() {
  var image_cache = new Object();
  $("img.rover").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + 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; });
  });
}

// ----------------------------------------------------------------------------
//  Full window
// ----------------------------------------------------------------------------

function fullwindow(furl){
	window.open(furl,"","fullscreen=yes,status=no,directories=no,menubar=no,toolbar=no");
}
