// requires prototype.js

Event.observe(window, 'load', function() {
	$A(document.getElementsByClassName("company-recruit")).each( function(ns) {
		$A(ns.getElementsByClassName("entry_button")).each( function(e) {
			e.onclick = function() {
				var href = this.href;
				var w = Math.floor(screen.width * 0.95);
				w = 630 < w ? 630 : w;
				var h = Math.floor(screen.height * 0.95);
				h = 840 < h ? 840 : h;
				var params = "left=16,top=16,width=" + w + ",height=" + h + ",menubar=no,toolbar=no,scrollbars=yes,resizable=yes";
				var win = window.open(href, "jp_genetyx_entry", params);
				if (win != null) win.focus();
				return false;
			};
		});
		$A(ns.getElementsByClassName("cis_entry_button")).each( function(e) {
			e.onclick = function() {
				var href = this.href;
				var w = Math.floor(screen.width * 0.95);
				w = 630 < w ? 630 : w;
				var h = Math.floor(screen.height * 0.95);
				h = 840 < h ? 840 : h;
				var params = "left=16,top=16,width=" + w + ",height=" + h + ",menubar=no,toolbar=no,scrollbars=yes,resizable=yes";
				var win = window.open(href, "jp_genetyx_cis_entry", params);
				if (win != null) win.focus();
				return false;
			};
		});
		$A(ns.getElementsByClassName("button_image")).each( function(e) {
			e.onmouseover = function() {
				this.src = this.src.replace(/\.png$/, '_.png');
			};
			e.onmouseout = function() {
				this.src = this.src.replace(/_\.png$/, '.png');
			};
			e.title = '新しいウィンドウでフォームを開きます';
		});
	})
});
