/* 
 JavaScript com.js (www.wills.co.jp)

 last updated on 2006.06.30
 (c) 2006 YOSUKE INUI Design Office (www.inuiyosuke.jp)
 */ 

// -------------------------------------------------- utilities --------------------------------------------------

function ONW () {
	var ONW_obj;
//	var target = (arguments[1] && arguments[0].match(/.*\/([\w]+)(\.[\w]*)?\/?$/)) ? RegExp.$1 : '_blank';
	var target = (arguments[0].match(/.*\/([\w]+)(\.[\w]*)?\/?(\?.*)?$/)) ? RegExp.$1 : '_blank';
	var tmp = new Array(arguments[1],arguments[2],arguments[3],arguments[4]);
	if (isNaN(tmp[0])) { tmp[0] = screen.availHeight; tmp[1] =  800; }
	tmp[0] = (isNaN(tmp[0]) || tmp[3] > 0) ? screen.availHeight : (tmp[0] < 100) ? screen.availHeight : tmp[0];
	tmp[1] = (isNaN(tmp[1]) || tmp[3] > 0) ? screen.availWidth : (tmp[1] < 100) ? screen.availWidth : tmp[1];
	tmp[2] = (tmp[2] > 0) ? 'no' : 'yes';
	tmp[3] = (tmp[3] > 0) ? 'yes' : 'no';
	tmp[4] = (tmp[0] < 700) ? 30 : 0;
	tmp[5] = (tmp[1] < 700) ? 30 : 0;
	var Feature = (target == '_blank') ? '' : 'height='+tmp[0]+',width='+tmp[1]+',top='+tmp[4]+',left='+tmp[5]+',fullscreen='+tmp[3]+',resizable=yes,toolbar=no,directories=no,location='+tmp[2]+',scrollbars=yes,menubar=no,status='+tmp[2];
	ONW_obj = window.open(arguments[0],target,Feature); if (ONW_obj) { ONW_obj.focus(); } return false;
}

// -------------------------------------------------- TOWN GUIDEBOOK --------------------------------------------------

var OFFICE_MAP	= new Object();
var OM_NAMEs	= new Array('','map_office_on_sakasegawa.png','map_office_on_tsukaguchi.png','map_office_on_nishinomiya.png','map_office_on_kawanishi.png','map_office_on_mino.png','map_office_on_toyonaka.png','map_office_on_itami.png');
var OM_IMGs	= new Array();
for (i = 1; i < OM_NAMEs.length; i ++) { OM_IMGs[i] = new Image(); OM_IMGs[i].src = '/office/img/' + OM_NAMEs[i]; }

function POMAP () {
if (!OFFICE_MAP.flag) OFFICE_MAP = new OBJ('OFFICE_MAP');
if (!OM_IMGs[0]) { OM_IMGs[0] = new Image(); OM_IMGs[0].src = OFFICE_MAP.path.src; }
OFFICE_MAP.path.src = OM_IMGs[(arguments[0])].src;
}

