function firstSelectSubCategory(){
	setSubCategory();
	var get = _GET();
	if('category_id' in get){
	    dore=get['category_id'];
		if(dore != 0){
			atai=0;
			for(i=0; i<len; i++){
				if(subCatNaems[dore].length < len && subCatNaems[dore].length <= i){
					document.shopForm.sub_category_id.options[i-atai]=null;
					atai++;
				}
				else {
					document.shopForm.sub_category_id.options[i]=new Option(subCatNaems[dore][i],subCatValues[dore][i]);
					if('sub_category_id' in get){
						if(subCatValues[dore][i] == get['sub_category_id']){
							document.shopForm.sub_category_id.options[i].selected=true;
						}
					}
				}
					
			}
		}
	}
}

function firstT_SelectSubCategory(){
	setSubCategory();
	var get = _GET();
	if('category_id' in get){
	    dore=get['category_id'];
		dore=dore.charAt(2);
		if(dore != 0){
			atai=0;
			for(i=0; i<len; i++){
				if(subCatNaems[dore].length < len && subCatNaems[dore].length <= i){
					document.serviceForm.sub_category_id.options[i-atai]=null;
					atai++;
				}
				else {
					document.serviceForm.sub_category_id.options[i]=new Option(subCatNaems[dore][i],subCatValues[dore][i]);
					if('sub_category_id' in get){
						if(subCatValues[dore][i] == get['sub_category_id']){
							document.serviceForm.sub_category_id.options[i].selected=true;
						}
					}
				}
					
			}
		}
	}
}

function SelectSubCategory(){
	setSubCategory();
	dore=document.shopForm.category_id.selectedIndex;
	document.itemForm.category_id.options[dore].selected=true;
	if(dore != 0){
		atai=0;
		for(i=0; i<len; i++){
			if(subCatNaems[dore].length < len && subCatNaems[dore].length <= i){
				document.shopForm.sub_category_id.options[i-atai]=null;
				atai++;
			}
			else{
				document.shopForm.sub_category_id.options[i]=new Option(subCatNaems[dore][i],subCatValues[dore][i]);
			}
		}
	}
}

function SelectItemCategory(){
	dore=document.itemForm.category_id.selectedIndex;
	document.shopForm.category_id.options[dore].selected=true;
	if(dore != 0){
		atai=0;
		for(i=0; i<len; i++){
			if(subCatNaems[dore].length < len && subCatNaems[dore].length <= i){
				document.shopForm.sub_category_id.options[i-atai]=null;
				atai++;
			}
			else{
				document.shopForm.sub_category_id.options[i]=new Option(subCatNaems[dore][i],subCatValues[dore][i]);
			}
		}
	}
}

function SelectServiceCategory(){
	setSubCategory();
	dore=document.serviceForm.category_id.selectedIndex;
	if(dore != 0){
		atai=0;
		for(i=0; i<len; i++){
			if(subCatNaems[dore].length <len && subCatNaems[dore].length <= i){
				document.serviceForm.sub_category_id.options[i-atai]=null;
				atai++;
			}
			else{
				document.serviceForm.sub_category_id.options[i]=new Option(subCatNaems[dore][i],subCatValues[dore][i]);
			}
		}
	}
}

function inputShopText(){
		document.itemForm.q.value=document.shopForm.q.value;
}

function inputItemText(){
		document.shopForm.q.value=document.itemForm.q.value;
}

function _GET(){
	var get = new Array();
	if(location.search.length > 1){
		var search = unescape(decodeURI(location.search));
		var requests = search.substr(1).split("&");
		for(var i = 0; i < requests.length; i++){
			var r = requests[i].split("=");
			get[r[0]] = r[1];
		}
	}
	return get;
}