// Constructor
GateImage = function(adress) {
    this.adress = adress;
    var req = getXMLHTTP();
    if (this.adress.length > 0) {
        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                eval(req.responseText);
            }
        }
        var url = "/Proxy.aspx?url=http://karta.hitta.se/mapstore/service/static/streetview/" + adress +"?callback=resultat="
        req.open("GET", url, false);
        req.send(null);

        if (req.readyState == 4) {
            eval(req.responseText);
        }
    }
}

GateImage.prototype.HasImage = function() {
    if (this.adress.length > 0 && resultat.imageUrl.length > 0 ){
        return true;
    }
    else {
        return false;
    }
}

GateImage.prototype.GetImgURL = function() {
    return "http://karta.hitta.se/mapstore/service/" + resultat.imageUrl;
}

GateImage.prototype.HasURL = function() {
if (this.adress.length > 0 && resultat.rt90north > 0 && resultat.rt90east > 0 && resultat.angle > 0 ) {
        return true;
    } else {
        return false;
    }
}

GateImage.prototype.GetURL = function() {
    var url = "";
    if (this.adress.length > 0) {
        var url = "http://www.hitta.se/gatubild/?gvX=" + resultat.rt90north + "&gvY=" + resultat.rt90east + "&gvH=" + resultat.angle;
    }
    return url;
}


