$(document).ready(function() {
	/// _btm_ddn_configurator is a predefined object for configuring the widget.


        _btm_ddn_configurator.NavBarStripIMG = "/images/hanoverrealty/site/template/navbg.png"; 
        _btm_ddn_configurator.NavBarStripFullHeight = 80; 
        _btm_ddn_configurator.NavWrapperCSSName = "nav"; 
        _btm_ddn_configurator.SubMenusCSSName = "sf-menu";


	/// _btm_sub_menu_configurator is a predefined object for configuring the sub menus.

        _btm_sub_menu_configurator.OverallStyle = "Color: #999; text-align: Left; text-transform:none; " +
            "font-size:12px;";
         _btm_sub_menu_configurator.BackgroundStyleOff = "border-bottom: 1px dotted #999; background-image:none; " +
            "text-decoration:none; " +
	        "color:#999; background-color:#fff;";
         _btm_sub_menu_configurator.BackgroundStyleOn = "background: #3399FF; color:#fff;"; 
        _btm_sub_menu_configurator.DistanceTop = 30;  // Pixels 
        _btm_sub_menu_configurator.ItemPadding = 6;    // Pixels 
        _btm_sub_menu_configurator.ItemWidth = 150;    // Pixels 

	/// THOSE ARE ALL THE STYLES YOU WILL HAVE TO DEAL WITH, AT ALL !!
	/// ISN'T THAT COOL !!


        _QuickBar_SetUp(); 

        FishItUp(); 
 

$.get("/CommonAssets/WebRequests.aspx?u=http%3a%2f%2fapi.wunderground.com%2fauto%2fwui%2fgeo%2fWXCurrentObXML%2findex.xml&p=query%3dKILM", {}, 
function(xml) {
      	
		var myHTMLOutput = '';
		// Run the function for each student tag in the XML file
		$('current_observation',xml).each(function(i) {			
			var weather = $(this).find("weather").text();
			var temp = $(this).find("temperature_string").text();
			var icon = $(this).find("icon").text();
			// Build row HTML data and store in string
			var mydata = '<img src="http://icons.wunderground.com/graphics/conds/' + icon + '.gif" />' + 'Wilmington, NC<br>'
			+ weather + ' ' + temp; //BuildStudentHTML(studentName);
			myHTMLOutput = myHTMLOutput + mydata;		
		});		
		// Update the DIV called Content Area with the HTML string
		$("#Temp").append(myHTMLOutput);
	 }); 
							 

    });
    function FishItUp() {

        var nav = _btm_ddn_configurator.NavWrapperCSSName;
        var subMenu = _btm_ddn_configurator.SubMenusCSSName;


        $("ul." + subMenu).superfish({
            delay: 1000,                            // one second delay on mouseout 
            animation: { opacity: 'show', height: 'show' },  // fade-in and slide-down animation 
            // speed:       'fast',                          // faster animation speed 
            autoArrows: false,                           // disable generation of arrow mark-up 
            dropShadows: true                            // disable drop shadows
         });

        generateSprites("." + nav, "current-", true, 300, "fade" );

		
	/// When the runtime reaches here, everything should be working.

    } 