// Whistler Blackcomb Whats New Panel - Events
// Built September 14, 2010.  WBImedia
// Visit whistlerblackcomb.com for more information.


$(function() {

	$.get("http://www.whistlerblackcomb.com/local/xml/wn_events.xml",{},function(xml2){
      	
	// Build an HTML string
		pContentE = '';
	 	pContentE += '<table class="wn_news" width="100%" border="0" cellspacing="0">';

	  	
		// Run the function for each student tag in the XML file
		$('events',xml2).each(function(i) {
			wne1 = $(this).find("content").text();
			wne2 = $(this).find("title").text();
    		wne3 = $(this).find("link").text();


 	if (i == 3) return false;
 	
			// Build row HTML data and store in string
			mDataE = buildEvents(wne1, wne2, wne3);
			pContentE = pContentE + mDataE;
			
				});
				
		pContentE += '</table>';
		
		// Update the DIV called Content Area with the HTML string
		$("#menuFeed2").append(pContentE);
	});
});
 
 
 function buildEvents(){
	
	
	// Build HTML string and return
	output = '';
	output += '<tr>';
	output += '<tr><td>' + wne2 + '<br />' + wne1 + '</td></tr>';
	output += '<tr><td><a href="' + wne3 + '">More Information  &raquo;</a></td>';
	output += '</tr>';
	return output;
}

