/// ***************************************************************************
///
/// オブジェクトの検索
///
/// オブジェクトの識別子
/// 再起用に使用され最初の呼び出しは指定しない
/// ***************************************************************************
function findObj(theObj, theDoc) {
var p, i, foundObj;
if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length) {
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}
/// ***************************************************************************
///
/// メッセージの選択
///
/// 初期フォーカスオブジェクトの識別子
/// ***************************************************************************
function ConfirmMessage(url) {
var msg;
switch (url) {
case "newregist":
msg = "新規登録情報を送信します。よろしいですか?";
break;
case "renewregist":
msg = "登録情報を更新します。よろしいですか?";
break;
case "reissue":
msg = "パスワードを送信します。よろしいですか?";
break;
case "pointexchange":
msg = "レコードポイントの交換申請を行います。よろしいですか?";
break;
case "present":
msg = "プレゼントの応募申請を行います。よろしいですか?";
break;
case "withdraw":
msg = "退会するとこれまでに獲得したポイントは消滅します。退会しますか?";
break;
}
return msg;
}
/// ***************************************************************************
///
/// 検索文字列のチェック
///
/// 初期フォーカスオブジェクトの識別子
/// ***************************************************************************
function CheckStrings(str) {
var spt = new Array();
var flg = new Boolean();
flg = false;
if (str == "") {
flg = true;
} else {
//区切り文字とスペースで文字列を分割
var spt = new Array();
spt = str.split(/[ ]|[ ]|[,]|[,]|[、]|\s/g);
if (spt == null ||spt.length == 0) flg = true;
}
if (flg == true) {
alert("キーワードを入力してください。");
return false;
} else {
str = str.replace(/[ ]|[ ]|[,]|[,]|[、]|\s/g, "");
for (i = 0; i < spt.length; i++) {
data = spt[i].toString().match(/[\%]|[\;]|[\:]|["]|[']|[\<]|[\>]/);
if (data || ! spt[i].toString()) {
alert("入力された特殊記号はキーワードに使用できません。");
return false;
}
}
}
return true;
}