function counter(id, db, f) {
	var ref, x, y, url;
	if (f==1) {
		ref = parent.document.referrer;
	}else{
		ref = document.referrer;
	}

//cookie
	var cookiename = 'COUNTER_CLIENT_' + id + '_' + db;
	var c_value = getCookie(cookiename);
	if (!c_value) {
		var today = new Date();
		var expireperiod=1000*60*60*24*365*15;   // —LŒøŠúŠÔ( msec )
  		var expires=today;
		c_value = today.getTime();
    		expires.setTime(today.getTime()+expireperiod);
    		setCookie(cookiename, c_value, expires);
	}

	x 	= screen.width;
	y 	= screen.height;
	url = '<a href=http://www.lagoon-net.com/ target=blank><img border=0 src=http://www.lagoon-net.com/cgi/counterv2.cgi?m_id=';

//	if (id=='lagoon-net') {
			url = '<a href=http://www.lagoon-net.com/ target=blank><img border=0 src=http://www.access.lagoon-net.com/cgi/counterv2.cgi?m_id=';
//	}

//	if (id=='lagoon-net' && db=='N14') {
//			url = '<a href=http://www.lagoon-net.com/ target=blank><//img border=0 src=http://www.access.lagoon-net.com/cgi/counterv2_speedy.cgi?m_i//d=';
//	}

	ref = ref.replace(/\&/g,"amp::");

	url = url + id;
	url = url + '&m_db=' + db;
	url = url + '&m_reffer=' + ref;
	url = url + '&m_width=' + x;
	url = url + '&m_height=' + y;
	url = url + '&m_js=1';
	url = url + '&m_cookie=' + c_value;
	url = url + ' alt=lagoon-net counter></a>';

	if (id=='lagoon-net' && db == 'N17') {
			url = '';
	}

	document.write(url);
}

function getCookie(name){
  var search = name + '=';
  if (document.cookie.length>0) {
    offset = document.cookie.indexOf(search);
    if (offset != -1){
      offset += search.length;
      end     = document.cookie.indexOf(';',offset);
      if(end == -1)
        end = document.cookie.length;
      return unescape(document.cookie.substring(offset,end));
    }
  }
  return null;
}

function setCookie(name,value,expire){
  document.cookie = name + '=' + escape(value)
    + ((expire==null)?'':('; expires='+expire.toGMTString()));
}

function jump() {

	url = "http://www2s.biglobe.ne.jp/~lagoon/404a.htm";
	location.href = url;

}
