/* ------------------------------------------------------- */

/* common.js

/* ------------------------------------------------------- */


/* クリエイター検索
-----------------------------------------------------------*/
function changeCreator(value) {
	if(value != '') window.location.href = 'search.php?cr=' + value;
}


/* checkbox選択
-----------------------------------------------------------*/
var otherSetFlg = false;
var otherDeleteFlg = false;
var otherDefaultValue;
var otherDefaultClass;
var otherCheckboxID;

var focusOtherField = function(object, id) {
	if(!otherSetFlg) {
		otherCheckboxID = id;
		otherDefaultValue = object.value;
		otherDefaultClass = object.className;
		object.onblur = blurOtherField;
		otherSetFlg = true;
	}
	if(!otherDeleteFlg) {
		object.value = '';
		object.className = '';
		otherDeleteFlg = true;
	}
}

var blurOtherField = function() {
	if(this.value == '') {
		this.value = otherDefaultValue;
		this.className = otherDefaultClass;
		otherDeleteFlg = false;
		document.getElementById(otherCheckboxID).checked = false;
	} else {
		if(this.value != otherDefaultValue) document.getElementById(otherCheckboxID).checked = true;
	}
}


/* window open
-----------------------------------------------------------*/
function windowOpen(href, name, w, h) {
   window.open(href, name, "scrollbars=yes,resizable=yes,width=" + w + ",height=" + h);
}


