
$(document).ready(function(){

    $('#hrefPrintPage').click(function() {
        window.print();
        return false;
    });

    $('.view-newsletter').click(function() {
        // display newsletter in popup window
        var url = $(this).attr('href');
        openPopupWindow(url, 'newsletter', 745, 550);
        return false;
    });
    
    $('#btnSiteSearch').click(function() {
        $('form[name="frmSiteSearch"]').submit();
    });

    $('div.expand-content').hide();
    $('div.expand-collapse').toggle(function() {
        $(this).find('img').attr('src','/assets/images/expanded.png');
        $(this).next('div.expand-content').slideDown('fast');
    }, function() {
        $(this).find('img').attr('src','/assets/images/collapsed.png');
        $(this).next('div.expand-content').slideUp('fast');
        return false;
    });
});

function openPopupWindow(url, window_name, width, height)
{
    if (window_name == '') {
        window_name = 'popup';
    }
    var win = window.open(url,window_name,'width='+width+',height='+height+',top='+(screen.height-height)/2+',left='+(screen.width-width)/2+',scrollbars=yes,resizable=yes,location=no,toolbar=no,status=yes');
    win.focus();
}

function ChangeColor(tableRow, highLight)
{
	if (highLight)
	{
		tableRow.style.backgroundColor = '#efefef';
		tableRow.style.cursor="hand";
	}
	else
	{
		tableRow.style.backgroundColor = 'white';
		tableRow.style.cursor="pointer";
	}
}

function DoNav(theUrl)
{
	document.location.href = theUrl;
}