function getEvents( url ) {
    var ajaxObj = new RDAjax( 'GET' );

    // Get the events from google 
    try { ajaxObj.submitRequest( url, false ); }
    catch( e ) { 
        alert( e.message );
        exit();
    }
    
    var listElem = ajaxObj.getElementForId( 'prUpcomingEventsList' );
    while( listElem.hasChildNodes() ) { listElem.removeChild( listElem.lastChild ); }
    var node = ajaxObj.response().documentElement;
    var items = node.getElementsByTagName( 'entry' );
    if( items.length == 0 ) {
        //alert( 'no events found' );
    } else {
        for( var i = 0; ( i < items.length && i < 4 ); i++ ) {
            addItem( listElem, items[ i ] );
        }
    }
        
}

function addItem( list, entry ) {
    var ajaxObj = new RDAjax( 'GET' );
    var gd = 'http://schemas.google.com/g/2005';
    
    var item = ajaxObj.createElement( 'li' );
    
    // Set up the information link
    var link = ajaxObj.createElement( 'a' );
    link.setAttribute( 'href', entry.getElementsByTagName( 'link' ).item( 0 ).attributes.getNamedItem( 'href' ).value );
    link.setAttribute( 'target', '_blank' );

    var content = entry.getElementsByTagName( 'content' ).item( 0 ).firstChild.data;
    content = content.match( /When: (.*!?)/ )
    content = content[ 0 ].split( /\s/g );

    var title = ajaxObj.createElement( 'strong' );
    title.appendChild( document.createTextNode( entry.getElementsByTagName( 'title' ).item( 0 ).firstChild.data ) );
    link.appendChild( title );

    var p = ajaxObj.createElement( 'p' );
    p.appendChild( link );
    p.appendChild( ajaxObj.createElement( 'br' ) );
    p.appendChild( document.createTextNode( content[ 1 ] + ' ' + content[ 2 ] + ' ' + content[ 3 ] + ' ' + content[ 4 ] + ' ' + content[ 5 ] + '-' + content[ 7 ]  ) );
    item.appendChild( p );
   
    list.appendChild( item );
}

function moviePlay( mov, div ) {
    if( div == 'undefined' || div == '' ) div = 'moviePlayer';

    // Remove anything that may currently be in the moviePlayer frame
    var moviePlayer = RDGetElementForId( div );
    RDRemoveElementChildren( div );

    var url = 'http://www.bgesmartenergy.com/media/pr/MoviePlayer.swf';

    var vars = {'src':mov};
    var params =  { loop:'false', quality:'high', wmode:'transparent', allowScriptAccess:'sameDomain', swliveconnect:'true', play:'true', scale:'showall', menu:'true', base:'http://www.bgesmartenergy.com/media/pr/' }; //
    var attr = { id:div, name:div}; // , style:'display:block;' , type:'application/x-shockwave-flash'

    swfobject.embedSWF( url, div, 210, 162, '9.0.0', 'http://www.bgesmartenergy.com/media/expressInstall.swf', vars, params, attr );
}

function swfPlay( mov, div, width, height ) {
    if( div == 'undefined' || div == '' ) div = 'moviePlayer';
    if( width == 'undefined' || width == '' ) width = '100%';
    if( height == 'undefined' || height == '' ) height = '100%';

    // Remove anything that may currently be in the moviePlayer frame
    var moviePlayer = RDGetElementForId( div );
    RDRemoveElementChildren( div );

    var url = 'http://www.bgesmartenergy.com/media/pr/' + mov;

    var vars = {};
    var params =  { loop:'false', quality:'high', wmode:'transparent', allowScriptAccess:'sameDomain', swliveconnect:'true', play:'true', scale:'showall', menu:'true', base:'http://www.bgesmartenergy.com/media/pr/' }; //
    var attr = { id:div, name:div };

    swfobject.embedSWF( url, div, width, height, '9.0.0', 'http://www.bgesmartenergy.com/media/expressInstall.swf', vars, params, attr );
}

function openWindow( url, fullscreen, width, height ) {
var opts = '';

if( fullscreen == true ) opts += 'fullscreen=true';
window.open( url, '', opts );
}

<!-- BUBBLES -->
function openBubble( divId ) { RDGetElementForId( divId + 'One' ).style.display = 'none'; RDGetElementForId( divId + 'Two' ).style.display = 'block';  RDCorrectPNG();}
function closeBubble( divId ) { RDGetElementForId( divId + 'Two' ).style.display = 'none'; RDGetElementForId( divId + 'One' ).style.display = 'block'; RDCorrectPNG(); }

var idx = 0;
function rotateBubbles() {
	var bubbles = new Array( 'programResourcesBubble', 'enrollmentMapBubble' );
	
	var div = RDGetElementForId( bubbles[ idx % bubbles.length ] );
	div.style.display = 'none';
	
	idx = idx + 1;
	
	var div = RDGetElementForId( bubbles[ idx % bubbles.length ] );
	div.style.display = 'block';
		
	setTimeout( "rotateBubbles()", 5000 );
}

