//var defaultLon = -397086;
var defaultLon = 135.3;
//var defaultLat = 290406.5098471514;
var defaultLat = 34.8;
var defaultScale = 3200000;
var aszScales=new Array('3200000','1000000','300000','100000','20000','10000');
//var aszScales=new Array('3200000','50000','10000', '5000', '4000', '3000', '2000', '1000' );
var resolution = 72;
var tilewidth = 256;
var tileheight = 256;
//var serverPath = 'http://www.geosense.co.jp/placexml1/cheetahMap/';
var serverPath = 'http://www.geosense.co.jp/map/kyoto-street/cheetahMap/';
var tileManager = 'tile.php';
var defaultMap = 'cheetahmap';
var adminAddress = "hiraoka@orkney.co.jp";

/*
 * addEvent functions
 * @author http://p2b.jp/index.php?UID=1131336575
 */
function _addEvent(obj, evType, fn){
 if(!obj["_"+evType]){
  obj["_"+evType] = [];
  if(obj["on" + evType] != null) obj["_"+evType].push(obj["on" + evType]);
  obj["on" + evType] = evokeEvent;
 } else {
  for(var i in obj["_"+evType]) if(obj["_"+evType][i]===fn) return;
 }
 obj["_"+evType].push(fn);
}

/**
 * removeEvent
 * @author http://p2b.jp/index.php?UID=1131336575
 */
function removeEvent(obj, evType, fn){
 if(obj["_"+evType]){
  for(var i in obj["_"+evType]){
   if(obj["_"+evType][i]===fn) delete obj["_"+evType][i];
  }
 }
}

/**
 * evokeEvent
 * @author http://p2b.jp/index.php?UID=1131336575
 */
function evokeEvent(e) {
 var e = e || window.event;
 for(var i in this["_"+e.type]) this["_"+e.type][i].apply(this,[e]);
}

/**
 * 点情報を格納する構造体
 * @author Toshihiro Hiraoka
 * @
 */
function point(x, y, s) {
        this.centerX = x;
        this.centerY = y;
        this.scale = s;
}

/**
 * ホストの登録をチェック
 * @author Toshihiro Hiraoka
 * @return ホストが登録されているか [true|false]
 */
function _checkHost() {
        var check;
        var host = window.location.host;
	var protocol = window.location.protocol;

return true;

	// ローカルで実行するときはチェックの対象外
	if ( protocol == "file:") {
		check = true;
		return check;
	}
        var hash = _MD5_hexhash(host + key.r);
        if ( hash == key.k ) {
                check = true;
        } else {
                check = false;
                //prompt (0, "no" + " " + host + " " + key.k + " " + key.r + " " + hash);
        }
        return check;
}

/**
 * キー文字列を格納
 */
function k(a, b) {
        this.k = a;
        this.r = b;
}

