//--------------------------------------------------------Global---------------------------------------------------------
//--------------------------------------------------------Global---------------------------------------------------------

function YnetAPI(frameID){

  	this.ServerDomain = "ynet1.emap.co.il";
  	this.YNET_2003_SERVICE = "2003";
	this.YNET_2006_SERVICE = "2006";
	this.YNET_2009_SERVICE = "2009";
	this.URL = "http://" + this.ServerDomain + "/ynet/eMapFrame.htm";

    if(YnetAPI.instance != null)
        return YnetAPI.instance;
    YnetAPI.instance = this;

    if(frameID!=null){
        this.frame = document.getElementById(frameID);
	}
        //this.service = "ynet" + suffix;
    this.service = this.YNET_2003_SERVICE;
}

YnetAPI.instance = null;

YnetAPI.prototype.ChangeStyle = function(name)
{
    if (name!=null) {
       this.service = name;
       this.frame.src = this.URL + "#M0:::srv::" + this.service;
    }

}

YnetAPI.prototype.ZoomToXY = function(x, y, level)
{
    var m ="";

    if (x != null && y != null) {
        //this.map.CenterAt(x , y);
        m += "cntr::" + x + "," + y;
    }

    if (level != null) {
        m += "," + level;
    }

    this.frame.src = this.URL + "#M0:::" + m ;
    //this.map.RefreshMap();
}

