//image_change(roll_over)
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function img_start(){
	img_change_2(l_img_1,0);img_change_2(l_img_2,1)
	img_change_2(l_img_3,2);img_change_2(l_img_4,3)
	if(cNum=="4"){img_change_2_0(l_img_4,3)
	}else if(cNum=="3"){img_change_2_0(l_img_3,2)
	}else if(cNum=="2"){img_change_2_0(l_img_2,1)
	}else{img_change_2_0(l_img_1,0)
	}
}

//go to page_top
function backToTop() {
	var bc = $.browser;
	if(bc.opera){
		return true;
	}else{
		var x1 = x2 = x3 = 0;
		var y1 = y2 = y3 = 0;
		if (document.documentElement) {
			x1 = document.documentElement.scrollLeft || 0;
			y1 = document.documentElement.scrollTop || 0;
		}
		if (document.body) {
			x2 = document.body.scrollLeft || 0;
			y2 = document.body.scrollTop || 0;
		}
		x3 = window.scrollX || 0;
		y3 = window.scrollY || 0;
		var x = Math.max(x1, Math.max(x2, x3));
		var y = Math.max(y1, Math.max(y2, y3));
		window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
		if (x > 0 || y > 0) {
			window.setTimeout("backToTop()", 20);
		}
	}
}
$(document).ready(function(){
	/*
	*menu_accordion(left_sidemenu(normal(hide) mouse_over(show)))
	*id=ac_set
	*id=ac_program
	*if you want menu to show always. you add class "open".
	*/
    $(document).pngFix();
	$("div#ac_program ul").hide();
	 if ( $("div#ac_program").hasClass("open") ){
		 $("div#ac_program ul").css("display","block");
	 }else{
	var flag = true
	var flag2 = true 
	$("#ac_set > li").hover(
		function () {
			flag = false
			if(flag2==true){
				flag2 = false
				MM_swapImage('program','','../common/image/top/btn_program_on.jpg',1);
				$(this).find('ul').eq(0).slideDown(200);
			}else{
				MM_swapImgRestore();
			}
		},
		function () {
			flag = true
			$(this).find('ul').eq(0).slideUp(200,function(){
				if(flag==true){
					MM_swapImgRestore();
				}
				flag2 = true
			});
		 }
	);
	}

	
	/*
	*accrodion
	*class"ac_btn"id"ac_target" is a pair.
	*you can use class"ac_btn" for <input> & <label>
	*/
	if($("input.ac_btn1").attr("checked")==false){
		$("#ac_target1").css("display","none");
	}
	if($("input.ac_btn2").attr("checked")==false){
		$("#ac_target2").css("display","none");
	}
	if($("input.ac_btn3").attr("checked")==false){
		$("#ac_target3").css("display","none");
	}
	if($("input.ac_btn4").attr("checked")==false){
		$("#ac_target4").css("display","none");
	}
	if($("input.ac_btn5").attr("checked")==false){
		$("#ac_target5").css("display","none");
	}
	if($("input.ac_btn6").attr("checked")==false){
		$("#ac_target7").css("display","none");
	}
	$(".ac_btn1").click(function(){
		$("#ac_target1").css("display","block");
		$("#ac_target2").css("display","none");
		$("#ac_target3").css("display","none");
		$("#ac_target4").css("display","none");
		$("#ac_target5").css("display","none");
		$("#ac_target6").css("display","none");
	})
	$(".ac_btn2").click(function(){
		$("#ac_target1").css("display","none");
		$("#ac_target2").css("display","block");
		$("#ac_target3").css("display","none");
		$("#ac_target4").css("display","none");
		$("#ac_target5").css("display","none");
		$("#ac_target6").css("display","none");
	})
	$(".ac_btn3").click(function(){
		$("#ac_target1").css("display","none");
		$("#ac_target2").css("display","none");
		$("#ac_target3").css("display","block");
		$("#ac_target4").css("display","none");
		$("#ac_target5").css("display","none");
		$("#ac_target6").css("display","none");
	});
	$(".ac_btn4").click(function(){
		$("#ac_target1").css("display","none");
		$("#ac_target2").css("display","none");
		$("#ac_target3").css("display","none");
		$("#ac_target4").css("display","block");
		$("#ac_target5").css("display","none");
		$("#ac_target6").css("display","none");
	});
	$(".ac_btn5").click(function(){
		$("#ac_target1").css("display","none");
		$("#ac_target2").css("display","none");
		$("#ac_target3").css("display","none");
		$("#ac_target4").css("display","none");
		$("#ac_target5").css("display","block");
		$("#ac_target6").css("display","none");
	});
	$(".ac_btn6").click(function(){
		$("#ac_target1").css("display","none");
		$("#ac_target2").css("display","none");
		$("#ac_target3").css("display","none");
		$("#ac_target4").css("display","none");
		$("#ac_target5").css("display","none");
		$("#ac_target6").css("display","block");
	});
	
	
	/*
	* click_area spread
	* if you enter the area, this make class add class"jhover"
	* and this get the <a>'s href. so if USER click in it , page change
	* if <a> is not only one.
	* you jump to first <a>'s href with clickin the area
	*/
	
	$(".book_area").hover(function(){
		if($(this).find("a").length != 0){
			$(this).addClass("jhover")
		}
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".beige_r").hover(function(){
								 if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								 }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".gray_r").hover(function(){
								if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								}
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".gray_r_new").hover(function(){
									if($(this).find("a").length != 0){
		$(this).addClass("jhover")
									}
	},function(){
		$(this).removeClass("jhover")
	})
	
	$(".rank_r").hover(function(){
								if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								}
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".linkbook").hover(function(){
								  if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								  }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".recommend").hover(function(){
								   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".recommend").hover(function(){
								   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".slidebox_1 li").hover(function(){
									   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
									   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".slidebox_2 li").hover(function(){
									   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
									   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".relation_book").hover(function(){
									   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
									   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".goods_area").hover(function(){
									if($(this).find("a").length != 0){
		$(this).addClass("jhover")
									}
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".gds_box").find("div").find("ul").find("li").hover(function(){
																   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
																   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".text_area").hover(function(){
								   if($(this).find("a").length != 0){
		$(this).addClass("jhover")
								   }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	$(".result_text").hover(function(){
									 if($(this).find("a").length != 0){
		$(this).addClass("jhover")
									 }
	},function(){
		$(this).removeClass("jhover")
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	});
	/*
	*page_scroll
	*firstly easing custamize.(easeOutQuint)
	*jscrl("button(you push)","id(jump)")
	*/
	$.easing.easeOutQuint = function (x, t, b, c, d) {
      	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	};
        
	//guide page
        var count = 0;
        $("#guide_li a").each(function()
        {
            with ({ count: ++count < 10 ? "0" + count : count })
            {
                $(this).click(function()
                {
                    var bc = $.browser;
                    if(bc.opera)
                    {
                        return true;
                    }
                    $.scrollTo($("#" + count), 400, { easing:'easeOutQuint' });
                    return false;
                });
            }
        });
        
        
	//contact page
        count = 0;
        $("#inq_list a").each(function()
        {
            with ({ count: ++count < 10 ? "0" + count : count })
            {
                $(this).click(function()
                {
                    var bc = $.browser;
                    if(bc.opera)
                    {
                        return true;
                    }
                    $.scrollTo($("#" + count), 400, { easing: 'easeOutQuint' });
                    return false;
                });
            }
        });
        
	//book page
        count = 0;
        $(".program_category a").each(function()
        {
            with ({ count: ++count < 10 ? "0" + count : count })
            {
                $(this).click(function()
                {
                    var bc = $.browser;
                    if(bc.opera)
                    {
                        return true;
                    }
                    $.scrollTo($("#" + count), 400, { easing: 'easeOutQuint' });
                    return false;
                });
            }
        });
	
	/*
	* kadomaru_hover(background change area、number order、mouseover);
	* and , div height is set same height which target parent <div>
	* if you click in the area , you jump to <a>'href
	*/
	
        if ($(".p_entry05_01").length > 0) {
            kadomaru_hover("p_entry05_01",0,"jhover05_0");kadomaru_hover("p_entry05_01",1,"jhover05_1");
            kadomaru_hover("p_entry05_01",2,"jhover05_2");kadomaru_hover("p_entry05_01",3,"jhover05_3");
            kadomaru_hover("p_entry05_01",4,"jhover05_4");
            kadomaru_hover("p_entry04_01",0,"jhover04_0");kadomaru_hover("p_entry04_01",1,"jhover04_1");
            kadomaru_hover("p_entry04_01",2,"jhover04_2");kadomaru_hover("p_entry04_01",3,"jhover04_3");
            kadomaru_hover("p_entry04_01",4,"jhover04_4");
            kadomaru_hover("p_entry03_01",0,"jhover03_0");kadomaru_hover("p_entry03_01",1,"jhover03_1");
            kadomaru_hover("p_entry03_01",2,"jhover03_2");kadomaru_hover("p_entry03_01",3,"jhover03_3");
            kadomaru_hover("p_entry03_01",4,"jhover03_4");
            kadomaru_hover("p_entry02_01",0,"jhover02_0");kadomaru_hover("p_entry02_01",1,"jhover02_1");
            kadomaru_hover("p_entry02_01",2,"jhover02_2");kadomaru_hover("p_entry02_01",3,"jhover02_3");
            kadomaru_hover("p_entry02_01",4,"jhover02_4");
            kadomaru_hover("p_entry01_01",0,"jhover01_0");kadomaru_hover("p_entry01_01",1,"jhover01_1");
            kadomaru_hover("p_entry01_01",2,"jhover01_2");kadomaru_hover("p_entry01_01",3,"jhover01_3");
            kadomaru_hover("p_entry01_01",4,"jhover01_4");
        }
	
	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		for(i = 0; i < $(".entry").length ; i++){
			$(".entry").eq(i).css("height",$(".entry").eq(i).parent("div").height()-7);
		}
	}else{
		for(i = 0; i < $(".entry").length ; i++){
			$(".entry").eq(i).css("min-height",$(".entry").eq(i).parent("div").height()-7);
		}
	}
	
	//this amke IE heavy.but i wanted to use.
	//setInterval( "bg_distance()", 10000 );
	
	$(".entry").css("cursor","pointer")
	$(".entry").click(function(){
		location.href = $(this).find("a").attr("href");
	});
	
	
	/*for ie6. you can use "position:fixed"*/
	$("#footer").css("height","auto");
	$('#pagetop_bar').exFixed();
	if (navigator.userAgent.indexOf("MSIE 6") > -1) {
	  $("#pagetop_bar").css("margin-top", "1px");
	}
   /*
   * always return button appear in buttom of window
   */
   	interval();
   $(window).scroll(function(){
		interval();
	});
   	setTimeout("interval()", 100 )
	setInterval( "interval()", 500 );
	$(window).resize(function(){
		interval();
	});
	
	/*
	* TAB
	* button make pair_zone show,and other_zone hide.
	*/
	$(".news_list:eq(1)").css("display","none");
	$(".news_list:eq(2)").css("display","none");
	$(".topic01").addClass("mover")
	$(".topic01").click(function(){
		$(".news_list:eq(0)").css("display","block");
		$(".news_list:eq(1)").css("display","none");
		$(".news_list:eq(2)").css("display","none");
		$(".mover").removeClass("mover")
		$(this).addClass("mover")
		return false;
	})
	$(".topic02").click(function(){
		$(".news_list:eq(0)").css("display","none");
		$(".news_list:eq(1)").css("display","block");
		$(".news_list:eq(2)").css("display","none");
		$(".mover").removeClass("mover")
		$(this).addClass("mover")
		return false;
	})
	$(".topic03").click(function(){
		$(".news_list:eq(0)").css("display","none");
		$(".news_list:eq(1)").css("display","none");
		$(".news_list:eq(2)").css("display","block");
		$(".mover").removeClass("mover")
		$(this).addClass("mover")
		return false
	})
	
	/*
	* firstly you need to prepare the tooltip in the html_document.
	* (you can make tool_tip in this JS.but FOR SEO, i make in the html_document)
	* mouseover:show
	* mousemove:position_change
	* mouseout:hide
	*/
	$("#book1").mouseover(function(){
		$("#tooltip1").css({opacity:1, display:"none"}).fadeIn(200);
	}).mousemove(function(){
		var left_pos;
		var top_pos;
		left_pos = $(this).offset().left-$("#tooltip1").outerWidth()+15;
		top_pos = $(this).offset().top+$(this).height()-104;
		$("#tooltip1").css({left:left_pos, top:top_pos});
	}).mouseout(function(){
		$("#tooltip1").css({left:"-9999px", display:"none"});
	});
	$("#book2").mouseover(function(){
		$("#tooltip2").css({opacity:1, display:"none"}).fadeIn(200);
	}).mousemove(function(){
		var left_pos;
		var top_pos;
		left_pos = $(this).offset().left-$("#tooltip2").outerWidth()+15;
		top_pos = $(this).offset().top+$(this).height()-104;
		$("#tooltip2").css({left:left_pos, top:top_pos});
	}).mouseout(function(){
		$("#tooltip2").css({left:"-9999px", display:"none"});
	})
	$("#book3").mouseover(function(){
		$("#tooltip3").css({opacity:1, display:"none"}).fadeIn(200);
	}).mousemove(function(){
		var left_pos;
		var top_pos;
		left_pos = $(this).offset().left-$("#tooltip3").outerWidth()+15;
		top_pos = $(this).offset().top+$(this).height()-104;
		$("#tooltip3").css({left:left_pos, top:top_pos});
	}).mouseout(function(){
		$("#tooltip3").css({left:"-9999px", display:"none"});
	})
	$("#book4").mouseover(function(){
		$("#tooltip4").css({opacity:1, display:"none"}).fadeIn(200);
	}).mousemove(function(){
		var left_pos;
		var top_pos;
		left_pos = $(this).offset().left-$("#tooltip4").outerWidth()+15;
		top_pos = $(this).offset().top+$(this).height()-104;
		$("#tooltip4").css({left:left_pos, top:top_pos});
	}).mouseout(function(){
		$("#tooltip4").css({left:"-9999px", display:"none"});
	})
	$("#book5").mouseover(function(){
		$("#tooltip5").css({opacity:1, display:"none"}).fadeIn(200);
	}).mousemove(function(){
		var left_pos;
		var top_pos;
		left_pos = $(this).offset().left-$("#tooltip5").outerWidth()+15;
		top_pos = $(this).offset().top+$(this).height()-104;
		$("#tooltip5").css({left:left_pos, top:top_pos});
	}).mouseout(function(){
		$("#tooltip5").css({left:"-9999px", display:"none"});
	})
	
	/*
	* Firstly all close
	* if you click button, this make all close,and the target show
	*/
	
	/*faqの数を設定してください。var length = 20;←faqの数
	*/	
	$(".answer_box01").css("display","none");
	var length = 20;
	for (var i = 0; i < length; i++) {
		ac_tws(i);
	}
	
	$("#pagetop2").css("display","none")
	$("#pagetop1").mouseover(function(){
		$("#pagetop1").css("display","none");
		$("#pagetop2").css("display","block")
	});
	$("#pagetop2").mouseout(function(){
		$("#pagetop1").css("display","block");
		$("#pagetop2").css("display","none")						
	});
	newindow(".g_navi05 a")
	newindow(".hnavi01 a");
	newindow(".popup_faq:eq(0)");
	newindow(".popup_faq:eq(1)");
	newindow(".popup_faq:eq(2)");
	newindow(".popup_faq:eq(3)");
	newindow(".popup_faq:eq(4)");
	newindow(".popup_faq:eq(5)");
	newindow(".popup_faq:eq(6)");
	newindow(".popup_faq:eq(7)");
	newindow(".popup_faq:eq(8)");
	newindow(".guide_navi02 a:eq(0)");
	newindow(".guide_navi02 a:eq(1)");
	newindow(".guide_navi02 a:eq(2)");
	newindow(".guide_navi02 a:eq(3)");
	newindow(".guide_navi02 a:eq(4)");
	newindow(".guide_navi02 a:eq(5)");
	newindow(".guide_navi02 a:eq(6)");
	newindow(".guide_navi02 a:eq(7)");
	newindow(".guide_navi02 a:eq(8)");
	/*newindow(".tnavi02 a")*/
	
	var n1 = $(".slidebox_1").length;
	
	if(n1!=0){
		jrollover(".slidebox_1:eq(0) .next","../common/image/product/right_on.jpg","../common/image/product/right.jpg")
		jrollover(".slidebox_1:eq(0) .prev","../common/image/product/left_on.jpg","../common/image/product/left.jpg")
		jrollover(".slidebox_1:eq(1) .next","../common/image/product/right_on.jpg","../common/image/product/right.jpg")
		jrollover(".slidebox_1:eq(1) .prev","../common/image/product/left_on.jpg","../common/image/product/left.jpg")
		jrollover(".slidebox_1:eq(2) .next","../common/image/product/right_on.jpg","../common/image/product/right.jpg")
		jrollover(".slidebox_1:eq(2) .prev","../common/image/product/left_on.jpg","../common/image/product/left.jpg")
	}
	var n2 = $(".slidebox_2").length;
	if(n2!=0){
		jrollover(".slidebox_2:eq(0) .next","../common/image/product/right_on.jpg","../common/image/product/right.jpg")
		jrollover(".slidebox_2:eq(0) .prev","../common/image/product/left_on.jpg","../common/image/product/left.jpg")
		jrollover(".slidebox_2:eq(1) .next","../common/image/product/right_on.jpg","../common/image/product/right.jpg")
		jrollover(".slidebox_2:eq(1) .prev","../common/image/product/left_on.jpg","../common/image/product/left.jpg")
		jrollover(".slidebox_2:eq(2) .next","../common/image/product/right_on.jpg","../common/image/product/right.jpg")
		jrollover(".slidebox_2:eq(2) .prev","../common/image/product/left_on.jpg","../common/image/product/left.jpg")
	}
});

//new window open
function newindow(id){
	$(id).click(function(){
		var url_nw = $(id).attr("href");
		nw_loc =  window.open(url_nw, 'guide_page', 'width=575, height=530, menubar=no, toolbar=no, scrollbars=yes');
		return false
	})
}

function newindow2(id,anc){
	$(id).click(function(){
		var url_nw = $(id).attr("href")+anc;
		alert(url_nw)
		nw_loc =  window.open(url_nw, 'guide_page', 'width=575, height=530, menubar=no, toolbar=no, scrollbars=yes');
		return false
	})
}


/*
* rollover
*/
function jrollover(obj,url,url2){
	var image = new Image();
	image.src = url;
	$(obj).hover(function(){
		$(obj).attr("src",image.src);
	},function(){
		$(obj).attr("src",url2);
	})
}

/*
* prepare to image change
* this laod on html_document_load
*/
function img_change(url,num,link_to,label_limited){
	
	var image = new Image();
	image.src = url;
	
	if(label_limited == "on"){
		$("#thumbnail").find("li").eq(num).click(function(){
			$("#limited").css("left","0");
			$(".detail_l").find("h4").find("img").attr("src",image.src);
			$("#btn_zoom").find("a").attr("href",link_to)
			return false;
		})
	}else{
		$("#thumbnail").find("li").eq(num).click(function(){
			$("#limited").css("left","-9999px");
			$(".detail_l").find("h4").find("img").attr("src",image.src);
			$("#btn_zoom").find("a").attr("href",link_to)
			return false;
		})
	}
}


function ac_tws(num){
	$(".faq_list").eq(num).click(function(){
		if($(".answer_box01").eq(num).css("display")=="none"){
			$(".answer_box01").css("display","none");
		$(".answer_box01").eq(num).css("display","block");
		}else{
			$(".answer_box01").css("display","none");
		}
		return false;
	});
}
//page top return
function interval(){
		$("#container").css("width","auto")
		 if  ($('#pagetop_bar').offset().top<$('#pgtp').offset().top){
			$('#pagetop_bar').css("visibility","visible")
			$('#pgtp').css("visibility","hidden")
			$('#pagetop_bar').css("margin-bottom",0)
			
	   }else{
		   $('#pagetop_bar').css("visibility","hidden")
		   $('#pgtp').css("visibility","visible")
		   $('#pagetop_bar').css("margin-bottom",0)
	   }
		if (navigator.userAgent.indexOf("MSIE 6") > -1){
			$("#pagetop_bar").css("left",$("#pagetop").offset().left + 2);
		} else if (navigator.userAgent.indexOf("MSIE") > -1) {
		  $("#pagetop_bar").css("left", $("#pagetop").offset().left-$(this).scrollLeft() + 2);
		} else {
	   $("#pagetop_bar").css("left",$("#pagetop").offset().left-$(this).scrollLeft() + 3);
		}

}
//page scroll
function jscrl(btn,op){
	$(btn).click(function(){
		var bc = $.browser;
		if(bc.opera){
			return true;
		}
		$.scrollTo( $(op), 400, { easing:'easeOutQuint' } );
		return false;						
	});
}
//kadomaru zone
function kadomaru_hover(area,ordernum,classname){
	/*for(i = 0 ; i<10;i++){
		$("."+area).eq(i).find(".entry").eq(ordernum).hover(function(){
			$(this).addClass("jhover");
			$(this).parent("div").parent("div").parent("div").addClass(classname);
		},function(){
			$(this).removeClass("jhover");
			$(this).parent("div").parent("div").parent("div").removeClass(classname);
		})
	}*/
        $("."+area).each(function()
        {
            $(this).find(".entry").eq(ordernum).hover(function(){
                $(this).addClass("jhover");
                $(this).parent("div").parent("div").parent("div").addClass(classname);
            },function(){
                    $(this).removeClass("jhover");
                    $(this).parent("div").parent("div").parent("div").removeClass(classname);
            });
        });
}
$(function(){
    var $targetElement = '.wb';
    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)));
            }
        });
    }
});
function bg_distance(){
	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		for(i = 0; i < $(".entry").length ; i++){
			$(".entry").eq(i).css("height",$(".entry").eq(i).parent("div").height()-7);
		}
	}else{
		for(i = 0; i < $(".entry").length ; i++){
			$(".entry").eq(i).css("min-height",$(".entry").eq(i).parent("div").height()-7);
		}
	}
}

//allcheck
function allcheck(targetForm,flag){
  for(n=0;n<=targetForm.length-1;n++){
    if(targetForm.elements[n].type == "checkbox"){
      targetForm.elements[n].checked = flag;
    }
  }
}
