(function($) {
	$(function() {
		var _UA = navigator.userAgent;
		var _asAndroid  = (_UA.indexOf('Android') > -1)? true:false;
		var _asiPhone   = (_UA.indexOf('iPhone') > -1)? true:false;
		var _asiPad     = (_UA.indexOf('iPod') > -1)? true:false;

//==============================================
// iPhone/iPad
//==============================================

//navigator
		if (_asiPhone || _asiPad) {
			//$('head link[href$="_pc.css"]').remove();
			//$('head').append('<link rel="stylesheet" href="/shared/css/iphone.css"><link rel="stylesheet" href="/shared/css/base_smartphone.css"><link rel="stylesheet" href="/shared/css/module_smartphone.css">');
//oepn/close
			var $slidebtn = $('.toggleBtn');
			$slidebtn.click(function(){
				var $slidepane = $(this).parent().next();
				$slidepane.slideToggle(180);
				if($slidepane.hasClass('close')){
					$slidepane.removeClass('close');
					$(this).html('<img src="/shared/img/module/btn_close.png" width="63" height="26" alt="閉じる">');
				} else {
					$slidepane.addClass('close');
					$(this).html('<img src="/shared/img/module/btn_open.png" width="63" height="26" alt="開く">');
				};
			});
//table
			$('#spec table col').remove();
			$('#products table col').remove();
//biggerlink
			$('.biggerlinkSmart').biggerlink();
//colorbox
			$('.colorbox').click(function(){
				window.open(this.href, '_blank');
				return false;
			});
		} else if (_asAndroid) {

//==============================================
// Android
//==============================================

			//$('head link[href$="_pc.css"]').remove();
			//$('head').append('<link rel="stylesheet" href="/shared/css/base_smartphone.css"><link rel="stylesheet" href="/shared/css/module_smartphone.css">');
			//window.addEventListener("resize", setContentsWidth, false);
			//setContentsWidth();
			//function setContentsWidth(){
			//	var setScreenWidth = $(window).width();
			//	var zoomParcent = Math.ceil((setScreenWidth/320)*100);
			//	$('html').css('zoom',zoomParcent + '%');
			//	return false;
			//}
//oepn/close
			var $slidebtn = $('.toggleBtn');
			$slidebtn.click(function(){
				var $slidepane = $(this).parent().next();
				$slidepane.slideToggle(180);
				if($slidepane.hasClass('close')){
					$slidepane.removeClass('close');
					$(this).html('<img src="/shared/img/module/btn_close.png" width="63" height="26" alt="閉じる">');
				} else {
					$slidepane.addClass('close');
					$(this).html('<img src="/shared/img/module/btn_open.png" width="63" height="26" alt="開く">');
				};
			});
//table
			$('#spec table col').remove();
			$('#products table col').remove();
//biggerlink
			$('.biggerlinkSmart').biggerlink();
//colorbox
			$('.colorbox').click(function(){
				window.open(this.href, '_blank');
				return false;
			});
		} else {

//==============================================
// PC
//==============================================

//rollover
			$('img.btnover').rollover('_over');
			$('.search input[type="image"]').rollover('_over');
//biggerlink
			$('.biggerlink').biggerlink();
//colorbox
			$('a.colorbox').colorbox();
//addClass
			$('.unitIndex .unit:nth-child(odd)').addClass('odd');
			$('.unitIndex .unit:nth-child(even)').addClass('even');
//removeClass
			$('#refineSearch').removeClass('jsOff');
			$('#products .backToTOC').removeClass('jsOff');
//autoHeight
			$('.unitIndex .unit').autoHeight({column:2});
			$('.unitIndex3 .unit').autoHeight({column:3});
		}
	});
})(jQuery);

