
// menu_button script
function menu_switch(){
	menu_buttons= $(".menu_button");
	jQuery.each(menu_buttons,function(){
		var name_length=$(this).attr('src').length;
		var imgext =$(this).attr('src').substr(name_length-3,3);
		if($(this).attr('src').substr(name_length-7,3)=='off'){
			$(this).mouseover(function(){
		    	img_on=$(this).attr('src').substr(0,name_length-7)+"on."+imgext;
        		$(this).attr("src",img_on);
         	});
 			$(this).mouseout(function(){
            	img_off=$(this).attr('src').substr(0,name_length-7)+"off."+imgext;
            	$(this).attr("src",img_off);
            });
		}
	});
}
// menu_button script end

// hover de slide
function banner_slide(){
	slide_banners= $(".slide_banner");
	jQuery.each(slide_banners,function(){
		$(this).hover(
			function(){
				$(".change",this).animate({top:"-60px"},1000);
				$("img",this).animate({opacity:"0"},500);
				$("p",this).animate({opacity:"100"},500);
			},
			function(){
				$(".change",this).animate({top:"0px"},1000);
				$("p",this).animate({opacity:"0"},500);
				$("img",this).animate({opacity:"100"},1000);
			}
		)
	});
}
//end

// hover de slide for 3 column
function banner_slide_l(){
	slide_banners= $(".slide_banner");
	jQuery.each(slide_banners,function(){
		$(this).hover(
			function(){
				$(".change_l",this).animate({top:"-60px"},1000);
				$("img",this).animate({opacity:"0"},500);
				$("p",this).animate({opacity:"100"},500);
			},
			function(){
				$(".change_l",this).animate({top:"0px"},1000);
				$("p",this).animate({opacity:"0"},500);
				$("img",this).animate({opacity:"100"},1000);
			}
		)
	});
}
//end





// select de URL jump
function moveUrl(selection){
var url=selection[selection.selectedIndex].value;
if(url!=""){
location.href=url;
}
}
// end

//Slide flow
function slide_flow(i){
slides=$(".slideshow");
var s=slides.length-1;
var j=i+1;
if(i<=s){j=i+1;}else{j=1;}
var out_slide="#slide"+ i ;
var in_slide="#slide"+ j ;
$(out_slide).fadeOut(2000);
$(in_slide).fadeIn(2000);
setTimeout(function(){
if(i<=s){i=i+1;}else{i=1;}
slide_flow(i);},4000);
}
// end


// Click de Window Open
// Register
url = 'https://www.hyas.co.jp/view/register.php';
function form_regi_open() {
window.open(url, 'HyASViewRegister', 'width=640, height=800, menubar=no, toolbar=no, location=no, scrollbars=yes');
}
// Inquiry
url2 = 'https://www.hyas.co.jp/view/inquiry.php';
function form_inq_open() {
window.open(url2, 'HyASViewinquiry', 'width=640, height=800, menubar=no, toolbar=no, location=no, scrollbars=yes');
}



