﻿var mapLocations = new Array("1", "4902 86th Circle", "Glencoe", "MN"
                   , "USA", 1, "", "", 0, 0, "");

function setmapdata(data, data1, data2, data3, data4, data5, data6, data7, data8, data9) {
    GUnload();
    mapLocations = new Array(data, data1, data2, data3, data4, data5, data6, data7, data8, data9);
    //$('#googlemap').visible = true;
    
    loadMap(true);

}
function setmap(data) {
    jQuery('#googlemap1').html('<iframe id="mapdata" name="mapframe" src="maptolocation.aspx?addressid=' + data + '" width="450px"  height="400px" frameborder="0" scrolling="auto"></iframe>');
}
function setweatherbug(data) {
//data is map object
    jQuery('#weatherbugWrapper').html( '<iframe id="weatherbug" name="weatherframe" src="http://sl.weatherbug.com?zip=' + data +  '" width="230px"  height="310px" frameborder="0" scrolling="auto"></iframe>');
}
function layAddressLow() {
    jQuery('#weatherbugWrapper').html('<div/>');
    jQuery('#googlemap1').html('<div/>'); 
}

function pageload(hash) {
    // hash doesn't contain the first # character.
    if (hash) {
        // restore ajax loaded state
        $("#load").load(hash + ".html");
    } else {
        // start page
        $("#load").empty();
    }
}

function registerSilverlight() {

    // Initialize history plugin.
    // The callback is called at ;once by present location.hash.
    var func = jQuery('#Xaml1')
    
    var content1 = func.content;
    if (!content1 == undefined) {
        $.historyInit(content1.Master.SetHistoryPageCurrent());
    }
    else {
        $.historyInit(pageload);
    }

}

function silverlightHistory(detailsurl) {
    // 
    var hash = detailsurl;
    hash = hash.replace(/^.*#/, '');
    // moves to a new page. 
    // pageload is called at once. 
    $.historyLoad(hash);
    return false;
}
         
              