/*- pagetop action -----------------------------------------*/
function scrollEffect(targetID){
	new Effect.ScrollTo(targetID);
}
/*- oc_tarans -----------------------------------------*/
function toggleMe(a){
	var e=document.getElementById(a);
	if(!e)return true;
	if(e.style.display=="none"){
	e.style.display="block"
	}
	else{
	e.style.display="none"
	}
	return true;
}
/*- gmap load ----------------------------------------------*/
function load() {
	if (GBrowserIsCompatible()) {
	
	var lat = 34.659937;
	var lng = 137.850305;
	
	var objmap = new GMap2(document.getElementById("gmap"));
	objmap.setCenter(new GLatLng(lat,lng), 13);
	objmap.addControl(new GLargeMapControl());
	//objmap.addControl(new GMapTypeControl());
	objmap.addControl(new GScaleControl());
	
	// marker and window
	function createMarker(point) {
		var marker = new GMarker(point);
		return marker;
	}

	// create marker
	var point = new GLatLng(lat,lng);
	var marker = createMarker(point);
	
	objmap.addOverlay(marker);
	}
}

/*- window open -----------------------------------------*/
function OCWinSlide(targetHtml){
	var owin;
	owin = window.open("","_blank","toolbar=0,status=yes,menubar=0,scrollbars=no,resizable=yes,width=700,height=400");
	owin.location.href = targetHtml;
	owin.focus();
}

function OCWinMovies(targetHtml){
	var vwin;
	vwin = window.open("","_blank","toolbar=0,status=yes,menubar=0,scrollbars=no,resizable=yes,width=420,height=530");
	vwin.location.href = targetHtml;
	vwin.focus();
}

/*- check action -----------------------------------------*/
function chkval(k){
	//alert "ok";
	var v,n;
	if(k=='quantity'){
		n=document.cart.length;
		for(i=0; i<n; i++){
			if(document.cart.elements[i].name.substring(0,8) == "quantity"){
				v=document.cart.elements[i].value;
				if(isNaN(v)){ alert("数量に数値以外が入力されています。"); return false; }
				else if(v<1){ alert("この商品を取り消す場合は、取消ボタンを押してください。"); return false; }
			}
		}
		return true;
	}else if(k=='pref'){
		i=document.payment.pref.selectedIndex;
		v=document.payment.pref[i].value;
		if(v==''){ alert("商品の送り先の都道府県を選択してください。\nChoose Shipping adress"); return false; }
		else{ return true; }
	}
}
function chkvalmg(k){
	var v,n;
	if(k=='pref'){
		i=document.payment.pref.selectedIndex;
		v=document.payment.pref[i].value;
		if(v==''){ alert("送り先の都道府県を選択してください。\nChoose Shipping adress.\n등록 주소를 선택해 주십시오."); return false; }
	}
	if(k=='pref'){
		i=document.payment.size.selectedIndex;
		v=document.payment.size[i].value;
		if(v==''){ alert("サイズを選択してください。(Choose Size.)"); return false; }
	}
	if(document.payment.agree.checked){
		return ture;
	}else{
		alert("利用規約にチェックして下さい。");
		return false;
	}
}

function chkvalOdr(){
 var n;
 n=document.odr.quantity.value;
 if(n==''){ alert("数量を選択してください\nChoose Quantity"); return false; }
 else     { return true; }
}

//ポップアップ用
function openWindow(url,winname,option){
 var newWin=window.open(url,winname,option);
 newWin.focus();
}

/*- window open -----------------------------------------*/
function OCwin(targetHtml,WWidth,WHeight,WScroll){
	var owin;
	var pram = "toolbar=0,status=yes,menubar=0,scrollbars=" + WScroll + ",resizable=yes,width=" + WWidth + ",height=" + WHeight;
	owin = window.open("","win1",pram);
	owin.location.href = targetHtml;
	owin.focus();
}