function openWin(url) {
	var w = 0;
	var h = 0;
	switch(url) {
		case "howto.html":
			w = 500;
			h = 600;
			break;
		case "toshop.html":
			w = 500;
			h = 240;
			break;
		case "ex4.html":
			w = 500;
			h = 240;
			break;
		case "ex5.html":
			w = 500;
			h = 600;
			break;
		case "ex6.html":
			w = 500;
			h = 240;
			break;
		case "ex8.html":
			w = 500;
			h = 240;
			break;
		default:
			w = 500;
			h = 400;
			break;
	}
	var optionStr = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,top=200,left=200,";
	optionStr += "width=" + w + ",height=" + h;
	
	var win1 = window.open(url,'newwin1',optionStr);
}

function closeWin() {
	window.close();
}

function toShop() {
	var win2 = window.open('http://crea.ocnk.net/','newwin2','');
	win2.resizeTo(800,600);
	window.close();
}

function sumTotal() {
	var tip = 15800;
	var postage = 800;
	var extra = 0;

	if (document.form1.tLength[1].checked == true) {
		extra = 1050;
	} else if (document.form1.tLength[0].checked == true) {
		extra = 0;
	}
	
	if (document.form1.delivery[0].checked == true) {
		postage = 800;
	} else if (document.form1.delivery[1].checked == true) {
		postage = 1400;
	} else if (document.form1.delivery[2].checked == true) {
		postage = 180;
	}
	
	var total = tip + postage + extra;
	document.form1.field_postage.value = postage;
	document.form1.field_total.value = total;
}

function scrollWin() {
	window.scrollBy(0,9999);
}