﻿// OPEN WINDOWS ROUTINES
        
    function openSchools(zip){
        var url = "http://maps.nycboe.net/index.asp?txtZipCode={zip}&validZiptrue={zip}&search=3#Amap";
        url = url.replace(/\{zip\}/g, zip);
        var infoWin = window.open(url);
    }

    function openCommunities(street1, street2, boro){
        var url = "http://gis.nyc.gov/doitt/mp/Intersection.do?brand=NYC&strName={street1}&strName2={street2}&boro={boro}";
        url = url.replace('{street1}', street1).replace('{street2}', street2).replace('{boro}', boro);
        var infoWin = window.open(url);
    }
    
    function openInfo(type, zip){
        var infoWin = window.open("http://www.onboardnavigator.com/webcontent/OBWC_Results.aspx?AID=243-d208aeec01a5&DataType=" + type + "&State=NY&Zip=" + zip);
    }
    
    function openEmailAgent(id, webID) {
        var myWin = window.open(ApplicationPath + "/Content/Company/EmailToAgent.aspx?agentID=" + id + "&webID=" + webID, "openEmailAgent", "width=400,height=500,status=no,toolbar=no,menubar=no");
    }

    function openEmailMe(id) {
        var myWin = window.open(ApplicationPath + "/Content/Company/EmailToMe.aspx?IDs=" + id, "openEmailMe", "width=500,height=300,status=no,toolbar=no,menubar=no");
    }

    function openEmailFriend(id) {
        var myWin = window.open(ApplicationPath + "/Content/Company/EmailToFriend.aspx?IDs=" + id, "openEmailFriend", "width=400,height=600,status=no,toolbar=no,menubar=no");
    }

    function openEmailNotification(id, address) {
        var myWin = window.open(ApplicationPath + "/Content/Company/EmailToMeIfThisListingChanges.aspx?p=" + id + "&a=" + address, "openEmailNotification", "width=500,height=300,status=no,toolbar=no,menubar=no");
    }

    function openMap(building, street, neighborhood) {
        var myWin = window.open(ApplicationPath + "/Content/Properties/Common/Map.aspx?b=" + building + "&s=" + street + "&n=" + neighborhood, "openMap", "width=620,height=525,status=no,toolbar=no,menubar=no");
    }

    function openPhotos(propertyId) {
        if (propertyId != "")
            var myWin = window.open(ApplicationPath + "/Content/Properties/Common/Photos.aspx?propertyID=" + propertyId, "openPhotos", "width=600,height=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
    }
    
    function openPlan(planURL,propertyId) {
        if (planURL != "")    
            var myWin = window.open(ApplicationPath + "/Content/Properties/Common/Plan.aspx?planURL=" + planURL + "&propertyID=" + propertyId, "openPlan", "width=600,height=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
    }

    function openVirtualTour(propertyID) {
         var myWin = window.open(ApplicationPath + "/Content/Properties/VirtualTour.aspx?propertyID=" + propertyID, "displayWindow", "width=500,height=700,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");            
    }
    
    function openBuilding(buildingID, propertyID)
    {
        if (buildingID != "" && buildingID != 0 & propertyID != "" & propertyID != 0){
            var buildingWin = window.open(ApplicationPath + "/Content/Properties/Common/Building.aspx?buildingID=" + buildingID + "&propertyID=" + propertyID, "openBuilding", "width=780,height=790,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
            if (buildingWin)
                buildingWin.focus();
        }
    }
    
    function openCalc(id) {
        var queryStr = ApplicationPath + "/Content/MortgageCalculator.aspx?propertyID=" + id;      
        var myWin = window.open(queryStr, "openCalc", "width=600,height=580,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
    }
            
    function openViewNeighborhood(id) { 
        var myWin = window.open(ApplicationPath + "/Content/Neighborhoods/View.aspx?neighborhoodID=" + id, "NeighborhoodDescription", "width=750,height=790,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
    }

    


