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_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_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];}
}

function login() {
    document.forms[0].action='lgin.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function login2(lflg) {
    document.forms[0].lflg.value=lflg;
    document.forms[0].action='lginlink.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function login3(lbflg) {
    document.forms[0].lbflg.value=lbflg;
    document.forms[0].action='lginbrand.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function login4() {
    document.forms[0].action='s_lginend.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function reg() {
    document.forms[0].action='preent.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function regs() {
    document.forms[0].action='s_preentend.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function link1(aid) {
    document.forms[0].aid.value=aid;
    document.forms[0].method="post";
    document.forms[0].action='link.asp';
    document.forms[0].target = "_blank";
    document.forms[0].submit();
}

function link11(aid) {
    document.frmAdvDetail.aid.value=aid;
    document.frmAdvDetail.method="post";
    document.frmAdvDetail.action='link.asp';
    document.frmAdvDetail.target = "_blank";
    document.frmAdvDetail.submit();
}

function link2(aid) {
    document.forms[0].aid.value=aid;
    document.forms[0].method="post";
    document.forms[0].action='link.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function link21(aid) {
    document.frmAdvDetail.aid.value=aid;
    document.frmAdvDetail.method="post";
    document.frmAdvDetail.action='link.asp';
    document.frmAdvDetail.target = "_self";
    document.frmAdvDetail.submit();
}

function link3(aid) {
    document.forms[0].aid.value=aid;
    document.forms[0].method="post";
    document.forms[0].action='dirlink.asp';
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function search(srt,cat,pag) {
    document.forms[0].srt.value=srt;
    document.forms[0].cat.value=cat;
    document.forms[0].pag.value=pag;
    document.forms[0].method="post";
    document.forms[0].action="yenlist.asp";
    document.forms[0].target = "_self";
    document.forms[0].submit();
}

function search1(srt,cat,pag) {
    document.frmSearch.srt.value=srt;
    document.frmSearch.cat.value=cat;
    document.frmSearch.pag.value=pag;
    document.frmSearch.method="post";
    document.frmSearch.action="yenlist.asp";
    document.frmSearch.target = "_self";
    document.frmSearch.submit();
}

function advdetail(aid)
{
    document.forms[0].aid.value=aid;
    document.forms[0].method="post";
    document.forms[0].action="detail.asp";
    document.forms[0].target = "_blank";
    document.forms[0].submit();
}

function advdetail1(aid)
{
    document.frmAdvDetail.aid.value=aid;
    document.frmAdvDetail.method="post";
    document.frmAdvDetail.action="detail.asp";
    document.frmAdvDetail.target = "_blank";
    document.frmAdvDetail.submit();
}

function clickpt(aid,sid)
{
    document.forms[0].aid.value=aid;
    document.forms[0].sid.value=sid;
    document.forms[0].method="post";
    document.forms[0].action="clkupd.asp";
    document.forms[0].target = "_blank";
    document.forms[0].submit();
}

function clickpt1(aid,sid)
{
    document.frmGClick.aid.value=aid;
    document.frmGClick.sid.value=sid;
    document.frmGClick.method="post";
    document.frmGClick.action="clkupd2.asp";
    document.frmGClick.target = "_blank";
    document.frmGClick.submit();
}

function chkYhSearchInp(frmyhsearch){
	if(frmyhsearch.Keywords.value.length==0) {
		alert('検索キーワードを入力してください。');
		return false;
	}
	return true;
}

function getLength(StrValue){
    var IntLoop;
    var IntCnt;

    IntCnt = 0;
    for(IntLoop = 0; IntLoop < StrValue.length; IntLoop++) {
        if(escape(StrValue.charAt(IntLoop)).length >= 4) {
            if(checkHanKana(StrValue)==false) {
                IntCnt++;
            }else {
                IntCnt += 2;
            }
        }else {
            IntCnt++;
        }
    }
    return IntCnt;
}

function checkHanKana(StrValue){
    var IntLoop;
    var StrTemp;
    var strKana;

    strKana = 'ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮ､｡｢｣ﾞﾟ'

    for(IntLoop = 0; IntLoop < StrValue.length; IntLoop++) {
        StrTemp = StrValue.charAt(IntLoop);
        if(strKana.indexOf(StrTemp)!=-1) {
            return false;
        }
    }
    return true;
}


