/*
	diary.js
	作成日：090203
	更新日：090409
*/

//画像変更
function changeImage(imgId, imgPath, altTxt) {
	document.getElementById(imgId).src = imgPath;
	document.getElementById(imgId).alt = altTxt;
}

$(function(){
	//ieのラベル処理
	if(navigator.userAgent.indexOf("MSIE") >= 0){
		$('div#mainContents label img').click(function(){
			var id= $(this).parent().attr('for');
			$('input#'+id).click();
		});
	}
});

// reload and close window
function closeWin() {
	window.opener.location.reload();
	window.close();
}

// location move and close window
function sendOpener(url) {
	window.opener.location.href=url;
	window.close();
}

// 2度押し防止ファンクション
submitButton = function (){};
submitButton = {
	submited : false,
	disableSubmit : function(formObj) {
		if (!submitButton.submited) {
			submitButton.submited = true;
			this.releaseSubmit();
			return true;
		}
		return false;
	},
	disableButton : function(formObj) {
		if (!submitButton.submited) {
			submitButton.submited = true;
			clearSampleText()
			formObj.submit();
			this.releaseSubmit();
			return true;
		}
		return false;
	},
	disableAnchor : function(formObj) {
		this.disableButton(formObj);
	},
	releaseSubmit : function() {
		setTimeout(function() {
				submitButton.submited = false;
			}, 5000);

	}
};
