var w = window;
function gazou(oidname){
	if ((w == window) || w.closed){
		w = open("./dev/img_disp_html.php?oid="+oidname+"","","toolbar=no,scrollbars=yes,resizable,width=400,height=400,left=100,top=100")
	}
	else {
		w.focus();
	}
}
// 確認メッセージ
function formConfirm (mess)
{   
	    rtn = confirm(mess);
          if  (rtn) {
               return true;
          }
          return false;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Set_Calendar() {

monstr = new Array();
yostr = new Array();
/*----------------*
 * 設定はここから *
 *----------------*/
var clfont     = "sans-serif";  // フォントの種類（全体共通）

var frbgcolor  = "#404040";	    // 外枠の背景色
var frborder   = 1;             // 外枠の幅
var monfnsize  = "10pt";        // 月のフォントサイズ
var frfncolor  = "#ffffff";     // 月の文字色

var inbgcolor  = "#ffffff";     // 日付部の背景色
var yobgcolor  = "#d5d5d5";     // 曜日部の背景色
var tdbgcolor  = "#fffacd";     // 本日の背景色
var dwidth     = 24;            // 日付・曜日欄の幅
var dheight    = 10;            // 日付・曜日欄の高さ
var dayfnsize  = "9pt";         // 日付と曜日のフォントサイズ
var dayfncolor = "#333333";     // 平日の文字色（曜日・日付共通）
var kdfncolor  = "#FF0000";     // 日曜・休日の文字色（曜日・日付共通）
var kdbgcolor  = "#FFB6C1";     // 日曜・休日の背景色
var ndstr      = "・";          // 日付なし欄に出す文字
var ndfncolor  = "#cccccc";     // 日付なし欄の文字色
var hayacolor  = "#CCCC99";     // 発送休みの背景色

// 月の表示文字
monstr[0]  = "1月の営業カレンダー";    //  1月
monstr[1]  = "2月の営業カレンダー";   //  2月
monstr[2]  = "3月の営業カレンダー";      //  3月
monstr[3]  = "4月の営業カレンダー";      //  4月
monstr[4]  = "5月の営業カレンダー";        //  5月
monstr[5]  = "6月の営業カレンダー";       //  6月
monstr[6]  = "7月の営業カレンダー";       //  7月
monstr[7]  = "8月の営業カレンダー";     //  8月
monstr[8]  = "9月の営業カレンダー";  //  9月
monstr[9]  = "10月の営業カレンダー";    // 10月
monstr[10] = "11月の営業カレンダー";   // 11月
monstr[11] = "12月の営業カレンダー";   // 12月

// 曜日の表示文字
yostr[0] = "日";  // 日曜
yostr[1] = "月";  // 月曜
yostr[2] = "火";  // 火曜
yostr[3] = "水";  // 水曜
yostr[4] = "木";  // 木曜
yostr[5] = "金";  // 金曜
yostr[6] = "土";  // 土曜

/*----------------*
 * 設定はここまで *
 *----------------*/
//for test
var test = 0;	// 1:testmode on
var testyear = 2003;  // year for test
var testmonth = 9;    // month for test
var testday = 1;      // day for test
//
maxday = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var date = new Date();
var datenow = new Date();
//if (test == 1) { date.setYear(testyear); date.setMonth(testmonth-1); date.setDate(testday); }
var year = date.getFullYear();
for(mon1 = 1; mon1 < 2; mon1++){
	var month = date.getMonth() + mon1;
	if (month == 13){month = 1 ; year++}
	var today = date.getDate();
	date.setYear(year);
	date.setMonth(month-1);
	date.setDate(1);
	if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { maxday[1]++; }
	date.setDate(1);
	var yo1 = date.getDay();
	var flag = 0;
	var daycnt = 1;
	var moncnt = 0;
	var yasumi, syuku, furi,hayasumi;
	document.write('<table border="0" bgcolor="' + frbgcolor + '" cellpadding="' + frborder + '" cellspacing="0">');
	document.write('<tr><td align="center">');
	document.write('<span style="font-family:' + clfont + ';font-size:' + monfnsize + '">');
	document.write('<font color="' + frfncolor + '"><b>'
	  + monstr[month-1] + '<\/font><\/b><\/span><br>');
	// 曜日欄
	document.write('<table border="1" bgcolor="' + inbgcolor + '" cellpadding="0" cellspacing="0">');
	document.write('<tr bgcolor="' + yobgcolor + '">');
	for (yo = 0; yo < 7; yo++) {
	  document.write('<td width="' + dwidth + '" height="' + dheight + '" align="center" ');
	  document.write('<span style="font-family:' + clfont + ';font-size:' + dayfnsize + '">');
	  if (yo == 0) { document.write('<font color="' + kdfncolor + '"><b>'); }
	    else { document.write('<font color="' + dayfncolor + '">'); }
	  document.write(yostr[yo]);
	  if (yo == 0) { document.write('<\/font>'); }
	  document.write('<\/span>');
	  document.write('<\/td>');
	}
	document.write('<\/tr>');
	while (flag < 2) {
	  document.write('<tr>');
	  for (yo = 0; yo < 7; yo++) {
	    document.write('<td width="' + dwidth + '" height="' + dheight + '" align="center"');
	    if (flag == 0 && yo1 == yo) { flag = 1; }	// 1日
	    if (flag == 1) {	// 日付あり
	      if(month == datenow.getMonth()+1){
		      if (daycnt == today) {
		        document.write('bgcolor="' + tdbgcolor + '"');	// 本日の背景設定
		      }
	     }
	      //document.write('>');
	      //document.write('<span style="font-family:' + clfont + ';font-size:' + dayfnsize + '">');
	      yasumi = 0;
	      syuku = 0;
	      hayasumi = 0;


		/*アルファホーム専用 (通常の祝日はすべて営業日）

	      // 月曜に関する処理 (Happy Mondayと振替休日)
	      if (yo == 1) {
	        if (furi == 1) {
	          yasumi = 1;
	          furi = 0;
	        }
	        if (++moncnt == 2) {	// 第2月曜
	          if (month == 1) { syuku = 1; }	// 1月 成人の日
	          if (month == 10) { syuku = 1; }	// 10月 体育の日
	        }
	        if (moncnt == 3) {		// 第3月曜
	          if (year >= 2003 && month == 7) { syuku = 1; } 	// 7月 海の日 (2003～)
	          if (year >= 2003 && month == 9) { syuku = 1; } 	// 9月 敬老の日 (2003～)
	        }
	      }

	      // Happy Monday以外の祝日に関する処理
	      if (month == 1 && daycnt == 1) { syuku = 1; }		//  1月 1日 元日
	      // if (month == 2 && daycnt == 11) { syuku = 1; }	//  2月11日 建国記念の日
	      if (month == 3) {
	        if (daycnt == Math.floor(20.8431+0.242194*(year-1980))-Math.floor((year-1980)/4)) {
	          syuku = 1;	// 春分の日
	        }
	      }
	      if (month == 4 && daycnt == 29) { syuku = 1; }	//  4月29日 みどりの日
	      if (month == 5 && daycnt == 3) { syuku = 1; }		//  5月 3日 憲法記念日
	      if (month == 5 && daycnt == 4) { syuku = 1; }		//  5月 4日 国民の休日
	      if (month == 5 && daycnt == 5) { syuku = 1; }		//  5月 5日 こどもの日
	      if (month == 9) {
	        if (daycnt == Math.floor(23.2488+0.242194*(year-1980))-Math.floor((year-1980)/4)) {
	          syuku = 1;	// 秋分の日
	        }
	      }
	      if (month == 11 && daycnt == 3) { syuku = 1; }	// 11月 3日 文化の日
	      if (month == 11 && daycnt == 23) { syuku = 1; }	// 11月23日 勤労感謝の日
	      if (month == 12 && daycnt == 23) { syuku = 1; }	// 12月23日 天皇誕生日
	      if (year < 2003 && month == 7 && daycnt == 20) { syuku = 1; }	// 7月20日 海の日 (～2002)
	      if (year < 2003 && month == 9 && daycnt == 15) { syuku = 1; }	//  9月15日 敬老の日 (～2002)

	      //連休
	      if (month == 3 && daycnt == 17) { syuku = 1; }	// 3月 17日
	      if (month == 4 && daycnt == 21) { syuku = 1; }	// 4月 21日
	      if (month == 4 && daycnt == 30) { syuku = 1; }	// 4月 21日
	      if (month == 6 && daycnt == 16) { syuku = 1; }	// 6月 16日
	      if (month == 7 && daycnt == 14) { syuku = 1; }	// 6月 14日
	      if (month == 9 && daycnt == 15) { syuku = 1; }	// 9月 15日
	      if (month == 9 && daycnt == 20) { syuku = ''; }	// 9月 21日
	      if (month == 9 && daycnt == 14) { syuku = 1; }	// 9月 24日
	      if (month == 10 && daycnt == 20) { syuku = 1; }	// 10月 20日
	      if (month == 10 && daycnt == 12) { syuku = ''; }	// 10月 12日
	      if (month == 11 && daycnt == 3) { syuku = ''; }	// 11月 3日
	      if (month == 11 && daycnt == 23) { syuku = ''; }	// 11月 23日
	      if (month == 11 && daycnt == 17) { syuku = 1; }	// 11月 3日
	      if (month == 12 && daycnt == 24) { syuku = 1; }	// 12月 24日
	      if (month == 12 && daycnt == 31) { syuku = 1; }	// 12月 31日
	      if (month == 12 && daycnt == 29) { syuku = 1; }	// 12月 29日
		*/

	      //年末年始の休日
	      if (month == 12 && daycnt == 28) { syuku = 1; }	// 12月 28日
	      if (month == 12 && daycnt == 29) { syuku = 1; }	// 12月 29日
	      if (month == 12 && daycnt == 30) { syuku = 1; }	// 12月 30日
	      if (month == 12 && daycnt == 31) { syuku = 1; }	// 12月 31日
	      if (month == 1 && daycnt == 1) { syuku = 1; }	// 1月 1日
	      if (month == 1 && daycnt == 2) { syuku = 1; }	// 1月 2日
	      if (month == 1 && daycnt == 3) { syuku = 1; }	// 1月 3日
	      if (month == 1 && daycnt == 4) { syuku = 1; }	// 1月 4日
              //お盆休み
	      if (month == 8 && daycnt == 12) { syuku = 1; }	// 8月 12日
	      if (month == 8 && daycnt == 13) { syuku = 1; }	// 8月 13日
	      if (month == 8 && daycnt == 14) { syuku = 1; }	// 8月 14日
	      if (month == 8 && daycnt == 15) { syuku = 1; }	// 8月 15日
	      if (month == 8 && daycnt == 16) { syuku = 1; }	// 8月 16日
	      if (month == 7 && daycnt == 12) { syuku = 1; }	// 7月 12日
	      if (month == 9 && daycnt == 13) { syuku = 1; }	

	      if (month == 11 && daycnt == 22) { syuku = 1; }	



	      if (syuku == 1) { yasumi = 1; }


	      // 水曜日（日曜）に関する処理
	      if (yo == 3) {
	        yasumi = 1;
	        // if (syuku == 1) { furi = 1; }
	      }
　        if (yo == 2){
				if(++moncnt == 3) {	// 第3火曜
			        yasumi = 1;
				}
			}

//変則
	      if (month == 4 && daycnt == 29) { yasumi = 0; }	// 4月 29日
	      if (month == 9 && daycnt == 23) { yasumi = 0; }	// 9月 23日
	      if (month == 12 && daycnt == 21) { yasumi = 0; }	// 12月 21日
	      if (month == 7 && daycnt == 19) { yasumi = 0; }	// 7月 19日
	      if (month == 9 && daycnt == 20) { yasumi = 0; }	
	      if (month == 11 && daycnt == 23) { yasumi = 0; }	
	      if (month == 1 && daycnt == 17) { yasumi = 0; }	
	      if (month == 2 && daycnt == 21) { yasumi = 0; }	
	      if (month == 2 && daycnt == 14) { yasumi = 1; }	


	      if (yasumi == 1) { document.write('bgcolor="' + kdbgcolor + '"><span style="font-family:' + clfont + ';font-size:' + dayfnsize + '"><font color="' + kdfncolor + '"><b>' + daycnt + '<\/font>'); }
	        else {
			if (hayasumi == 1){ document.write('bgcolor="' + hayacolor + '"><span style="font-family:' + clfont + ';font-size:' + dayfnsize + '"><font color="' + kdfncolor + '"><b>' + daycnt + '<\/font>');}
			else { document.write('><span style="font-family:' + clfont + ';font-size:' + dayfnsize + '"><font color="' + dayfncolor + '">' + daycnt + '<\/font>');} 

		}
	      if (++daycnt > maxday[month - 1]) { flag = 2; }	// 最終日
	    } else {	// 日付なし
	      document.write('><font color="' + ndfncolor + '">' + ndstr + '<\/font>');
	    }
	    document.write('<\/span>');
	    document.write('<\/td>');
	  }
	  document.write('<\/tr>');
	}
	document.write('<\/table>');
	document.write('<\/td><\/tr><\/table><br>');
	}
}

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'onimg') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_s'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_s'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;


function setFlash(url,w,h){
	if(url.indexOf("main1.swf")>=0){
		id="flash";
		bg="#ffffff";
	}else{
		id="";
		bg="#f5f5ec";
	}
	document.open();
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + w + '" height="' + h + '" id="' + id + '">');
	document.write('<param name="movie" value="' + url + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="' + bg + '" />');
	document.write('<param name="loop" value="false" />');

	document.write('<embed loop="false" src="' + url + '" quality="high" bgcolor="' + bg + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed>');
	document.write('</object>');
	document.close();
}
function makeGrd() {
  document.body.filters['0'].gradientType = document.nForm.drc.value;
  if(document.nForm.scs.value != "")
    document.body.filters['0'].startColorStr = document.nForm.scs.value;
  if(document.nForm.ecs.value != "")
    document.body.filters['0'].endColorStr = document.nForm.ecs.value;
}



