//------------------------------------------------------------
//マウスオーバー
//------------------------------------------------------------

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];}
}




//------------------------------------------------------------
//マウスオーバー2
//------------------------------------------------------------



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_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_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 sobre(src,Color) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.background = img;}}
function fuera(src,Color2) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.background = img2;}}
function pulsar(src) {
if(event.srcElement.tagName=='TD','TR'){
src.children.tags('A')[0].click();}
}








//------------------------------------------------------------
//　　プルダウンメニュー
//------------------------------------------------------------




function menuLink(linkLoc)





//------------------------------------------------------------
//　　ブラウザ戻るボタン
//------------------------------------------------------------


function pageBack(){
    history.back();
}




//------------------------------------------------------------
//　　トップに戻るボタン
//------------------------------------------------------------



function selectJunp(){
    listen=document.from1.s01.selectedIndex;
	url=document.from1.s01.options[listen].value;
	window.location=url;
	}





//------------------------------------------------------------
//　　文字検索
//------------------------------------------------------------
var shohinkey = '-> 商品検索：１つキーワードを入力';
var sitekey = '-> サイト内検索';

//キー押下時
window.document.onkeydown=onKeyDown;

//BackSpaceキー押下防止
function onKeyDown(e) {

    if (navigator.appName == "Microsoft Internet Explorer") {

        //ALT＋←ダメ
        if( event.keyCode == 0x25 && event.altKey == true ) {
            //alert("ALT＋←はダメ！");
            return false ;
        }
        //テキストボックス、パスワードボックスは許す
        for (i = 0; i < document.all.tags("INPUT").length; i++) {
            if (document.all.tags("INPUT")(i).name == window.event.srcElement.name &&
                (document.all.tags("INPUT")(i).type == "text" || document.all.tags("INPUT")(i).type == "password") &&
                 document.all.tags("INPUT")(i).readOnly == false){
                return true;
            }
        }
        //テキストエリアは許す
        for (i = 0; i < document.all.tags("TEXTAREA").length; i++) {
            if (document.all.tags("TEXTAREA")(i).name == window.event.srcElement.name &&
                document.all.tags("TEXTAREA")(i).readOnly == false){
                return true;
            }
        }
        //BackSpaceダメ
        if( event.keyCode == 8 ) {
            //alert("BackSpaseはダメ！");
            return false ;
        }
    } else {
        if (navigator.appName == "Netscape") {
            if (e.which == 8){
                return false;
            }
        }
    }
}

//検索文字列TRIM処理
function queryTrim(frm)
{
  var strTemp, strRet, strFinal;
  strTemp = frm.query.value;
  //LTRIM
  strRet = LTrim(strTemp);
  //RTRIM
  strFinal = RTrim(strRet);
  //結果
  frm.query.value = strFinal;

}

//RTRIM処理
function RTrim(strTemp)
{
  var nLoop = 0;
  var strReturn = strTemp;
  while (nLoop < strTemp.length){
    if ((strReturn.substring(strReturn.length - 1, strReturn.length) == " ") || (strReturn.substring(strReturn.length - 1, strReturn.length) == "　")){
      strReturn = strTemp.substring(0, strTemp.length - (nLoop + 1));
    }else{
      break;
    }
    nLoop++;
  }
    return strReturn;
}

//LTRIM処理
function LTrim(strTemp)
{
  var nLoop = 0;
  var strReturn = strTemp;
  while (nLoop < strTemp.length)
    {
      if ((strReturn.substring(0, 1) == " ") || (strReturn.substring(0, 1) == "　")){
	strReturn = strTemp.substring(nLoop + 1, strTemp.length);
      }else{
	break;
      }
      nLoop++;
    }
    return strReturn;
}

//テキストボックスのフォーカスイン処理
function setTxtFocus(frm) {
  if (frm.query.value == shohinkey || frm.query.value == sitekey){
    frm.query.value="";
  }
  //else{
  //  frm.query.select();
  //}
}

//ラジオボタンのフォーカスイン処理
function setRadFocus(frm, index) {
  //queryTrim(frm);

  if (frm.query.value == "" || frm.query.value == "　" || frm.query.value == shohinkey || frm.query.value == sitekey){
    if (index == 'seach'){
      frm.query.value=shohinkey;
    }else if(index == 'site') {
      frm.query.value=sitekey;
    }
  }else{
    document.execCommand('Unselect');
  }
}

//テキストボックスのロストフォーカス処理
function setBlur(frm) {
  var radchk;
  //queryTrim(frm);

  if (frm.query.value == "" || frm.query.value == "　" || frm.query.value == shohinkey || frm.query.value == sitekey){  
    if (frm.rad[0].checked){
      radchk =shohinkey;
    }else{
      radchk =sitekey;
    }
    frm.query.value=radchk;
  }

}

//サブミット処理
function doSubmit(frm){
  queryTrim(frm);

  var actvalue;
 
  //禁止文字が入力された場合、エラーウインドウを表示する

  actvalue ='/search/judgment.php';
  frm.action=actvalue;
  frm.method='POST';
  frm.target="main";
 
  if (frm.query.value != "" && frm.query.value != "　" && frm.query.value != shohinkey && frm.query.value != sitekey){
    var bkstr = frm.query.value;

    var errMsg = "入力された文字のなかに禁止文字が含まれています。";
    var strlen = frm.query.value.length;   
    var chkstr = frm.query.value;
    var chkWk = "";
    for (i=0;i<strlen;i++){
        chkWk= chkstr.substr(i,1);
        chkWk = escape(chkWk);
        if (chkWk == "%21" || chkWk == "%22" || chkWk == "%23" || chkWk == "%24" || 
            chkWk == "%25" || chkWk == "%26" || chkWk == "%27" || chkWk == "%5C" ){
                alert(errMsg);
                return;
        }
        else if (chkWk >= "%u2460" && chkWk <= "%u2473") {
                alert(errMsg);
                return;
        }
        else if (chkWk >= "%A1" && chkWk <= "%FF") {
                alert(errMsg);
                return;
        }
    }

    frm.query.value = "→"+ frm.query.value;
    frm.submit();
    frm.query.value = bkstr;
  }
  else if (frm.query.value == "" || frm.query.value == "　" || frm.query.value == shohinkey || frm.query.value == sitekey){
    setBlur(frm);
  }
}

//キーダウンイベント処理
function getKey(frm){
  //queryTrim(frm);
  if (frm.query.value == "" || frm.query.value == "　" || frm.query.value == shohinkey || frm.query.value == sitekey ){  
    return;
  }
  else if (event.keyCode == 8){    
    return;
  }
  else if (event.keyCode == 13){ 
   queryTrim(frm);
   doSubmit(frm);
  }
}









//------------------------------------------------------------
//リンクとび先【プロダクツ　＞＞　led-details1のページ】
//------------------------------------------------------------


function open_win1(){
window.open("led-details1.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=600");
}

function open_win2(){
window.open("led-details1.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=600");
}

function open_win3(){
window.open("led-details1.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=600");
}

function open_win4(){
window.open("led-details1.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=600");
}

function open_win5(){
window.open("led-details1.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=600");
}




function OpenWinled-details1(){
    winled-details1=window.open("led-details1.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=550");
}

function OpenWinled-details2(){
    winled-details2=window.open("led-details2.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=550");
}

function OpenWinled-details3(){
    winled-details3=window.open("led-details3.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=550");
}

function OpenWinled-details4(){
    winled-details4=window.open("led-details4.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=550");
}

function OpenWinled-details5(){
    winled-details5=window.open("led-details5.html","openwina","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=550");
}





