<!-- Calendar -->
var cal = 0;
function calendarBubble() {
	cal = new RDCalendar( 'creditCalendar', 'cal', false );
	
	cal.selectorFunction = function() {
		RDGetElementForId( 'creditCalendarText' ).style.display = 'block';
		
		var sd = new Date(); sd.setFullYear( cal.selectorForm.chooseYear.options[ cal.selectorForm.chooseYear.selectedIndex ].text, cal.selectorForm.chooseMonth.selectedIndex, cal.selectedDate );
		RDGetElementForId( 'creditCalendarDate0' ).innerHTML = cal.selectorForm.chooseMonth.options[ sd.getMonth() ].text + ' ' + sd.getDate() + ', ' + sd.getFullYear();
		sd = RDIncrementDate( sd, -3, 'day' );
		if( sd.getDay() == 0 ) sd = RDIncrementDate( sd, -1, 'day' );
		RDGetElementForId( 'creditCalendarDate1' ).innerHTML = cal.selectorForm.chooseMonth.options[ sd.getMonth() ].text + ' ' + sd.getDate() + ', ' + sd.getFullYear();
		
		if( sd.getMonth() < 5 )
			sd.setFullYear( sd.getFullYear(), 5, sd.getDate() );
		else if( sd.getMonth() > 7 )
			sd.setFullYear( sd.getFullYear() + 1, 5, sd.getDate() );
		else
			sd.setFullYear( sd.getFullYear(), sd.getMonth() + 1, sd.getDate() );
			
		RDGetElementForId( 'creditCalendarDate2' ).innerHTML = cal.selectorForm.chooseMonth.options[ sd.getMonth() ].text + ' ' + sd.getFullYear();
	}

	cal.selectorForm.chooseMonth.onchange = function() {cal.selectMonth();}
}

<!-- Thermo -->

		function features( key ) {
			var txt = '';
			
			switch( key ) {
				case 1:
					txt = '<strong>Energy Savings</strong><br />Programmable thermostats can help you save up to 15% on annual heating and cooling costs.';
					break;
				case 2:
					txt = '<strong>#1 Choice of Homeowners</strong><br />Honeywell is the leading brand in temperature control.';
					break;
				case 3:
					txt = '<strong>Cycling Event Notification</strong><br />The word &ldquo;SAVINGS&rdquo; is displayed on the thermostat when a cycling event is occurring.';
                                        RDGetElementForId( 'thermo-demo-img' ).src = 'http://www.bgesmartenergy.com/img/pr/thermo-dots-savings.png';
					break;
				case 4:
					txt = '<strong>Precise Comfort Control (+/-1 F)</strong><br />Maintains consistent comfort to the highest level of accuracy.';
					break;
				case 6:
					txt = '<strong>Real-Time Clock</strong><br />Keeps time during power failures and automatically updates for daylight savings.';
					break;
				case 7:
					txt = '<strong>Simple Programming</strong><br />Functional design makes programming the thermostat easy. Online thermostat programming will be available summer 2009.';
					break;
				case 8:
					txt = '<strong>Large, Clear Backlit Digital Display with Touchscreen Interaction</strong><br />Easy to read in any lighting condition.';
					break;
				case 9:
					txt = '<strong>Programmable Fan</strong><br />Separate indoor fan control ensures comfort in your home.';
					break;
				case 10:
					txt = '<strong>One Touch Temperature Control</strong><br />Allows you to override the program schedule at any time.';
					break;
				case 11:
					txt = "<strong>PeakRewards<span class=\"smark\">&#x2120;</span></strong> is one more way the BGE Smart Energy Savers Program<span class=\"smark\">&#x2120;</span> is helping you conserve energy, save money, and help the environment.";
					break;
				default:
					txt = "<img src=\"http://www.bgesmartenergy.com/img/pr/dot.png\" alt=\"\" />&nbsp;Move your mouse over the red areas to the left to learn more about product features.";
                                        RDGetElementForId( 'thermo-demo-img' ).src = 'http://www.bgesmartenergy.com/img/pr/thermo-dots.png';
					break;
			}
			
			RDGetElementForId( 'therminfo' ).innerHTML = txt;
		}
<!-- ENROLLMENT MAP -->

// Create a default RDAjax Object
	var ajaxObj = new RDAjax( 'GET' );
	
	// For some reason in IE6, there's already a DOM element called
	// map. So we have to nullify it, so we can use it again.
	var map = null;
	
	// We're going to center the map here
	var baltimore = new GLatLng( 39.290555,-76.609604 );
	
	// Get the total number of customers
	var prTotalCust = 0;
	
	// Here's an empty array to store the polygons
	var counties = [];
	
	// These are the colors or the map legend
	var	prLegendColors = [ '#009ada', '#4dc4cf', '#75b66a', '#fcb53d', '#f4ff00' ];    //site colors
	
	// Set the default border style
	var borderWidth = 4;
	var borderOverWidth = 6;
	var borderColor = '#FFFFFF';
	var borderOverColor = '#AAAAAA';    // blue

function prLoad( key ) {
    switch( key ) {
    	case 'calendar-bubble':
    		calendarBubble();
    		break;
        case 'thermo-map':
                break;
    	case 'enrollment-map': 
    	default:
    		enrollmentMap();
    		break;
    	}
}

