//Copyright (C) Kazuhide Senda. All Rights Reserved.
//JavaScript program
//js_name: popup.js
//The copyright of this program maintains by Kazuhide Senda and does not abandon the right.
//Browser which can be inspected and the version.
//Netscape Communicator 4 later and Internet Explorer 4 later.
//However, it is not in the one to necessarily guarantee operation by the above-mentioned browser and the version.

//====== NO! ERROR SCRIPT MESSAGE (Netscape Communicator 3 later and Internet Explorer 4 later.) ======
//====== web_error off / local_error off ======
//if (document.URL!=null) onerror = new Function("return true");
//====== web_error off / local_error on ======
var L=location+"";
if ((L.indexOf("file://")<0) && (document.URL!=null))onerror = new Function("return true");

//オートポップアップ・表示

//====== AUTO NEW MARK POP UP PROGRAM ====
//
//====== START Manual for html tags ======
//<!--AUTO NEW MARK POP UP-->
//<SCRIPT>whatMark(2007,10,31,0);</SCRIPT>
//<SCRIPT>whatMark(2007,10,31,1);</SCRIPT>
//====== END   Manual for html tags ======


//TYPE 1
/*
function whatMark(year,month,day) {
         update = new Date(year,month-1,day);
         newday = new Date();
         spanday = (newday - update) / (60*60*24*1000);
         if (spanday <= 30) { //day setting
             document.write("<SPAN TITLE='NEW !'><IMG SRC='image/new.gif'></SPAN>");}
         }
*/



//TYPE 2
var need = 30; //NEW，UPを表示する日数
var color = "#FF3366";  //色
var color2 = "#0066FF"; //色2

var _dom = (document.all?3:(document.getElementById?1:(document.layers?2:0)));
function whatMark(y,m,d,up) {
var rd = new Date(y,m-1,d+need);
var td = new Date();
var wn;
if (rd.getTime() > td.getTime()) {
if (_dom == 1 || _dom == 3) {
    //if (up) wn = '<FONT color="'+color+'" title="'+y+', '+m+'/'+d+'" style="cursor:help"><B>UP</B><'+'/FONT>';
    //if (up) wn = '<FONT color="'+color+'" title="'+y+', '+m+'/'+d+'" style="cursor:help"><IMG SRC="image/cool.gif"><'+'/FONT>';
    if (up) wn = '<FONT color="'+color+'"><SPAN TITLE="NICE !"><IMG SRC="image/cool.gif"></SPAN><'+'/FONT>'; //image only
    //if (up) wn = '<FONT color="'+color+'" title="'+m+'/'+d+'" style="cursor:help"><IMG SRC="image/cool.gif"><'+'/FONT>';

    //else wn = '<FONT color="'+color+'" title="'+y+', '+m+'/'+d+'" style="cursor:help"><B>NEW</B><'+'/FONT>';
    else wn = '<FONT color="'+color+'" title="'+y+', '+m+'/'+d+'" style="cursor:help"><IMG SRC="image/new.gif"><'+'/FONT>';}
    //else wn = '<FONT color="'+color+'" title="'+m+'/'+d+'" style="cursor:help"><IMG SRC="image/new.gif"><'+'/FONT>';}
    else {
          if (up) wn = '<FONT color="'+color+'"><B>UP</B><'+'/FONT>';
          else wn = '<FONT color="'+color+'"><B>NEW</B><'+'/FONT>';}
               document.write(wn);}
}

