//チェックボックスのクリア
function ChBoxClear(mtype,cmbData){
	for(var i=0; i<mtype.length; i++){
		mtype[i].checked = false;
	}
	SetcmbClear(cmbData);
}

//どのcheck boxにチェックが入っているか確認する−検索用（何もチェックがない時はクリア）
function OnChangeType2(m_type,cmbData){
	strTypeVal = new Array();
	m_len = m_type.length;
		for(var i=0;i<m_len;i++) {		
			if(m_type[i].checked){
				strTypeVal[i] = m_type[i].value;
				}
		}	 
	if(strTypeVal.length != 0){
	SetCmbFilter(aryKind,strTypeVal,cmbData);
	}else{
	SetcmbClear(cmbData);
	}	
}


//テキストエリアのクリア
function ClearCombo(cmb){
	for ( i = cmb.length - 1; i > 0; i-- ){
		cmb[i] = null;
	}
	cmb.length=0;
}


//検索用テキストエリアに挿入
function SetCmbFilter(aryValue,strFilter,cmbData){
	ClearCombo(cmbData);
	len=0;
	for ( i = 0 ; i < aryValue.length ; i++ ){
		for ( c = 0 ; c < strFilter.length ; c++ ){
			stDelimit = aryValue[i].split(",");
				if(stDelimit[0].indexOf(strFilter[c])==0){
					cmbData.options[len] = new Option("");
					cmbData.options[len].text  = stDelimit[1]; 
					cmbData.options[len].value = stDelimit[0];
					len++;
				}
		} 
		
	}
}



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 SetStyle3() {
var plats = navigator.platform;
var bName = navigator.appName.charAt(0);
var bVers = navigator.appVersion.charAt(0);
var bAgew = navigator.userAgent.substring(47,52);
var bAgem = navigator.userAgent.substring(51,56);
var bPath ="";
if(plats == "Win32"){
	if((bName == "N") && (bVers >= 4)){
		bPath = "style/wnc4";
	} if ((bName == "N") && (bVers >= 5)){
		bPath = "style/wnc6o";
	} if((bName == "M") && (bVers >= 4)){
		bPath = "style/wie";
	} else if ((bName == "O") || (bAgew == "Opera")){
		bPath = "style/wopera";
	}
} else if(plats == "MacPPC"){
	if((bName == "N") && (bVers >= 4)){
		bPath = "style/mnc4";
	} if((bName == "N") && (bVers >= 5)){
		bPath = "style/mnc6o";
	} if((bName == "M") && (bVers >= 4)) {
		bPath = "style/mie";
	} else if((bName == "O") || (bAgem == "Opera")){
		bPath = "style/mopera"
	}
}
if(bPath != ""){
	document.write('<link rel="stylesheet" type="text/css" href="../'+bPath+'.css">');
}
}

//コンボ内容を初期の状態に戻す
function SetcmbClear(cmbkind){
ClearCombo(cmbkind);
cmbkind.options[0] = new Option("タイプを左から選んでください");
cmbkind.options[0].value = ""
}


// コンボ内容をクリアする。
function ClearCombo(cmb){
	for ( i = cmb.length - 1; i > 0; i-- ){
		cmb[i] = null;
	}
	cmb.length=0;
}

//個別表示用 window open
function NWopen(url) {
	var wo;
	wo = window.open(url, 'IDView','width=600,height=650,status=no,directories=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes');
	wo.focus();
}



//犬猫図鑑用 window open
function NWopenZ(url) {
	var wo;
	wo = window.open(url, 'KindView','width=500,height=520,status=no,directories=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes');
	wo.focus();
}


//ご購入フォーム表示用 window open
function NWopenApply(url) {
	
	var tdate = new Date();
	var winname = "Apply_" + tdate.getTime();
	var wo;
	wo = window.open(url, winname,'width=600,height=650,status=no,directories=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes');
	wo.focus();
}


