function addEvent(elm,listener,fn){
	try{
		elm.addEventListener(listener,fn,false);
	}catch(e){
		elm.attachEvent("on"+listener,fn);
	}
}

// 自サイト以外新規ウインドーで開く処理
//
// ドメイン名を変えること！！
//

addEvent(window,"load",function(){
	if( window.document && window.document.links ){
		L = window.document.links;
		if( L.length ){
			for( i=0; i<L.length; i++ ){
				if(( L[i].hostname != "www.etc-karada.com" )&&( L[i].hostname != "etc-karada.com" )){
					L[i].target = "_blank" ;
				}
			}
		}
	}
}
);

function keisan(){

    var count1 = document.form1.test1.options[document.form1.test1.selectedIndex].value;
    var count2 = document.form1.test2.options[document.form1.test2.selectedIndex].value;
    var count3 = document.form1.test3.options[document.form1.test3.selectedIndex].value;
    var count4 = document.form1.test4.options[document.form1.test4.selectedIndex].value;
    var count5 = document.form1.test5.options[document.form1.test5.selectedIndex].value;
    var count6 = document.form1.test6.options[document.form1.test6.selectedIndex].value;
    var count7 = document.form1.test7.options[document.form1.test7.selectedIndex].value;
    var total = parseInt(count1) + parseInt(count2) + parseInt(count3) + parseInt(count4) + parseInt(count5) + parseInt(count6) + parseInt(count7);

    document.form1.field_total.value = total;

}


/*--------------------------------------------------------------------------
 *  Smooth Scroller Script, version 1.0.1
 *  (c) 2007 Dezinerfolio Inc. <midart@gmail.com>
 *
 *  For details, please check the website : http://dezinerfolio.com/
 *
/*--------------------------------------------------------------------------*/

