var FormCheckBox = new FormCheckBox();
var FormKeyword = new FormKeyword();

function FormCheckBox(){
	this.selectAll = _selectAll;
}
function FormKeyword(){
	this.activate = _activate;
	this.deactivate = _deactivate;
}


/* チェックボックス全て選択 */
function _selectAll(cls,target,me){
	var flg = false;
	if($(me).attr("class") != cls){
		($("."+cls).attr("checked")) ? $("."+cls).attr("checked",false) : $("."+cls).attr("checked",true);
	}else{
		($(me).attr("checked")) ? $("."+cls).attr("checked",true) : $("."+cls).attr("checked",false);
	}
	
	if($("."+cls).attr("checked")) flg = true;
	for(var i=0; i<target.elements.length; i++){
		target.elements[i].checked = flg;
	}
}

/* 検索フォーム制御 */
function _activate(target){
	if(target.value == "気になるキーワードを入力" || target.value == "キーワードを入力") target.value = "";
	target.style.color = "#666666";
	target.style.backgroundColor = "#fff2ec";
}

function _deactivate(target){
	if(target.value == ""){
		(target.id =="searchInputBox") ? target.value = "気になるキーワードを入力" : target.value = "キーワードを入力" ;
	}
	target.style.color = "#999999";
	target.style.backgroundColor = "#ffffff";
}
