function Display(no){
	if (no == "no1") {
		if(document.getElementById("SW1")!=null) {
			document.getElementById("SW1").style.display = "none";
			document.getElementById("SW2").style.display = "block";
			document.getElementById("SW3").style.display = "none";
		}
	} else if(no == "no2") {
		if(document.getElementById("SW1")!=null) {
			document.getElementById("SW1").style.display = "";
			document.getElementById("SW2").style.display = "none";
			document.getElementById("SW3").style.display = "block";
		}
	}
}

$(function() {
	$("a#submit").each(
	function() {
		this.href = "javascript:void(0);";
		$(this).bind("click",this,
			function(e){
				$("#form").submit();
				return false;
			}
		);
	}
	);
	$("a#submit2").each(
	function() {
		this.href = "javascript:void(0);";
		$(this).bind("click",this,
			function(e){
				$("#form2").submit();
				return false;
			}
		);
	}
	);
	$("a#back").each(
	function() {
		this.href = "javascript:void(0);";
		$(this).bind("click",this,
			function(e){
				history.back();
				return false;
			}
		);
	}
	);
	$("select[@name=osKbn]").change(function() {
		setOsKbnOther();
	});
	$("select[@name=browserKbn]").change(function() {
		setBrowserKbnOther();
	});
	setOsKbnOther();
	setBrowserKbnOther();
	setTextAmount();
}
);

function setVisibleRadio(spanId,flg){

	spanId	= "#" + spanId;

	if(flg){
		$(spanId).css("display", "inline");
	} else {
		$(spanId).css("display", "none");
	}
}

function setTextAmount(){
	var kbn = $("input[@name='amount']").val();
	if (kbn == null || kbn == '') {
		Display("no1");
	} else {
		Display("no2");
	}
}

function setOsKbnOther(){
	var kbn	= $("select[@name=osKbn] option:selected").val();
	if(!kbn){
		kbn = $("input[@name='osKbn']").val();
	}
	if (kbn == "06") {
		setVisibleRadio("os_sw", true);
	} else {
		setVisibleRadio("os_sw", false);
	}
}

function setBrowserKbnOther(){
	var kbn	= $("select[@name=browserKbn] option:selected").val();
	if(!kbn){
		kbn = $("input[@name='browserKbn']").val();
	}
	if (kbn == "08") {
		setVisibleRadio("browser_sw", true);
	} else {
		setVisibleRadio("browser_sw", false);
	}
}