// -------------------------------------------------- clickable map --------------------------------------------------
document.open();
document.writeln('<map name="map_office_Map">');
document.writeln('<area shape="poly" alt="sakasegawa"	onmouseover="POMAP(1);"	onmouseout="POMAP(0);"	coords="109,64, 109,87, 92,94, 92,131, 13,131, 12,162, 58,162, 68,183, 86,190, 95,190, 109,190, 112,197, 117,199, 125,204, 132,204, 135,210, 150,210, 152,208, 155,202, 153,197, 154,195, 158,196, 161,191, 157,181, 163,177, 168,186, 173,183, 173,175, 175,167, 179,162, 178,154, 166,154,161,151, 154,150, 152,148, 155,144, 147,138, 140,137, 135,129, 131,116, 124,115, 121,111, 125,111, 133,105, 135,97, 128,95, 128,86, 123,74, 112,60" href="/office/sakasegawa.php">');
document.writeln('<area shape="poly" alt="tsukaguchi"	onmouseover="POMAP(2);"	onmouseout="POMAP(0);"	coords="293,252, 223,252, 210,243, 213,232, 202,213, 198,213, 188,215, 184,218, 184,224, 176,220, 169,220, 167,214, 163,214, 160,207, 154,204, 155,228, 163,251, 160,263, 154,280, 167,286, 216,281, 293,281" href="/office/tsukaguchi.php">');
document.writeln('<area shape="poly" alt="nishinomiya"	onmouseover="POMAP(3);"	onmouseout="POMAP(0);"	coords="42,243, 103,243, 85,207, 86,190, 110,190, 112,198, 117,199, 125,205, 132,204, 135,210, 151,210, 154,204, 155,229, 163,251, 160,263, 154,281, 110,264, 42,264" href="/office/nishinomiya.php">');
document.writeln('<area shape="poly" alt="kawanishi01"	onmouseover="POMAP(4);"	onmouseout="POMAP(0);"	coords="190,188, 184,178, 183,172, 187,168, 188,155, 187,153, 187,149, 193,143, 198,120, 204,111, 200,110, 195,114, 190,99, 195,93, 212,96, 216,94, 216,87, 209,85, 202,79, 185,79, 181,72, 165,72, 161,65, 144,62, 140,54, 141,47, 147,43, 143,37, 143,15, 141,8, 131,8, 123,11, 123,16, 98,16,98,32, 108,32, 112,42, 104,50, 112,60, 123,74, 129,86, 128,95, 135,96, 133,105, 125,111, 122,111, 125,116, 131,116, 135,129, 140,137, 147,138, 155,144, 151,148, 154,151, 162,150, 167,155, 178,154, 179,163, 175,167, 173,176, 173,183, 175,189" href="/office/kawanishi.php">');
document.writeln('<area shape="poly" alt="kawanishi02"	onmouseover="POMAP(4);"	onmouseout="POMAP(0);"	coords="241,99, 241,120, 315,120, 315,99" href="/office/kawanishi.php">');
document.writeln('<area shape="poly" alt="mino"		onmouseover="POMAP(5);"	onmouseout="POMAP(0);"	coords="219,100, 230,112, 224,119, 225,127, 229,131, 234,127, 238,127, 241,134, 246,129, 330,129, 330,150, 252,150, 254,157, 253,168, 242,165, 238,167, 235,172, 233,175, 228,175, 221,173, 213,181, 206,184, 198,195, 190,188, 184,178, 184,172, 188,167, 188,155, 187,153, 187,148, 193,142, 198,121,205,110" href="/office/mino.php">');
document.writeln('<area shape="poly" alt="toyonaka"	onmouseover="POMAP(6);"	onmouseout="POMAP(0);"	coords="331,155, 255,155, 253,169, 243,165, 238,167, 235,172, 232,176, 228,175, 221,172, 214,181, 206,184, 198,195, 202,203, 202,213, 213,232, 211,242, 215,245, 226,239, 231,230, 242,235, 271,216, 263,202, 275,189, 266,177, 331,177" href="/office/toyonaka.php">');
document.writeln('<area shape="poly" alt="itami01"	onmouseover="POMAP(7);"	onmouseout="POMAP(0);"	coords="189,189, 178,189, 174,189, 172,181, 169,184, 162,176, 157,180, 162,190, 157,194, 154,194, 154,204, 162,209, 162,214, 168,214, 169,220, 178,220, 184,224, 184,218, 187,215, 198,213, 203,213, 203,204, 198,195" href="/office/itami.php">');
document.writeln('<area shape="poly" alt="itami02"	onmouseover="POMAP(7);"	onmouseout="POMAP(0);"	coords="263,224, 257,224, 241,235, 241,252, 306,252, 306,224" href="/office/itami.php">');
document.writeln('</map>');
document.close();


