﻿//slide
$(function(){
$('a.next').click(function(){
var pass = $(this).attr("href");
$('#outer2').animate({marginLeft:$(window).width() + 'px',opacity:'0'},500,function(){
location.href = pass;
});
return false;
});

$('a.prev').click(function(){
var pass = $(this).attr("href");
$('#outer2').animate({marginLeft:'-=' + $(window).width() + 'px',opacity:'0'},500,function(){
location.href = pass;
});
return false;
});
});


//chenge
$(function(){
$(".main").click(function(){
$("#pic").attr("href",$(this).attr("href")+"b.jpg");
$("#pic2").fadeOut(0);
$("#pic2").attr("src",$(this).attr("href")+".jpg");
$("#pic2").fadeIn(250);
return false;
});
});



//up
$(function(){
$(".outer1 img").hover(function(){
$(this).addClass("hover");
$("strong").show();
},function(){
$(this).removeClass("hover");
$("strong").hide();
})
})


//top
$(function () {
$('a[href*=#top]').click(function () {
$(this).blur();
$('html,body').animate({ scrollTop: 0 }, 'slow');
return false;
});
});


//zoom
$(function() {
$(".jqzoom").jqzoom();
});


$(document).ready(function() {
	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#portfolio li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});

$(document).ready(function() {
	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#portfolio2 li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#portfolio2 li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});

$(document).ready(function() {
	$('ul#filter area').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#portfolio3 li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#portfolio3 li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});



//change
$(document).ready(function(){
$('.galleryImage1').hover(
function(){
$(this).find('img').animate({width:50, marginTop:4, marginLeft:4}, 500);		   
},
function(){	 
$(this).find('img').animate({width:208, marginTop:0, marginLeft:0},300);			 
});
});

$(document).ready(function(){
$('.galleryImage2').hover(
function(){
$(this).find('img').animate({width:50, marginTop:4, marginLeft:4}, 500);		   
},
function(){	 
$(this).find('img').animate({width:208, marginTop:0, marginLeft:0},300);			 
});
});

$(document).ready(function(){
$('.galleryImage3').hover(
function(){
$(this).find('img').animate({width:50, marginTop:4, marginLeft:4}, 500);		   
},
function(){	 
$(this).find('img').animate({width:208, marginTop:0, marginLeft:0},300);			 
});
});

$(document).ready(function(){
$('.galleryImage4').hover(
function(){
$(this).find('img').animate({width:50, marginTop:4, marginLeft:4}, 500);		   
},
function(){	 
$(this).find('img').animate({width:208, marginTop:0, marginLeft:0},300);			 
});
});

//pop up
$(function() {
$(".popp").click(function(){
window.open(this.href, "WindowName","width=960,height=600,resizable=yes,scrollbars=yes");
return false;
});
});

//pop up
$(function() {
$(".popp2").click(function(){
window.open(this.href, "WindowName","width=965,height=575,resizable=no,scrollbars=no");
return false;
});
});

//pop up 3d
$(function() {
$(".popp3").click(function(){
window.open(this.href, "WindowName","width=460,height=380,resizable=no,scrollbars=no");
return false;
});
});


/* 自動単語リンクプラグイン for jQuery
2009.1 By KaZuhiro FuRuhata  */
$.fn.addlink = function(baseURL){
var dict = [
"アルミニウム", "http://ja.wikipedia.org/wiki/アルミニウム",
"アルマイト","http://ja.wikipedia.org/wiki/アルマイト",
"麻","http://ja.wikipedia.org/wiki/麻 (繊維)",
"アクリル","http://ja.wikipedia.org/wiki/アクリル樹脂",
"ウレタン系樹脂","http://ja.wikipedia.org/wiki/ウレタン樹脂系接着剤",
"ABS樹脂", "http://ja.wikipedia.org/wiki/ABS樹脂",
"ASA樹脂", "http://ja.wikipedia.org/wiki/ABS樹脂",
"AES樹脂", "http://ja.wikipedia.org/wiki/ABS樹脂",
"鋳物", "http://ja.wikipedia.org/wiki/鋳物",
"エキスパンドメタル", "http://ja.wikipedia.org/wiki/エキスパンドメタル",
"塩化ベンザルコニウム", "http://ja.wikipedia.org/wiki/塩化ベンザルコニウム",
"エチレン酢酸ビニール", "http://ja.wikipedia.org/wiki/酢酸ビニル",
"塩化ビニール", "http://ja.wikipedia.org/wiki/塩化ビニル",
"エラストマー", "http://ja.wikipedia.org/wiki/エラストマー",
"強化プラスチック", "http://ja.wikipedia.org/wiki/繊維強化プラスチック",
"ガリバリウム", "http://ja.wikipedia.org/wiki/ガルバリウム",
"鋼板", "http://ja.wikipedia.org/wiki/鋼板",
"ゴム", "http://ja.wikipedia.org/wiki/ゴム",
"集成木材", "http://ja.wikipedia.org/wiki/集成材",
"SBR", "http://ja.wikipedia.org/wiki/スチレン・ブタジエンゴム",
"スチール", "http://ja.wikipedia.org/wiki/スチール",
"真鍮", "http://ja.wikipedia.org/wiki/真鍮",
"ステンレス", "http://ja.wikipedia.org/wiki/ステンレス",
"ヘアライン", "http://ja.wikipedia.org/wiki/ステンレス",
"ダイキャスト", "http://ja.wikipedia.org/wiki/ダイカスト",
"ダンボール", "http://ja.wikipedia.org/wiki/段ボール",
"籐", "http://ja.wikipedia.org/wiki/トウ",
"トタン","http://ja.wikipedia.org/wiki/亜鉛めっき鋼板",
"ボンデ鋼板", "http://ja.wikipedia.org/wiki/亜鉛めっき鋼板",
"熱可塑性エラストマー", "http://ja.wikipedia.org/wiki/熱可塑性エラストマー",
"塗装", "http://ja.wikipedia.org/wiki/塗装",
"ナイロン", "http://ja.wikipedia.org/wiki/ナイロン",
"NBR", "http://ja.wikipedia.org/wiki/ニトリルゴム",
"PET樹脂", "http://ja.wikipedia.org/wiki/PET樹脂",
"ブリキ", "http://ja.wikipedia.org/wiki/ブリキ",
"ハニカム構造", "http://ja.wikipedia.org/wiki/ハニカム構造",
"パンチングメタル", "http://ja.wikipedia.org/wiki/金網",
"BA", "http://ja.wikipedia.org/wiki/ステンレス",
"ポリブチレンテレフタレート", "http://ja.wikipedia.org/wiki/ポリブチレンテレフタレート",
"ポリカーボネート", "http://ja.wikipedia.org/wiki/ポリカーボネート",
"ポリウレタン", "http://ja.wikipedia.org/wiki/ポリウレタン",
"ポリスチレン", "http://ja.wikipedia.org/wiki/ポリスチレン",
"ポリプロピレン", "http://ja.wikipedia.org/wiki/ポリプロピレン",
"ポリエチレン", "http://ja.wikipedia.org/wiki/ポリエチレン",
"ポリエステル", "http://ja.wikipedia.org/wiki/ポリエステル",
"レーヨン", "http://ja.wikipedia.org/wiki/レーヨン",
"ヤシ", "http://ja.wikipedia.org/wiki/ヤシ",
"メッキ","http://ja.wikipedia.org/wiki/めっき" ];
return this.each(function(){
var srcText = this.innerHTML;
for (var i=0; i<dict.length; i+=2){
srcText = srcText.replace(new RegExp(dict[i]),"<a href='"+dict[i+1]+"' target='_blank'>"+dict[i]+"</a><img src='../../images/External.gif' width='16' height='16' alt='外部リンク' title='外部リンク' />");
}
this.innerHTML = srcText;
});
}




