/*  ================================================================================
menu Active
================================================================================  */
$(document).ready(function(){
var href = location.href.split('#')[0];
var href2 = href.replace(/\/\/(.*)\/(.*)\/(.*)\/(.*)\/(.*)/,'//$1/$2/$3/');
{
$('#sfGlobalNav ul li a,#sfLocalNav ul li a').each(function(){
if(href == this.href)$(this).parent().parent().addClass('active');
if(href == this.href)$(this).addClass('active');
if(href2 == this.href)$(this).parent().parent().addClass('active');
if(href2 == this.href)$(this).addClass('active');
});
}});



/*  ================================================================================
擬似クラスをクラスに
================================================================================  */
$(function(){
$("#sfHeader ul li:last-child").addClass("last-child");
$("#sfFooter ul li:last-child").addClass("last-child");
$(".detailsNav ul li:last-child").addClass("last-child");

//$("table.zebra tr:nth-child(even)").addClass("even");
//$("#article #topTopics dl dd:last-child,#article ul.pgAnchor li:last-child").addClass("last-child");
//$("#article table.owfcheckList tr:nth-child(even)").addClass("even");
//$("#article .bposProducts li:nth-child(even)").addClass("even");
//$("#article ul.exsvrProducts li:last-child").addClass("last-child");
//$("body :first-child").addClass("first-child");
//$("body :last-child").addClass("last-child");
//$("li:nth-child(even)").addClass("even");
//$("dt:even").addClass("even");
//$("dd:even").addClass("even");
//$("body :only-child").removeClass("first-child").removeClass("last-child");
//$("body :only-child").removeClass("last-child");
});

/*  ================================================================================
blank(JQ版）
================================================================================  */
$(document).ready( function () {
    $('.blank').click(function(){
        window.open(this.href, '_blank');
        return false;
    });
});

/*  ================================================================================
wordBreak
================================================================================  */

$(function(){
    var $targetElement = '.wordBreak';
    if($.browser.msie) {
        $($targetElement).css('word-break', 'break-all');
    } else {
        $($targetElement).each(function(){
            if(navigator.userAgent.indexOf('Firefox/2') != -1) {
                $(this).html($(this).text().split('').join('<wbr />'));
            } else {
                $(this).html($(this).text().split('').join(String.fromCharCode(8203)));
            }
        });
    }
});


/*  ================================================================================
IE クリックライン消
================================================================================  */
$(function(){$("a").focus(function(){ $(this).blur() })});

/*  ================================================================================
イメージロールオーバー
================================================================================  */
/* フィールター版　*/
$(document).ready(function(){
  $('.logout a,#breadcrumbs p a')
    .load(function(){
        $(this).animate({opacity: 0}, 'fast');
    })
	.mouseover(function(){
        $(this).animate({opacity: 0.4}, 'fast');
    })
    .mouseout(function(){
        $(this).animate({opacity: 1.0}, 'fast');
    });
});

/* スワップ版 */ 
jQuery.fn.rollover = function(suffix) {
	suffix = suffix || '_o';
	var check = new RegExp(suffix + '\\.\\w+$');
	return this.each(function() {
		var img = jQuery(this);
		var src = img.attr('src');
		if (check.test(src)) return;
		var _o = src.replace(/\.\w+/, suffix + '$&');
		jQuery('<img>').attr('src', _o);
		img.hover(
			function() { img.attr('src', _o); },
			function() { img.attr('src', src); }
		);
	});
};
jQuery(function($) {
	// 基本
	//$('#nav a img').rollover();

	// inputもいける
	$('form input:image').rollover();

	// 複数指定
	//$('#nav a img, form input:image').rollover();

	// 引数で _on の部分を指定できる
	//$('#nav a img').rollover('_over');
});



/*  ================================================================================
ポップアップ
================================================================================  */
window.onload = function (){
	var node_a = document.getElementsByTagName('a');
		for (var i in node_a) {
			if(node_a[i].className == 'popup'){
				node_a[i].onclick = function() {
					return winOpen(this.href, this.rel)
				};
			}
		}
} ;

function winOpen(url, rel) {
	var split = rel.split(',') ;
	window.open(
	url,'popup',
	'width='+ split[0] +',height='+ split[1] +',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');

	return false;
};

/*  ================================================================================
scroll easing 
================================================================================  */
$(document).ready(function(){
  $('a[href*=#]').click(function() {
 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
 && location.hostname == this.hostname) {
   var $target = $(this.hash);
   $target = $target.length && $target
   || $('[name=' + this.hash.slice(1) +']');
   if ($target.length) {
  var targetOffset = $target.offset().top;
  $('html,body')
  .animate({scrollTop: targetOffset}, 500);
    return false;
   }
 }
  });
});

/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))
$(document).ready(function(){ 
$(document).pngFix(); 
});