Scroller = {
	// control the speed of the scroller.
	// dont change it here directly, please use Scroller.speed=50;
	speed:10,

	// returns the Y position of the div
	gy: function (d) {
		gy = d.offsetTop
		if (d.offsetParent) while (d = d.offsetParent) gy += d.offsetTop
		return gy
	},

	// returns the current scroll position
	scrollTop: function (){
		body=document.body
		d=document.documentElement
		if (body && body.scrollTop) return body.scrollTop
		if (d && d.scrollTop) return d.scrollTop
		if (window.pageYOffset) return window.pageYOffset
		return 0
	},

	// attach an event for an element
	// (element, type, function)
	add: function(event, body, d) {
		if (event.addEventListener) return event.addEventListener(body, d,false)
		if (event.attachEvent) return event.attachEvent('on'+body, d)
	},

	// kill an event of an element
	end: function(e){
		if (window.event) {
			window.event.cancelBubble = true
			window.event.returnValue = false
	  		return;
		}
		if (e.preventDefault && e.stopPropagation) {
		  e.preventDefault()
		  e.stopPropagation()
		}
	},
	
	// move the scroll bar to the particular div.
	scroll: function(d){
		i = window.innerHeight || document.documentElement.clientHeight;
		h=document.body.scrollHeight;
		a = Scroller.scrollTop()
		if (d>a) {
			if (d>h-i) d = h-i;
			a += Math.ceil((d-a)/Scroller.speed);
		}
		else
			a = a+(d-a)/Scroller.speed;
		window.scrollTo(0,a)
	  	if(a==d || Scroller.offsetTop==a)clearInterval(Scroller.interval)
	  	Scroller.offsetTop=a
	},
	// initializer that adds the renderer to the onload function of the window
	init: function(){
		Scroller.add(window,'load', Scroller.render)
	},

	// this method extracts all the anchors and validates then as # and attaches the events.
	render: function(){
		a = document.getElementsByTagName('a');
		Scroller.end(this);
		window.onscroll
		for (i=0;i<a.length;i++) {
			l = a[i];
			p1 = l.href.replace(/#.*/, "");
			p2 = location.href.replace(/#.*/, "");
			if(l.href && l.href.indexOf('#container') != -1 && ((p1==p2) || ('/'+p1==p2)) ){
				Scroller.add(l,'click',Scroller.end)
				l.onclick = function(){
					Scroller.end(this);
					l=this.hash.substr(1);
					a = document.getElementById(l);
					if (a) {
						clearInterval(Scroller.interval);
						Scroller.interval=setInterval('Scroller.scroll('+Scroller.gy(a)+')',10);
					}
				}
			}
		}
	}
}
// invoke the initializer of the scroller
Scroller.init();


/*------------------------------------------------------------
 *						END OF CODE
/*-----------------------------------------------------------*/


// Copyright 2008 futomi  http://www.html5.jp/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// border-radius.js v1.0.0

(function () {

addEventListener(window, "load", init);

/* -------------------------------------------------------------------
* initialize the document.
* ----------------------------------------------------------------- */
function init() {
	if( ! /CSS\d+Compat/.test(document.compatMode) ) { return; }
	var elms = getElementsByClassName(document, "etc-border-radius");
	for( var i=0; i<elms.length; i++ ) {
		var elm = elms.item(i);
		var display = get_style(elm, 'display');
		if( ! /(block|table)/.test(display) ) { continue; }
		round(elm);
	}
}

/* -------------------------------------------------------------------
* round the corners.
* ----------------------------------------------------------------- */

function round(elm) {
	/* get parameters from css attribute value in the target element. */
	var p = get_params(elm);
	/* get background-color */
	var bgcolor = get_style(elm, 'background-color');
	if( ! bgcolor ) { return; }
	/* get margin, padding, border */
	var css = get_styles(elm,  [
		'width',
		'margin-top', 'margin-right', 'margin-bottom', 'margin-left',
		'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
		'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width',
		'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
		'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
		'float', 'clear'
	]);
	/* get width, height, padding of the target element.(integer) */
	var size = get_box_size(elm);
	if(! size ) { return; }
	var width = Math.ceil(size['w']);
	var height = Math.ceil(size['h']);
	var padding_left = Math.ceil(conv_to_pixel(elm, css['padding-left']));
	var padding_right = Math.ceil(conv_to_pixel(elm, css['padding-right']));
	var padding_top = Math.ceil(conv_to_pixel(elm, css['padding-top']));
	var padding_bottom = Math.ceil(conv_to_pixel(elm, css['padding-bottom']));
	/* get border-width and border-color of the target element. (getted border-width is the one of thickest border in the four sides.) */
	var max_border = get_css_max_border(elm);
	var border_width = Math.ceil(max_border['width']);
	var border_color = max_border['color'];
	/* if border width is thicker than the radius, set the radius to the border width */
	for( var k in p ) {
		if(p[k] > 0 && border_width > p[k]) {
			p[k] = Math.ceil(border_width);
		}
	}
	/* set 0px to borer and margin of the target element */
	clear_border_margin(elm);
	/* create a table element */
	var table = document.createElement("TABLE");
	/* initialize the style of the table element */
	init_style(table);
	/* apply default styles to the table element */
	table_width = width + padding_right + padding_left + border_width * 2;
	table.style.display = get_style(elm, 'display');
	table.style.width = table_width + "px";
	table.style.borderCollapse = 'collapse';
	table.style.marginTop = css['margin-top'];
	table.style.marginRight = css['margin-right'];
	table.style.marginBottom = css['margin-bottom'];
	table.style.marginLeft = css['margin-left'];
	if(document.uniqueID) {
		table.style.styleFloat = css['float'];
	} else {
		table.style.cssFloat = css['float'];
	}
	table.style.clear = css['clear'];
	/* create a tbody element */
	var tbody = document.createElement("TBODY");
	init_style(tbody);
	for( var i=0; i<3; i++ ) {
		var tr = document.createElement("TR");
		init_style(tr);
		if(i==1) {
			for( var j=0; j<3; j++ ) {
				var td = document.createElement("TD");
				init_style(td);
				td.style.height = height + "px";
				if(j==1) {
					var clone = elm.cloneNode(true);
					clone.style.width = width + "px";
					clone.style.paddingLeft = padding_left + "px";
					clone.style.paddingRight = padding_right + "px";
					clone.style.paddingTop = padding_top + "px";
					clone.style.paddingBottom = padding_bottom + "px";
					td.style.width = width + "px";
					td.appendChild(clone);
					td.style.backgroundColor = bgcolor;
					tr.appendChild(td);
				} else if(border_width > 0) {
					td.style.width = border_width + "px";
					td.style.emptyCells = 'show';
					tr.appendChild(td);
				}
			}
		} else {
			var td = document.createElement("TD");
			init_style(td);
			if(border_width > 0) {
				td.colSpan = 3;
			}
			td.style.emptyCells = 'show';
			td.style.padding = '0';
			td.style.margin = '0';
			td.style.width = table_width + "px";
			var r = 0;
			if(i==0) {
				r = Math.max(p["top-left"], p["top-right"]);
			} else if(i==2) {
				r = Math.max(p["bottom-left"], p["bottom-right"]);
			}
			if(r > 0) {
				td.style.height = Math.ceil(r + border_width/2) + "px";
			} else {
				td.style.height = border_width + "px";
			}
			tr.appendChild(td);
		}
		tbody.appendChild(tr);
	}
	table.appendChild(tbody);
	/* replace the target element to the table element */
	elm.parentNode.replaceChild(table, elm);
	/* draw corners */
	draw_corner(table, p, bgcolor, border_width, border_color);
}

function get_params(elm) {
	var p = {
		"top-left":0,
		"top-right":0,
		"bottom-left":0,
		"bottom-right":0
	};
	var c = elm.className;
	if( ! c ) { return p; }
	var m = c.match(/\[([^\]]+)\]/);
	if( ! m  ) {
		return {
			"top-left":5,
			"top-right":5,
			"bottom-left":5,
			"bottom-right":5
		};
	}
	var parts = m[1].split(";");
	for( var i=0; i<parts.length; i++ ) {
		var pair = parts[i];
		if(pair == "") { continue; }
		var m = pair.match(/^([a-zA-Z0-9\-]+)\:(\d+[a-z\%]+)$/);
		if( ! m ) { continue; }
		var k = m[1];
		var v = m[2];
		if( /^\d+(px)?$/.test(v) ) {
			v = parseInt(v);
		} else if( /^\d+.+$/.test(v) ) {
			v = conv_to_pixel(elm, v);
		}
		if( k == "radius" ) {
			p["top-left"] = v;
			p["top-right"] = v;
			p["bottom-left"] = v;
			p["bottom-right"] = v;
		} else if( k == "top" ) {
			p["top-left"] = v;
			p["top-right"] = v;
		} else if( k == "bottom" ) {
			p["bottom-left"] = v;
			p["bottom-right"] = v;
		} else if( k == "left" ) {
			p["top-left"] = v;
			p["bottom-left"] = v;
		} else if( k == "right" ) {
			p["top-right"] = v;
			p["bottom-right"] = v;
		} else if( /^(top|bottom)\-(left|right)$/.test(k) ) {
			p[k] = v;
		}
	}
	return p;
}

function init_style(elm) {
	var s = elm.style;
	s.borderWidth = "0px";
	s.margin = "0px";
	s.padding = "0px";
	s.backgroundColor = "transparent";
	s.backgroundImage = "none";
	s.overflow = "visible";
	s.position = "static";
	s.styleFloat = "none";
	s.clear = "none";
}

function draw_corner(table, p, bgcolor, border_width, border_color) {
	var canvast = document.createElement("CANVAS");
	if(canvast.getContext) {
		draw_corner_by_canvas(table, p, bgcolor, border_width, border_color);
	} else if(document.uniqueID) {
		if (!document.namespaces["v"]) {
			document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
		}
		var style_sheet = document.createStyleSheet();
		style_sheet.cssText = "v\\:*{behavior:url(#default#VML)}";
		draw_corner_by_vml(table, p, bgcolor, border_width, border_color);
	}
}

function draw_corner_by_canvas(table, p, bgcolor, border_width, border_color) {
	var s = border_width / 2;
	/* top, bottom */
	var tds = [table.rows[0].cells[0], table.rows[2].cells[0]];
	for( var i=0; i<2; i++ ) {
		var td = tds[i];
		var w = parseFloat(td.style.width);
		var h = parseFloat(td.style.height);
		var canvas = document.createElement("CANVAS");
		td.appendChild(canvas);
		canvas.width = w;
		canvas.height = h;
		canvas.style.display = "block";
		canvas.style.margin = "0px";
		canvas.style.padding = "0px";
		canvas.style.width = w + "px";
		canvas.style.height = h + "px";
		var ctx = canvas.getContext('2d');
		ctx.lineWidth = border_width;
		ctx.strokeStyle = border_color;
		ctx.fillStyle = bgcolor;
		ctx.lineCap = "round";
		ctx.beginPath();
		if(i==0) {
			var rL = p["top-left"];
			var rR = p["top-right"];
			var rMax = Math.max(rL, rR);
			if(rMax == 0) { rMax = s; }
			ctx.moveTo(s, h);
			ctx.lineTo(s, h-rMax+rL);
			if(rL > 0) {
				ctx.arc(s+rL, h-rMax+rL, rL, 180 * Math.PI / 180, 270 * Math.PI / 180, false);
			}
			ctx.lineTo(w-s-rR, h-rMax);
			if(rR > 0) {
				ctx.arc(w-s-rR, h-rMax+rR, rR, 270 * Math.PI / 180, 360 * Math.PI / 180, false);
			}
			ctx.lineTo(w-s, h);
		} else if(i==1) {
			var rL = p["bottom-left"];
			var rR = p["bottom-right"];
			var rMax = Math.max(rL, rR);
			if(rMax == 0) { rMax = s; }
			ctx.moveTo(s, 0);
			ctx.lineTo(s, rMax-rL);
			if(rL > 0) {
				ctx.arc(s+rL, rMax-rL, rL, 180 * Math.PI / 180, 90 * Math.PI / 180, true);
			}
			ctx.lineTo(w-s-rR, rMax);
			if(rR > 0) {
				ctx.arc(w-s-rR, rMax-rR, rR, 90 * Math.PI / 180, 0, true);
			}
			ctx.lineTo(w-s, 0);
		}
		ctx.fill();
		if(border_width>0) {
			ctx.stroke();
		}
	}
	/* left, right */
	if(border_width > 0) {
		var tdh = [table.rows[1].cells[0], table.rows[1].cells[2]];
		for( var i=0; i<2; i++ ) {
			var td = tdh[i];
			td.style.backgroundColor = border_color;
		}
	}
}

function draw_corner_by_vml(table, p, bgcolor, border_width, border_color) {
	var s = 0;
	if(border_width > 0) {
		s = Math.ceil(border_width / 2);
		if(border_width % 2 == 0) { s ++; }
	}
	/* top, bottom */
	var tdv = [table.rows[0].cells[0], table.rows[2].cells[0]];
	for( var i=0; i<2; i++ ) {
		var td = tdv[i];
		var w = parseFloat(td.style.width);
		var h = parseFloat(td.style.height);
		var atrs = {
			coordorigin: "0 0",
			coordsize: w+","+h,
			style: "width:"+w+"; height:"+h+"; position:absolute; margin-left:0; margin-top:0;",
			fillcolor: bgcolor,
			strokecolor: border_width ? border_color : bgcolor,
			strokeweight: (border_width ? border_width : 1) + "px",
			strokejoinstyle: "miter"
		};
		var vtag = "";
		if(i == 0) {
			var rL = p["top-left"];
			var rR = p["top-right"];
			var rMax = Math.max(rL, rR);
			if(border_width > 0) {
				var path = [];
				path.push("m", w-s, h, "l", w-s, h-rMax+rR);
				if(rR > 0) {
					path.push("at", w-s-(rR*2), h-rMax, w-s, h+rR, w-s, h-rMax+rR, w-s-rR, h-rMax);
				}
				path.push("l", s+rL, h-rMax);
				if(rL > 0) {
					path.push("at", s, h-rMax, s+(rL*2), h-rMax+(rL*2), s+rL, h-rMax, s, h-rMax+rL);
				}
				path.push("l", s, h);
				atrs['stroked'] = "false";
				atrs['filled'] = "true";
				atrs['path'] = path.join(" ") + " x e";
				vtag += make_vml_tag(atrs);
				atrs['stroked'] = "true";
				atrs['filled'] = "false";
				atrs['path'] = path.join(" ") + " e";
			} else {
				var path = [];
				path.push("m", w-1, h, "l", w-1, h-rMax+rR);
				if(rR > 0) {
					path.push("at", w-1-(rR*2), h-rMax, w-1, h-rMax+(rR*2), w-1, h-rMax+rR, w-1-rR, h-rMax);
				}
				path.push("l", rL, h-rMax);
				if(rL > 0) {
					path.push("at", 0, h-rMax, 0+(rL*2), h-rMax+(rL*2), 0+rL, h-rMax, 0, h-rMax+rL);
				}
				path.push("l", s, h);
				atrs['stroked'] = "false";
				atrs['filled'] = "true";
				atrs['path'] = path.join(" ") + " x e";
				vtag += make_vml_tag(atrs);
				atrs['stroked'] = "true";
				atrs['filled'] = "false";
				atrs['path'] = path.join(" ") + " e";
			}
			vtag += make_vml_tag(atrs);
		} else if(i == 1) {
			var rL = p["bottom-left"];
			var rR = p["bottom-right"];
			var rMax = Math.max(rL, rR);
			if(border_width > 0) {
				var path = [];
				path.push("m", s, -1, "l", s, rMax-rL);
				if(rL > 0) {
					path.push("at", s, rMax-(rL*2), s+(rL*2), rMax, s, rMax-rL, s+rL, rMax);
				}
				path.push("l", w-s-rR, rMax);
				if(rR > 0) {
					path.push("at", w-s-(rR*2), rMax-(rR*2), w-s, rMax, w-s-rR, rMax, w-s, rMax-rR);
				}
				path.push("l", w-s, -1);
				atrs['stroked'] = "false";
				atrs['filled'] = "true";
				atrs['path'] = path.join(" ") + " x e";
				vtag += make_vml_tag(atrs);
				atrs['stroked'] = "true";
				atrs['filled'] = "false";
				atrs['path'] = path.join(" ") + " e";
			} else {
				var path = [];
				path.push("m", 0, -1, "l", 0, rMax-rL);
				if(rL > 0) {
					path.push("at", 0, rMax-(rL*2), 0+(rL*2), rMax, 0, rMax-rL, 0+rL, rMax);
				}
				path.push("l", w-1-rR, rMax);
				if(rR > 0) {
					path.push("at", w-1-(rR*2), rMax-(rR*2), w-1, rMax, w-1-rR, rMax, w-1, rMax-rR);
				}
				path.push("l", w-1, -1);
				atrs['stroked'] = "false";
				atrs['filled'] = "true";
				atrs['path'] = path.join(" ") + " x e";
				vtag += make_vml_tag(atrs);
				atrs['stroked'] = "true";
				atrs['filled'] = "false";
				atrs['path'] = path.join(" ") + " e";
			}
			vtag += make_vml_tag(atrs);
		}
		td.innerHTML = vtag;
	}
	/* left, right */
	if(border_width > 0) {
		var tdh = [table.rows[1].cells[0], table.rows[1].cells[2]];
		for( var i=0; i<2; i++ ) {
			var td = tdh[i];
			var w = parseFloat(td.style.width);
			var h = parseFloat(td.style.height);
			var atrs = {
				coordorigin: "0 0",
				coordsize: w+","+h,
				style: "width:"+w+"; height:"+h+"; position:absolute; margin-left:0; margin-top:0;",
				strokecolor: border_color,
				strokeweight: border_width + "px",
				stroked: "true",
				filled: "false"
			};
			var vtag = "";
			if(i == 0) {
				atrs['path'] = ["m", s, -1, "l", s, h, "e"].join(" ");
			} else if(i == 1) {
				atrs['path'] = ["m", w-s, -1, "l", w-s, h, "e"].join(" ");
			}
			vtag += make_vml_tag(atrs, { endcap: "flat" });
			td.innerHTML = vtag;
		}
	}
}

function make_vml_tag(shape_atrs, add_stroke_atrs) {
	var vtag = '<v:shape';
	for( var k in shape_atrs ) {
		var v = " " + k + '="' + shape_atrs[k] + '"';
		vtag += v;
	}
	vtag += '>';
	var stroke_atrs = {
		linestyle: "Single",
		endcap: "round",
		joinstyle: "miter"
	};
	if(add_stroke_atrs) {
		for( var k in add_stroke_atrs ) {
			stroke_atrs[k] = add_stroke_atrs[k];
		}
	}
	var svtag = '<v:stroke';
	for( var k in stroke_atrs ) {
		var v = " " + k + '="' + stroke_atrs[k] + '"';
		svtag += v;
	}
	svtag += ' />';
	vtag += svtag;
	vtag += '</v:shape>';
	return vtag;
}

function clear_border_margin(elm) {
	var sides = ['Top', 'Right', 'Bottom', 'Left'];
	for( var i=0; i<4; i++ ) {
		elm.style["border"+sides[i]+"Width"] = '0px';
		elm.style["margin"+sides[i]] = '0px';
	}
}

function get_css_max_border(elm) {
	var width = 0;
	var sides = ['top', 'right', 'bottom', 'left'];
	var max_side = 'top';
	for( var i=0; i<4; i++ ) {
		var w = get_style(elm, "border-"+sides[i]+"-width");
		w = conv_to_pixel(elm, w);
		if(w > width) {
			width = w;
			max_side = sides[i];
		}
	}
	var color = get_style(elm, "border-"+max_side+"-color");
	return {width: width, color: color};
}

function conv_to_pixel(elm, size) {
	if( ! size ) {
		return 0;
	}
	if( /^[\d\.]+px$/.test(size) ) {
		return parseFloat(size);
	}
	if(document.uniqueID && /^(thin|medium|thick)$/.test(size) ) {
		if(size == "thin") {
			return 1;
		} else if(size == "medium") {
			return 3;
		} else if(size == "thick") {
			return 5;
		}
	}
	var sty = elm.style.left
	var rtm = elm.runtimeStyle.left;
	elm.runtimeStyle.left = elm.currentStyle.left;
	elm.style.left = size;
	var px = elm.style.pixelLeft;
	elm.style.left = sty;
	elm.runtimeStyle.left = rtm;
	return px;
}

function get_box_size(elm) {
	var display = get_style(elm, 'display');
	if(display == "table" || elm.nodeName == "TABLE") {
		var w = elm.clientWidth;
		var h = elm.clientHeight;
		if(w && h) {
			return {w:w, h:h};
		} else {
			w = get_style(elm, 'width');
			if( /px$/.test(w) ) {
				w = parseFloat(w);
			} else {
				w= conv_to_pixel(elm, w);
			}
			h = get_style(elm, 'height');
			if( /px$/.test(h) ) {
				h = parseFloat(h);
			} else {
				h= conv_to_pixel(elm, h);
			}
		}
	} else {
		var w = get_style(elm, 'width');
		if( /px$/.test(w) ) {
			w = parseFloat(w);
		} else {
			w = conv_to_pixel(elm, w);
			if( ! w ) {
				w = elm.clientWidth;
			}
		}
		var h = get_style(elm, 'height');
		if( /px$/.test(h) ) {
			h = parseFloat(h);
		} else {
			h = conv_to_pixel(elm, h);
			if( ! h ) {
				h = elm.clientHeight;
			}
		}
	}
	if(w && h) {
		return {w:w, h:h};
	} else {
		return null;
	}
}

function get_style(elm, property) {
	if( document.defaultView ) {
		return document.defaultView.getComputedStyle(elm, null).getPropertyValue(property);
	} else if( elm.currentStyle ) {
		property = conv_css_prt_to_atr(property);
		return elm.currentStyle.getAttribute(property);
	} else {
		return null;
	}
}

function get_styles(elm, properties) {
	var css = {};
	if( document.defaultView ) {
		for(var i=0; i<properties.length; i++) {
			var property = properties[i];
			css[property] = document.defaultView.getComputedStyle(elm, null).getPropertyValue(property);
		}
	} else if( elm.currentStyle ) {
		for(var i=0; i<properties.length; i++) {
			var property = properties[i];
			var atr = conv_css_prt_to_atr(property);
			css[property] = elm.currentStyle.getAttribute(atr);
		}
	} else {
		return null;
	}
	return css;
}

function conv_css_prt_to_atr(prt) {
	if(prt == "float") {
		if(document.uniqueID) {
			return "styleFloat";
		} else {
			return "cssFloat";
		}
	} else {
		return prt.replace(/\-([a-z])/g, function(d,c){return c.toUpperCase();});
	}
}

/* -------------------------------------------------------------------
* below, funstions related DOM
* ----------------------------------------------------------------- */

/* ------------------------------------------------------------------
[syntax]
  addEventListener(elm, type, func, useCapture)
[description]
  set a event listener
[arguments]
  ・elm
      element node object
  ・type
      event type
  ・func
      call back function object
[returned values]
  if success, return true. if failure, return false.
------------------------------------------------------------------- */
function addEventListener(elm, type, func) {
	if(! elm) { return false; }
	if(elm.addEventListener) {
		elm.addEventListener(type, func, false);
	} else if(elm.attachEvent) {
		/* thanks to http://ejohn.org/projects/flexible-javascript-events/ */
		elm['e'+type+func] = func;
		elm[type+func] = function(){elm['e'+type+func]( window.event );}
		elm.attachEvent( 'on'+type, elm[type+func] );
	} else {
		return false;
	}
	return true;
}

/* ------------------------------------------------------------------
[syntax]
  getElementsByClassName(element, classNames)
[description]
  return a list of nodes which have class attribute value as same as specified name from child nodes of specified element.
[arguments]
  ・element
      element node object
  ・classNames
      class attribute value
[returned values]
  nodeList
------------------------------------------------------------------- */
function getElementsByClassName(element, classNames) {
	if(element.getElementsByClassName) {
		return element.getElementsByClassName(classNames);
	}
	/* split a string on spaces */
	var split_a_string_on_spaces = function(string) {
		string = string.replace(/^[\t\s]+/, "");
		string = string.replace(/[\t\s]+$/, "");
		var tokens = string.split(/[\t\s]+/);
		return tokens;
	};
	var tokens = split_a_string_on_spaces(classNames);
	var tn = tokens.length;
	var nodes = element.all ? element.all : element.getElementsByTagName("*");
	var n = nodes.length;
	var array = new Array();
	if( tn > 0 ) {
		if( document.evaluate ) {
			var contains = new Array();
			for(var i=0; i<tn; i++) {
				contains.push('contains(concat(" ",@class," "), " '+ tokens[i] + '")');
			}
			var xpathExpression = "/descendant::*[" + contains.join(" and ") + "]";
			var iterator = document.evaluate(xpathExpression, element, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
			var inum = iterator.snapshotLength;
			for( var i=0; i<inum; i++ ) {
				var elm = iterator.snapshotItem(i);
				if( elm != element ) {
					array.push(iterator.snapshotItem(i));
				}
			}
		} else {
			for(var i=0; i<n; i++) {
				var elm = nodes.item(i);
				if( elm.className == "" ) { continue; }
				var class_list = split_a_string_on_spaces(elm.className);
				var class_name = class_list.join(" ");
				var f = true;
				for(var j=0; j<tokens.length; j++) {
					var re = new RegExp('(^|\\s)' + tokens[j] + '(\\s|$)')
					if( ! re.test(class_name) ) {
						f = false;
						break;
					}
				}
				if(f == true) {
					array.push(elm);
				}
			}
		}
	}
	/* add item(index) method to the array as if it behaves such as a NodeList interface. */
	array.item = function(index) {
		if(array[index]) {
			return array[index];
		} else {
			return null;
		}
	};
	//
	return array;
}

function event_target(evt) {
	if(evt && evt.target) {
		if(evt.target.nodeType == 3) {
			return evt.target.parentNode;
		} else {
			return evt.target;
		}
	} else if(window.event && window.event.srcElement) {
		return window.event.srcElement;
	} else {
		return null;
	}
}

})();

//---------------------------------------------------------
// 全角・半角変換 機能追加スクリプト
//
// 2005/2/26 Kazuhiko Arase
//
// String に、以下のメソッドを拡張します。
//
// ・半角Ascii変換
// toHankakuAscii()
//
// ・全角Ascii変換
// toZenkakuAscii()
//
// ・半角カナ変換
// toHankakuKana()
//
// ・全角カナ変換
// toZenkakuKana()
//
// ・半角変換
// toHankaku()
//
// ・全角変換
// toZenkaku()
//
// ・標準変換(半角Ascii, 全角カナ)
// toNormal()
//

function InstallZenHanConversion() {

    function ConversionMap() {
        this.map1 = {};
        this.map2 = {};
    }

    ConversionMap.prototype = {

        add : function(s1, s2) {

            if (!this.map1[s1]) {
                this.map1[s1] = s2;
            }

            if (!this.map2[s2]) {
                this.map2[s2] = s1;
            }
        },

        convert : function(s, reverse) {

            var map = !reverse? this.map1 : this.map2;

            var converted = "";

            for (var i = 0;i < s.length;i++) {

                if (i + 1 < s.length) {
                    var c = map[s.substring(i, i + 2)];
                    if (c) {
                        converted += c;
                        i++;
                        continue;
                    }
                }

                var c = map[s.substring(i, i + 1)];
                if (c) {
                    converted += c;
                    continue;
                }

                // 変換テーブルに該当無し
                converted += s.substring(i, i + 1);
            }

            return converted;
        }
    };

    //---------------------------------------------------------
    // 全角-半角 マッピング (ASCII)
    //

    var asciiMap = new ConversionMap();

    asciiMap.add(" ", "　");
    asciiMap.add("!", "！");

    // 2重引用符
    //asciiMap.add("\"", "＂");
    asciiMap.add("\"", "“");
    asciiMap.add("\"", "”");

    asciiMap.add("#", "＃");
    asciiMap.add("$", "＄");
    asciiMap.add("%", "％");
    asciiMap.add("&", "＆");
    asciiMap.add("'", "’");
    asciiMap.add("(", "（");
    asciiMap.add(")", "）");
    asciiMap.add("*", "＊");
    asciiMap.add("+", "＋");
    asciiMap.add(",", "，");
    asciiMap.add("-", "－");
    asciiMap.add(".", "．");
    asciiMap.add("/", "／");
    asciiMap.add("0", "０");
    asciiMap.add("1", "１");
    asciiMap.add("2", "２");
    asciiMap.add("3", "３");
    asciiMap.add("4", "４");
    asciiMap.add("5", "５");
    asciiMap.add("6", "６");
    asciiMap.add("7", "７");
    asciiMap.add("8", "８");
    asciiMap.add("9", "９");
    asciiMap.add(":", "：");
    asciiMap.add(";", "；");
    asciiMap.add("<", "＜");
    asciiMap.add("=", "＝");
    asciiMap.add(">", "＞");
    asciiMap.add("?", "？");
    asciiMap.add("@", "＠");
    asciiMap.add("A", "Ａ");
    asciiMap.add("B", "Ｂ");
    asciiMap.add("C", "Ｃ");
    asciiMap.add("D", "Ｄ");
    asciiMap.add("E", "Ｅ");
    asciiMap.add("F", "Ｆ");
    asciiMap.add("G", "Ｇ");
    asciiMap.add("H", "Ｈ");
    asciiMap.add("I", "Ｉ");
    asciiMap.add("J", "Ｊ");
    asciiMap.add("K", "Ｋ");
    asciiMap.add("L", "Ｌ");
    asciiMap.add("M", "Ｍ");
    asciiMap.add("N", "Ｎ");
    asciiMap.add("O", "Ｏ");
    asciiMap.add("P", "Ｐ");
    asciiMap.add("Q", "Ｑ");
    asciiMap.add("R", "Ｒ");
    asciiMap.add("S", "Ｓ");
    asciiMap.add("T", "Ｔ");
    asciiMap.add("U", "Ｕ");
    asciiMap.add("V", "Ｖ");
    asciiMap.add("W", "Ｗ");
    asciiMap.add("X", "Ｘ");
    asciiMap.add("Y", "Ｙ");
    asciiMap.add("Z", "Ｚ");
    asciiMap.add("[", "［");

    // 円記号
    //asciiMap.add("\\", "＼");
    asciiMap.add("\\", "￥");

    asciiMap.add("]", "］");
    asciiMap.add("^", "＾");
    asciiMap.add("_", "＿");

    // 単一引用符
    //asciiMap.add("`", "＇");
    asciiMap.add("`", "‘");
    asciiMap.add("`", "’");

    asciiMap.add("a", "ａ");
    asciiMap.add("b", "ｂ");
    asciiMap.add("c", "ｃ");
    asciiMap.add("d", "ｄ");
    asciiMap.add("e", "ｅ");
    asciiMap.add("f", "ｆ");
    asciiMap.add("g", "ｇ");
    asciiMap.add("h", "ｈ");
    asciiMap.add("i", "ｉ");
    asciiMap.add("j", "ｊ");
    asciiMap.add("k", "ｋ");
    asciiMap.add("l", "ｌ");
    asciiMap.add("m", "ｍ");
    asciiMap.add("n", "ｎ");
    asciiMap.add("o", "ｏ");
    asciiMap.add("p", "ｐ");
    asciiMap.add("q", "ｑ");
    asciiMap.add("r", "ｒ");
    asciiMap.add("s", "ｓ");
    asciiMap.add("t", "ｔ");
    asciiMap.add("u", "ｕ");
    asciiMap.add("v", "ｖ");
    asciiMap.add("w", "ｗ");
    asciiMap.add("x", "ｘ");
    asciiMap.add("y", "ｙ");
    asciiMap.add("z", "ｚ");
    asciiMap.add("{", "｛");
    asciiMap.add("|", "｜");
    asciiMap.add("}", "｝");
    asciiMap.add("~", "～");


    //---------------------------------------------------------
    // 全角-半角 マッピング (カタカナ)
    //


    var kanaMap = new ConversionMap();

    kanaMap.add("。", "｡");
    kanaMap.add("「", "｢");
    kanaMap.add("」", "｣");
    kanaMap.add("、", "､");
    kanaMap.add("・", "･");
    kanaMap.add("ヲ", "ｦ");

    kanaMap.add("ァ", "ｧ");
    kanaMap.add("ィ", "ｨ");
    kanaMap.add("ゥ", "ｩ");
    kanaMap.add("ェ", "ｪ");
    kanaMap.add("ォ", "ｫ");

    kanaMap.add("ャ", "ｬ");
    kanaMap.add("ュ", "ｭ");
    kanaMap.add("ョ", "ｮ");

    kanaMap.add("ッ", "ｯ");

    kanaMap.add("ー", "ｰ");

    kanaMap.add("ア", "ｱ");
    kanaMap.add("イ", "ｲ");
    kanaMap.add("ウ", "ｳ");
    kanaMap.add("エ", "ｴ");
    kanaMap.add("オ", "ｵ");

    kanaMap.add("カ", "ｶ");
    kanaMap.add("キ", "ｷ");
    kanaMap.add("ク", "ｸ");
    kanaMap.add("ケ", "ｹ");
    kanaMap.add("コ", "ｺ");

    kanaMap.add("ガ", "ｶﾞ");
    kanaMap.add("ギ", "ｷﾞ");
    kanaMap.add("グ", "ｸﾞ");
    kanaMap.add("ゲ", "ｹﾞ");
    kanaMap.add("ゴ", "ｺﾞ");

    kanaMap.add("サ", "ｻ");
    kanaMap.add("シ", "ｼ");
    kanaMap.add("ス", "ｽ");
    kanaMap.add("セ", "ｾ");
    kanaMap.add("ソ", "ｿ");

    kanaMap.add("ザ", "ｻﾞ");
    kanaMap.add("ジ", "ｼﾞ");
    kanaMap.add("ズ", "ｽﾞ");
    kanaMap.add("ゼ", "ｾﾞ");
    kanaMap.add("ゾ", "ｿﾞ");

    kanaMap.add("タ", "ﾀ");
    kanaMap.add("チ", "ﾁ");
    kanaMap.add("ツ", "ﾂ");
    kanaMap.add("テ", "ﾃ");
    kanaMap.add("ト", "ﾄ");

    kanaMap.add("ダ", "ﾀﾞ");
    kanaMap.add("ヂ", "ﾁﾞ");
    kanaMap.add("ヅ", "ﾂﾞ");
    kanaMap.add("デ", "ﾃﾞ");
    kanaMap.add("ド", "ﾄﾞ");

    kanaMap.add("ナ", "ﾅ");
    kanaMap.add("ニ", "ﾆ");
    kanaMap.add("ヌ", "ﾇ");
    kanaMap.add("ネ", "ﾈ");
    kanaMap.add("ノ", "ﾉ");

    kanaMap.add("ハ", "ﾊ");
    kanaMap.add("ヒ", "ﾋ");
    kanaMap.add("フ", "ﾌ");
    kanaMap.add("ヘ", "ﾍ");
    kanaMap.add("ホ", "ﾎ");

    kanaMap.add("バ", "ﾊﾞ");
    kanaMap.add("ビ", "ﾋﾞ");
    kanaMap.add("ブ", "ﾌﾞ");
    kanaMap.add("ベ", "ﾍﾞ");
    kanaMap.add("ボ", "ﾎﾞ");

    kanaMap.add("パ", "ﾊﾟ");
    kanaMap.add("ピ", "ﾋﾟ");
    kanaMap.add("プ", "ﾌﾟ");
    kanaMap.add("ペ", "ﾍﾟ");
    kanaMap.add("ポ", "ﾎﾟ");

    kanaMap.add("マ", "ﾏ");
    kanaMap.add("ミ", "ﾐ");
    kanaMap.add("ム", "ﾑ");
    kanaMap.add("メ", "ﾒ");
    kanaMap.add("モ", "ﾓ");

    kanaMap.add("ヤ", "ﾔ");
    kanaMap.add("ユ", "ﾕ");
    kanaMap.add("ヨ", "ﾖ");

    kanaMap.add("ラ", "ﾗ");
    kanaMap.add("リ", "ﾘ");
    kanaMap.add("ル", "ﾙ");
    kanaMap.add("レ", "ﾚ");
    kanaMap.add("ロ", "ﾛ");

    kanaMap.add("ワ", "ﾜ");
    kanaMap.add("ン", "ﾝ");

    kanaMap.add("ヴ", "ｳﾞ");


    kanaMap.add("゛", "ﾞ");
    kanaMap.add("゜", "ﾟ");

    kanaMap.add("ヰ", "ｲ");
    kanaMap.add("ヱ", "ｴ");
    kanaMap.add("ヮ", "ﾜ");
    kanaMap.add("ヵ", "ｶ");
    kanaMap.add("ヶ", "ｹ");



    String.prototype.toHankakuAscii = function() {
        return asciiMap.convert(this, true);
    }

    String.prototype.toZenkakuAscii = function() {
        return asciiMap.convert(this, false);
    }

    String.prototype.toHankakuKana = function() {
        return kanaMap.convert(this, false);
    }

    String.prototype.toZenkakuKana = function() {
        return kanaMap.convert(this, true);
    }

    String.prototype.toHankaku = function() {
        return this.toHankakuKana().toHankakuAscii();
    }

    String.prototype.toZenkaku = function() {
        return this.toZenkakuKana().toZenkakuAscii();
    }

    String.prototype.toNormal = function() {
        return this.toZenkakuKana().toHankakuAscii();
    }
}

// 機能インストール
InstallZenHanConversion();