// Get a color from the colors array
function getColorForValue( val ) {
	if( val < 100 ) {
		return prLegendColors[ 0 ];
	} else if( val >= 100 && val < 500 ) {
		return prLegendColors[ 1 ];
	} else if( val >= 500 && val < 1000 ) {
		return prLegendColors[ 2 ];
	} else if( val >= 1000 && val < 10000 ) {
		return prLegendColors[ 3 ];
	} else {
		return prLegendColors[ 4 ];
	}
}

// Set the colors in the legend 
function setColorLegend() {
	for( var i = 0; i < prLegendColors.length; i++ ) {
		var item = ajaxObj.getElementForId( 'level' + i );
		item.style.backgroundColor = prLegendColors[ i ];
	}
}

// Mouse over a polygon
var mouseOverCounty = function( overlay ) {
	this.setStrokeStyle( {color:borderOverColor, weight:borderOverWidth } );
}

// Mouse leaves a polygon
var mouseOutCounty = function( overlay ) {
	this.setStrokeStyle( {color:borderColor, weight:borderWidth }  );
}

// Extend the polygon to store zipcode information
GPolygon.prototype.cust = 0;

// Draw the County boundaries   
var drawCounties = function( data, map ) {
	// Initialize the map boundaries
	var bounds = new GLatLngBounds();
    	
	// Get the xml file, and parse it
	var xml = GXml.parse( data );
    	
	// Get the boundaries
	var boundaries = xml.documentElement.getElementsByTagName( "boundary" );
	
        for( var i = 0; i < boundaries.length; i++ ) {
		var boundary = boundaries[ i ];
		
		// Only draw counties with installs
		if( boundary.getAttribute( 'cust' ) == 0 ) continue;
    		
		// Get the points
    	        var points = new Array();
    	        for( var j = 1; j < boundary.childNodes.length - 1; j += 2 ) {
    		     var vertex = boundary.childNodes[ j ];
    		     points.push( new GLatLng( vertex.getAttribute( 'lat' ), vertex.getAttribute( 'lng' ) ) );
   	        }

                    vertex = boundary.childNodes[ boundary.childNodes.length - 1 ];
    		     points.push( new GLatLng( vertex.getAttribute( 'lat' ), vertex.getAttribute( 'lng' ) ) );
   	        
   	    // Grab a color
   		var clr = getColorForValue( boundary.getAttribute( 'cust' ) );
   		
   		// Add up the total customers
   		prTotalCust += parseInt( boundary.getAttribute( 'cust' ) );
    	
    	// Create a polygon
   		var gon = new GPolygon( points, borderColor, borderWidth, 1, clr, 1 );
   		
   		// Add the polygon to an array so we can access it later
   		gon.county = boundary.getAttribute( 'county' );
   		gon.name = boundary.getAttribute( 'name' );
   		gon.cust = boundary.getAttribute( 'cust' );
		counties[ gon.county ] = gon;
   		
   		// Add the polygon to the map
   		map.addOverlay( gon );
   		
   		// Add the label to the map
   		var label = new RDTextMarker();
   		label.position = gon.getBounds().getCenter();
   		label.content = '<div class="countyName"><p>' +  gon.name + "</p><p>" + gon.cust + "</p></div>";
        if( gon.county == 16 ) // Prince George's County
        	label.offset = new GSize( -24, 0 );   
   		map.addRDTextMarker( label );
   		ajaxObj.getElementForId( label.id ).style.zIndex = 100002;
		
		bounds.extend( gon.getBounds().getCenter() );
   	
   		//GEvent.addListener( gon, 'mouseover', mouseOverCounty );
		//GEvent.addListener( gon, 'mouseout', mouseOutCounty );
		
		map.setCenter( bounds.getCenter(), map.getBoundsZoomLevel( bounds ) );
    }

	var text = ajaxObj.getElementForId( 'legendCust' );
	text.innerHTML = prTotalCust;
}

function enrollmentMap() {
	if( GBrowserIsCompatible() ) {
			
		// Set the legend's color
		setColorLegend();
	
		map = new GMap2( document.getElementById( "map" ) );
		map.addMapType( G_PHYSICAL_MAP );
		map.removeMapType( G_NORMAL_MAP );
		map.removeMapType( G_SATELLITE_MAP );
		map.removeMapType( G_HYBRID_MAP );
		map.disableDragging();
		map.disableDoubleClickZoom();
		map.disableContinuousZoom();
		map.disableGoogleBar();
		map.disableScrollWheelZoom();
				
		//map.addControl( new GSmallMapControl() );
		//map.addControl( new GMapTypeControl() );
		map.setCenter( baltimore, 9 );
		map.clearOverlays();
			
		GDownloadUrl( "http://www.bgesmartenergy.com/peakrewards/google-maps/county", function( data ) { drawCounties( data, map ) } );
  	} else {
  		map = ajaxObj.getElementForId( 'map' );
  		map.innerHTML = "<p>Unfortunately, your browser is incompatible with Google Maps.</p>";
  	}
}

