/**
 * @brief This function moves the content UP if there is no header image on the page. 
 */
function moveContent() 
{
	// if there is no header image, move the content up
	if(document.getElementById("hdr-img") == null )
	{
		//if(document.getElementById("sub") != null ) {
			// move the 'sponsors' column up
			document.getElementById("sponsors").style.marginTop = "35px";
			// move top of the content container up
			document.getElementById("pageBody-top").style.marginTop = "45px";
			// move the page header up
			if (document.getElementById("page-hdr") != null)
			{
			document.getElementById("page-hdr").style.marginTop = "-70px";
			}
		//}
	}
}

/**
 * @brief This function moves the content UP if there is no header image on the page. Will only be called if using IE6. (need different margins)
 */
function moveContent_ltie7()
{
	// if there is no header image, move the content up
	if(document.getElementById("hdr-img") == null )
	{
		if(document.getElementById("sub") != null ) {
			// move the 'sponsors' column up
			document.getElementById("sponsors").style.marginTop = "60px";
			// move top of the content container up
			document.getElementById("pageBody-top").style.marginTop = "80px";
			// move the page header up
			document.getElementById("page-hdr").style.marginTop = "-82px";
		}
	}
}

/**
 * The following set of functions are used with the jQuery jCarousel
 * to create a 'circular' carousel (i.e. goes back to beginning when reaches end).
 */
function carousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a given index who is out of the actual item range.
    var idx = carousel.index(i, carousel_itemList.length);
    carousel.add(i, carousel_getItemHTML(carousel_itemList[idx - 1]));
}
function carousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
}
function carousel_getItemHTML(item)
{
    return '<img src="' + item.url + '" width="'+ item.width +'" height="'+ item.height +'" border="0" alt="' + item.title + '" />';
}
