// JavaScript Document


function swapNGContents(obj){
		var ngitem = obj;
		//set id of link
		ngitem.id = 'currentNGitem';
		//set id of parent div
		jQuery('#currentNGitem').parent().attr('id','curparent');
		//store image src in variable
		var currentimg = jQuery('#currentNGitem IMG').attr('src');
		//set #curNGImg src
		jQuery('#imgWindow #curNGImg').attr('src', currentimg);		
		//alert the img src
		//alert (currentimg);

		//alert the contents of the parent div
		//alert($('#curparent').html());
		//store the contents of the teaser paragraph in variable
		var teaser = jQuery('#curparent p.teaser').html() + '...<a href="' + jQuery('#curparent h1 a').attr('href') + '">more</a>';
		//set the contents of # to the teaser variable
		jQuery('#newsGallery #teaser').html(teaser);
		
		//dump variables and remove id attributes
		teaser = null;
		currentimg = null;
		jQuery('#curparent').attr('id', '');
		jQuery('#currentNGitem').attr('id' , '');
		ngitem = null;
}
jQuery(function(){
			jQuery('#imgWindow #curNGImg').attr('src' , (jQuery('#newsGallery #items .mNews a.swaper img').eq(0).attr('src')));
			var teaser = jQuery('#newsGallery #items .mNews p.teaser').eq(0).html() + '...<a href="' + jQuery('#newsGallery #items .mNews h1 a').eq(0).attr('href') + '">more</a>';
			jQuery('#newsGallery #teaser').html(teaser);
		})
