var AV  = navigator.appVersion.toLowerCase() ;
var UA  = navigator.userAgent.toLowerCase() ;

if( ( AV.indexOf("windows") != -1 ) && ( UA.indexOf("msie") != -1 ) ){
	var ieversion = AV.match(/msie (\d)/) ;
	ieversion = RegExp.$1 ;
	if(ieversion == 6){
		try{ document.execCommand("BackgroundImageCache",false,true) ;}catch(e){} ;
	}
}
if( AV.indexOf("macintosh") != -1 ){
	document.write('<link rel="stylesheet" type="text\/css" href="\/css\/mac.css" \/>');
}

// 検索ボックス
function searchFocus(){
	document.getElementById('search0').style.backgroundImage = 'none' ;
}
function searchBlur(){
	if( !document.getElementById('search0').value ){
		document.getElementById('search0').style.backgroundImage = 'url(/images/bg_input.gif)' ;
	}
}

//www.futomi.com.dom.event

var dom = new Object();
dom.event = new Object();

dom.event.addEventListener = function(elm, type, func, useCapture) {
  if(! elm) { return false; }
  if(! useCapture) {
    useCapture = false;
  }
  if(elm.addEventListener) {
    elm.addEventListener(type, func, false);
  } else if(elm.attachEvent) {
    elm.attachEvent('on'+type, func);
  } else {
    return false;
  }
  return true;
};


// OnLoad

dom.event.addEventListener( window, 'load', initDocument );

function initDocument(){
	if( document.getElementById('search0').value ){ searchFocus() ;}else{ searchBlur() ;}
	dom.event.addEventListener( document.getElementById('search0'), 'focus', searchFocus ) ;
	dom.event.addEventListener( document.getElementById('search0'), 'blur', searchBlur ) ;
}


var mailtoCheckBrowser = ( UA.indexOf("msie") != -1 )? 0 : 1 ;

//総合お問い合わせタイトル
var encAllSubjectUTF8 = '?subject=%E7%B7%8F%E5%90%88%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B' ;
var encAllSubjectSJIS = '?subject=%91%8D%8D%87%82%A8%96%E2%82%A2%8D%87%82%ED%82%B9' ;

//総合お問い合わせbody
var encComBodyUTF8 = '&amp;body=%E4%B8%8B%E8%A8%98%E9%A0%85%E7%9B%AE%E3%81%AB%E5%BF%85%E8%A6%81%E4%BA%8B%E9%A0%85%E3%82%92%E5%85%A5%E5%8A%9B%E3%81%97%E3%80%81%E9%80%81%E4%BF%A1%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%0D%0A%0D%0A%E3%81%8A%E5%90%8D%E5%89%8D%E3%80%80%E3%80%80%EF%BC%9A%0D%0A%E3%81%B5%E3%82%8A%E3%81%8C%E3%81%AA%E3%80%80%EF%BC%9A%0D%0A%E4%BC%9A%E7%A4%BE%E5%90%8D%E3%80%80%E3%80%80%EF%BC%9A%0D%0A%E9%83%A8%E7%BD%B2%E5%90%8D%E3%80%80%E3%80%80%EF%BC%9A%0D%0A%E9%83%B5%E4%BE%BF%E7%95%AA%E5%8F%B7%E3%80%80%EF%BC%9A%0D%0A%E4%BD%8F%E6%89%80%E3%80%80%E3%80%80%E3%80%80%EF%BC%9A%0D%0A%E9%9B%BB%E8%A9%B1%E7%95%AA%E5%8F%B7%E3%80%80%EF%BC%9A%0D%0AFAX%E7%95%AA%E5%8F%B7%E3%80%80%20%EF%BC%9A%0D%0A%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%E5%86%85%E5%AE%B9%0D%0A%EF%BC%88%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%EF%BC%89' ;
var encComBodySJIS = '&amp;body=%89%BA%8BL%8D%80%96%DA%82%C9%95K%97v%8E%96%8D%80%82%F0%93%FC%97%CD%82%B5%81A%91%97%90M%82%B5%82%C4%82%AD%82%BE%82%B3%82%A2%81B%0D%0A%0D%0A%82%A8%96%BC%91O%81%40%81%40%81F%0D%0A%82%D3%82%E8%82%AA%82%C8%81%40%81F%0D%0A%89%EF%8E%D0%96%BC%81%40%81%40%81F%0D%0A%95%94%8F%90%96%BC%81%40%81%40%81F%0D%0A%97X%95%D6%94%D4%8D%86%81%40%81F%0D%0A%8FZ%8F%8A%81%40%81%40%81%40%81F%0D%0A%93d%98b%94%D4%8D%86%81%40%81F%0D%0AFAX%94%D4%8D%86%81%40%20%81F%0D%0A%82%A8%96%E2%82%A2%8D%87%82%ED%82%B9%93%E0%97e%0D%0A%81i%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%81j' ;

function mailtoAll(){
	if(mailtoCheckBrowser){
		document.write('<a href="mailto:webinquiry@shinwatec.co.jp'+ encAllSubjectUTF8+encComBodyUTF8 +'"><img src="/images/head-navi3.gif" width="97" height="18" alt="総合お問い合わせ" /><\/a>');
	}else{
		document.write('<a href="mailto:webinquiry@shinwatec.co.jp'+ encAllSubjectSJIS+encComBodySJIS +'"><img src="/images/head-navi3.gif" width="97" height="18" alt="総合お問い合わせ" /><\/a>');
	}
}
function mailtoTop(){
	if(mailtoCheckBrowser){
		document.write('<a href="mailto:webinquiry@shinwatec.co.jp'+ encAllSubjectUTF8+encComBodyUTF8 +'">　メールでのお問い合わせ<\/a><br \/><div id="InfoInq2Frame">各製品情報ページに個別の<br \/>問い合わせメールをご用意しております。<\/div>');
	}else{
		document.write('<a href="mailto:webinquiry@shinwatec.co.jp'+ encAllSubjectSJIS+encComBodySJIS +'">　メールでのお問い合わせ<\/a><br \/><div id="InfoInq2Frame">各製品情報ページに個別の<br \/>問い合わせメールをご用意しております。<\/div>');
	}
}
