function meditownScripts(dir) {
	var cssfiles = new Array();
	cssfiles[0] = "font_big.css";
	cssfiles[1] = "font_small.css";
	
	var css = GetCookie("CSS");
	if (css == "") {
		css = cssfiles[1];
	}

	document.open();
	if (navigator.appVersion.indexOf('Mac',0)) {
		document.write('<link rel="stylesheet" href="' + dir + 'css/fontmac.css" type="text/css">');
	} else if (navigator.appVersion.indexOf('Win',0)) {
		document.write('<link rel="stylesheet" href="' + dir + 'css/fontwin.css" type="text/css">');
	}
	document.write('<link rel="stylesheet" href="' + dir + 'css/' + css + '" type="text/css" />');
	document.close();

}

function outTextSize(dir) {
	var css = GetCookie("CSS");
	var cssfiles = new Array();
	cssfiles[0] = "font_big.css";
	cssfiles[1] = "font_small.css";

	var escFlag_big = "";
	var escFlag_small = "";
	var imgBig = "";
	var imgLittle = "";

	if (css == cssfiles[0]) { //?
		escFlag_big = "!";
		imgBig = dir + "common/fsize_bt_big_a.gif";
		imgLittle = dir + "common/fsize_bt_small.gif";
	} else if (css == cssfiles[1]) { //?
		escFlag_small = "!";
		imgBig = dir + "common/fsize_bt_big.gif";
		imgLittle = dir + "common/fsize_bt_small_a.gif";
	} else {
		imgBig = dir + "common/fsize_bt_big.gif";
		imgLittle = dir + "common/fsize_bt_small.gif";
	}

	document.open();
	document.write('<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BACKGROUND="' + dir + 'common/spacer.gif">');
	document.write('<TR>');
	document.write('<TD COLSPAN="5"><IMG SRC="' + dir + 'common/fsize_top.gif" WIDTH="170" HEIGHT="3" BORDER="0" ALT=""></TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD><IMG SRC="' + dir + 'common/fsize_lft.gif" WIDTH="110" HEIGHT="19" BORDER="0" ALT="文字サイズ変更"></TD>');
	document.write('<TD><' + escFlag_big + 'A style="size: xx-large; cursor: hand; text-decoration: underline;" HREF="" onClick="CssfChange(0)"><IMG SRC="' + imgBig + '" WIDTH="26" HEIGHT="19" BORDER="0" ALT="E></A></TD>');
	document.write('<TD><IMG SRC="' + dir + 'common/fsize_cnt.gif" WIDTH="3" HEIGHT="19" BORDER="0" ALT=""></TD>');
	document.write('<TD><' + escFlag_small + 'A style="size: normal; cursor: hand; text-decoration: underline;" HREF="" onClick="CssfChange(1)"><IMG SRC="' + imgLittle + '" WIDTH="26" HEIGHT="19" BORDER="0" ALT="小"></A></TD>');
	document.write('<TD><IMG SRC="' + dir + 'common/fsize_rgt.gif" WIDTH="5" HEIGHT="19" BORDER="0" ALT=""></TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD COLSPAN="5"><IMG SRC="' + dir + 'common/fsize_btm.gif" WIDTH="170" HEIGHT="3" BORDER="0" ALT=""></TD>');
	document.write('</TR>');
	document.write('</TABLE>');
	
	document.close();
}

function CssfChange(sel){
	var cssfiles = new Array();
	cssfiles[0] = "font_big.css";
	cssfiles[1] = "font_small.css";

	if(sel != null){
		SetCookie("CSS", cssfiles[sel]);
		window.location.reload();
	}
}

function GetCookie(key){
	var tmp = document.cookie + ";";
	var index1 = tmp.indexOf(key, 0);
	if(index1 != -1){
		tmp = tmp.substring(index1, tmp.length);
		var index2 = tmp.indexOf("=", 0) + 1;
		var index3 = tmp.indexOf(";", index2);
		return(unescape(tmp.substring(index2,index3)));
	}
	return("");
}

function SetCookie(key, val){
	document.cookie = key + "=" + escape(val) + ";expires=Fri, 31-Dec-2010 23:59:59 GMT;";
}

function ClrCookie() {
	document.cookie = "CSS=;expires=Fri, 31-Dec-1978 23:59:59 GMT;";
	window.location.reload();
}

function openPopWin_GMap(address){
	var url = encodeURI("http://www.meditown.jp/map/pc.html?address=" + address);

	popupWin = window.open(url,"name",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=0,resizable=1,width=539,height=490');

	popupWin.focus();

}
