/*　CSSハック用　*/
/* ----------------------------------------------------- */
var css_browser_selector = function() {
	var 
		ua=navigator.userAgent.toLowerCase(),
		is=function(t){ return ua.indexOf(t) != -1; },
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')? 'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();

/*　別ウインドウ　*/
/* ----------------------------------------------------- */

function new_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);
}


/*　jquery マウスオーバー（オン画像で表現する場合）　*/
/* ----------------------------------------------------- */

function rollOver(){
    var preLoad = new Object();
    $('img.imgOver,input.imgOver').not("[@src*='_on.']").each(function(){
        var imgSrc = this.src;
        var fType = imgSrc.substring(imgSrc.lastIndexOf('.'));
        var imgName = imgSrc.substr(0, imgSrc.lastIndexOf('.'));
        var imgOver = imgName + '_on' + fType;
        preLoad[this.src] = new Image();
        preLoad[this.src].src = imgOver;
        $(this).hover(
            function (){
                this.src = imgOver;
            },
            function (){
                this.src = imgSrc;
            }
        );
    });
}
$(document).ready(rollOver);


/*　jquery マウスオーバー（透過させて表現する場合）　*/
(function($) {
	
	$.fn.opOver = function(op,oa,durationp,durationa){
		
		var c = {
			op:op? op:1.0,
			oa:oa? oa:0.6,
			durationp:durationp? durationp:'fast',
			durationa:durationa? durationa:'fast'
		};
		

		$(this).each(function(){
			$(this).css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				}).hover(function(){
					$(this).fadeTo(c.durationp,c.oa);
				},function(){
					$(this).fadeTo(c.durationa,c.op);
				})
		});
	},
	
	$.fn.wink = function(durationp,op,oa){

		var c = {
			durationp:durationp? durationp:'slow',
			op:op? op:1.0,
			oa:oa? oa:0.2
		};
		
		$(this).each(function(){
			$(this)	.css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				}).hover(function(){
				$(this).css({
					opacity: c.oa,
					filter: "alpha(opacity="+c.oa*100+")"
				});
				$(this).fadeTo(c.durationp,c.op);
			},function(){
				$(this).css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				});
			})
		});
	}
	
})(jQuery);

(function($) {
	$(function() {
	$('.jqOver').opOver();
	$('.jqWink').wink();
	});
})(jQuery);


         $(function(){
            /* ID名がtabMenuのul要素内にあるすべてのli要素を取得 */
            $('#tabMenu > li').click(function(){
               /* すべてのli要素からselectedクラスを削除 */
               $('#tabMenu > li').removeClass('selected');
               /* 現在のli要素にselectedクラスを追加 */
               $(this).addClass('selected');
               /* tabMenuBodyクラス内のすべてのdiv要素を非表示にする */
               $('.tabMenuBody div').slideUp('1500');
               /* ナビゲーションのul要素のインデックスに従って、tabMenuBody内で右のdiv要素を探す */
               $('.tabMenuBody div:eq(' + $('#tabMenu > li').index(this) + ')').slideDown('1500');
            }).mouseover(function() {
               /* クラスの追加・削除 */
               $(this).addClass('mouseover');
               $(this).removeClass('mouseout');
            }).mouseout(function() {
               /* クラスの追加・削除 */
               $(this).addClass('mouseout');
               $(this).removeClass('mouseover');
            });
            /* bookmarkのli要素の場合は、マウスオーバー時にアニメーション効果を付ける 
            $('.tabMenuBody #bookmark li').click(function(){
                  //Get the Anchor tag href under the LI
                  window.location = $(this).find("a").attr("href");
               }).mouseover(function() {
                  //Change background color and animate the padding
                  $(this).css('backgroundColor','#888');
                  $(this).children().animate({paddingLeft:"20px"}, {queue:false, duration:300});
               }).mouseout(function() {
                  //Change background color and animate the padding
                  $(this).css('backgroundColor','');
                  $(this).children().animate({paddingLeft:"0"}, {queue:false, duration:300});
            }); */
            /* li要素にマウスオーバー効果を付ける 
            $('.tabMenuBody li').click(function(){
               window.location = $(this).find("a").attr("href");
               }).mouseover(function() {
                  $(this).css('backgroundColor','#888');
               }).mouseout(function() {
                  $(this).css('backgroundColor','');
            });*/
         });

