var objHistoryId=new Object();
var objCheckbox = new Object();

$(document).ready(function(){
	$("#resultURLButton").click(viewPromotionURL);
});

/***********************************************************
*	プロモーションのURL表示
***********************************************************/
function viewPromotionURL(){
	$("#resultURLView").text($("#resultURL").val());
}

/***********************************************************
*	編集完了確認
***********************************************************/
function confEditEnd(str, url, id){
	if(window.confirm(str)){
		if (url){
			location.href = url;
		}else{
			if (id){
				$("#" + id).submit();
			}else{
				$("#formConf").submit();
			}
		}
	}
}

/***********************************************************
*	文字数の取得
***********************************************************/
function getNumString(id){
	var str = encodeURL($('#' + id).val());

	alert('URLエンコード後の文字数は' + str.length + '文字です');
}

/***********************************************************
*	クリップボードにコピー
***********************************************************/
function setCopy(from){
	setClipboard(from,'クリップボードにコピーしました。')
}

function viewContents(id){
	if (objHistoryId[id]){hideContents(historyId);}

	$("#" + id).css('display', 'block');
	objHistoryId[id] = true;
}

function hideContents(id){
	objHistoryId[id] = false;
	$("#" + id).css('display', 'none');
}

/***********************************************************
*	チェックボックスのオールチェック
***********************************************************/
function setAllCheck(id){
	if (objCheckbox[id]){
		setAllCheckOff(id);
		objCheckbox[id] = false;
	}else{
		setAllCheckOn(id);
		objCheckbox[id] = true;
	}
}

function setAllCheckOff(id){
	$("#" + id).find("input[@type='checkbox']").attr("checked", false);
}
function setAllCheckOn(id){
	$("#" + id).find("input[@type='checkbox']").attr("checked", true);
}
