﻿function emailcheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("メールアドレスが間違っています、半角英数にて入力しなおしてください。")
		    return false
		 }

 		 return true					
	}

function ValidateSmartForm(){	
	var emailID=document.SmartForm.email	
	// check that the booking email is not blank
	if ((emailID.value==null)||(emailID.value=="")){
		alert("e-mail を入力して下さい")
		emailID.focus()
		return false
	}
	// check that the booking email is valid
	if (emailcheck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	// now check that the qty entered is an integer
	var qtyID=document.SmartForm.Qty
	// check that the qty is not blank
	if ((qtyID.value==null)||(qtyID.value=="")){
		alert("（数字のみ） を入力して下さい")
		qtyID.focus()
		return false
	}	
	// check the value is numeric
	var intValue = parseInt(qtyID.value)
	if (isNaN(intValue))
	{
		alert("英数字にて入力（数字のみ）")
		qtyID.focus()
		return false		
	}	
	// finaly check that its greater than 0
	if (intValue <= 0)
	{
		alert("マイナス表示は有り得ません")
		qtyID.focus()
		return false		
	}

	var nameID=document.SmartForm.username
	// check that the user name is not blank
	if ((usernameID.value==null)||(usernameID.value=="")){
		alert("ユーザー名を入力して下さい")
		usernameID.focus()
		return false
	}
	var passwordID=document.SmartForm.password
	// check that the user name is not blank
	if ((passwordID.value==null)||(passwordID.value=="")){
		alert("パスワードを入力して下さい")
		passwordID.focus()
		return false
	}
	return true
 }
 
 function cari ( pilih )
{
  document.searchform.cari.value = pilih ;
  document.searchform.submit() ;
}

function windowOpener(url, name, args) {
if (typeof(popupWin) != "object"){
popupWin = window.open(url,name,args);
} else {
if (!popupWin.closed){ 
popupWin.location.href = url;
} else {
popupWin = window.open(url, name,args);
}
}
popupWin.focus();
}

<!-- Begin
var Onerotate_delay = 2000; // delay in milliseconds (5000 = 5 secs)
Onecurrent = 0;
var OneLinks = new Array(3);
OneLinks[0] = "";
OneLinks[1] = "";
OneLinks[2] = "";
function Onenext() {
if (document.Oneslideform.Oneslide[Onecurrent+1]) {
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent+1].value;
document.Oneslideform.Oneslide.selectedIndex = ++Onecurrent;
   }
else Onefirst();
}
function Oneprevious() {
if (Onecurrent-1 >= 0) {
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent-1].value;
document.Oneslideform.Oneslide.selectedIndex = --Onecurrent;
   }
else Onelast();
}
function Onefirst() {
Onecurrent = 0;
document.images.Oneshow.src = document.Oneslideform.Oneslide[0].value;
document.Oneslideform.Oneslide.selectedIndex = 0;
}
function Onelast() {
Onecurrent = document.Oneslideform.Oneslide.length-1;
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
document.Oneslideform.Oneslide.selectedIndex = Onecurrent;
}
function Oneap(text) {
document.Oneslideform.Oneslidebutton.value = (text == "Stop") ? "Start" : "Stop";
Onerotate();
}
function Onechange() {
Onecurrent = document.Oneslideform.Oneslide.selectedIndex;
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
}
function Onerotate() {
if (document.Oneslideform.Oneslidebutton.value == "Stop") {
Onecurrent = (Onecurrent == document.Oneslideform.Oneslide.length-1) ? 0 : Onecurrent+1;
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
document.Oneslideform.Oneslide.selectedIndex = Onecurrent;
window.setTimeout("Onerotate()", Onerotate_delay);
}
}
function Onetransport(){
window.location=OneLinks[Onecurrent]
}
//  End -->
