// client.js



// Current Date Generator
$(function() { 
	var currentYear = (new Date).getFullYear();
    $("#Year").text( (new Date).getFullYear() );
});



// AddThis
function addAddThis()
{
	var urlToUse = (("https:" == document.location.protocol) ? "https://secure.addthis.com/js/250/addthis_widget.js?pub=askeries" : "http://s7.addthis.com/js/250/addthis_widget.js?pub=askeries");
	$("div.AddThis").append("<!-- AddThis Button BEGIN -->" +
		"<script type=\"text/javascript\">var addthis_pub = 'askeries';</script>" +
		"<a href=\"http://www.addthis.com/bookmark.php?v=250&pub=askeries\" onclick=\"return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\">" + 
		"<img class=\"Left\" src=\"/imgs/addthis.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Share\" /> " +
		"Share This Page" +
		"</a>" +
		"<script type=\"text/javascript\" src='" + urlToUse + "'></script>" +
		/*
		"<a href=\"http://www.addthis.com/bookmark.php?v=250&pub=averaaddthis\" onmouseover=\"return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\">" +
		"<img src=\"/imgs/lg-share-en.gif\" width=\"125\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0\"/></a>" +
		"<script type=\"text/javascript\" src='" + urlToUse + "'></script>" +*/
		"<!-- AddThis Button END -->");
}

try
  {
	$(addAddThis);
  }
catch(err)
  {
	// if error, allow the page to load anyway
  }
  
  
  
  //Accordion
$(document).ready(function() {
    //initialize Accordion
    $('.Accordion>div').addClass('Payload').hide(); // Adds a class to the top-level DIVs -- this it hides them all
    $('.Accordion>:header').addClass('Trigger'); // Adds a class to headers and the css for the pointer
    $('.Accordion .Trigger').live("click", function() {
        $(this).next('.Payload').slideUp(200).prev('.Trigger').removeClass('Active').parent().not($('.Independent')).not($('.ExpandAll')).children('.Payload').slideUp(200).prev('.Trigger').removeClass('Active');
        $(this).next('.Payload:hidden').slideDown(200).prev('.Trigger').addClass('Active');
    });
    $('.Accordion.ExpandAll>div').show(); // Expand all Payloads if Accordion marked with 'ExpandAll'
    $('.Accordion[class*="StartOn"]').each(function() { // If class="Accordion StartOn2" then find it and show it...
        var slide = $(this).attr('class').split('StartOn')[1] - 1;
        $(this).children('.Payload:eq(' + slide + ')').show();
    });
    $('.Accordion.ShowLast').each(function() { $(this).children('.Payload:last').show(); }); // If class="Accordion ShowLast" then show last Payload...
    $('span.ExpandAll').click(function() { $(this).parents().next('.Accordion').addClass('Independent').children('.Payload').slideDown(200).prev('.Trigger').addClass('Active'); }); // Expand All external control - expands all Payloads in the NEXT Accordion
    $('span.CollapseAll').click(function() { $(this).parents().next('.Accordion').removeClass('Independent').children('.Payload').slideUp(200).prev('.Trigger').removeClass('Active'); }); // Expand All collapses control - collapses all Payloads in the NEXT Accordion
});