$(document).ready(function(){

	$('#jQueryUIAccordion3').accordion({
		header: '.ui-accordion-link',
		autoheight: false
	});
	
	
	if ( $("#socialBookmarkURL").length > 0 ) thisURL = $("#socialBookmarkURL").val();
	else thisURL = window.location.href;
  if ( $("#socialBookmarkTitle").length > 0 ) thisTitle = $("#socialBookmarkTitle").val();
	else thisTitle = document.title;
	
	$('#news_sbookmarks').bookmark({
		customURL: thisURL,
		customTitle: thisTitle,
    sites: ['google', 'facebook', 'myspace', 'delicious', 'digg', 'yahoo', 'reddit', 'slashdot'], 
		icons: '/ScriptLibrary/jquery/plugins/bookmarks/bookmarks.png', 
		iconSize: 16,  
		target: '_blank',  
		compact: false,   
		addFavorite: false, 
		favoriteText: 'Favorite', 
		favoriteIcon: 0, 
		addEmail: false, 
		emailText: 'E-mail', 
		emailIcon: 1, 
		emailSubject: 'Interesting page', 
		emailBody: 'I thought you might find this page interesting:\n{t} ({u})', 
		manualBookmark: 'Please close this dialog and\npress Ctrl-D to bookmark this page.'
	});

});

function ajaxLoadItem(itemID,pageID) {
  url = "/module.php?name=news/news.php&params=action|article|item|"+itemID+"|page|"+pageID;
  $('#news_article').html('<div class=\"preloadMsg\">Loading news article...</div>');
  $('#news_article').load(url);
}

function ajaxPageIndex(pageID, itemID) {
  
  url = "/module.php?name=news/news.php&params=action|index|item|"+itemID+"|page|"+pageID+"&template=news/news_list.tpl";
  $('#news_index').fadeOut(400, function () {
    $('#news_index').load(url);
    $("#news_index").fadeIn(400);
    $.scrollTo("#news_index", 300 );
    return false;
  });
  
}
