function showFooter()
{
	var footerDiv = document.getElementById("footer");
	footerDiv.style.display = "block";
}



function erase(box) 
{
   if (box.defaultValue == "Word or phrase")
   box.value = "";
   if (box.defaultValue == "Your email")
   box.value = "";
}

/*

function ReloadTextDiv()
{
var NewText = document.getElementById("DynamicText").value;
var DivElement = document.getElementById("TextDisplay");
DivElement.innerHTML = NewText;
}

function redisplay()
(
var newText = document.getElementById("TextDisplay");
position = newText.innerHTML;
position = "100";
location.href=("http://www.archaeological-center.com/en/" + subsection + "/P" + position);
}

*/

function highlightIndexItem(obj,section)
{
	obj.style.background = '#FFEDD9';
	if (section != "photo" && section != "auctions")
	{
	obj.style.cursor = 'pointer';
	}
	if (section == "url")
	{
		obj.style.backgroundColor = "#B4F8AD";
	}
}

function unhighlightIndexItem(section,obj)
{

	if ((section == "sales") || (section == "auctions") || (section == "monographs") || (section == "publications") || (section == "photographs"))
	{
		$filename = "url(http://www.archaeological-center.com/images/" + section + "-index-item.jpg)";
		obj.style.backgroundImage = $filename;
	}

	obj.style.backgroundColor = "transparent";

	if (section == "frame")
	{
		obj.style.backgroundColor = "#ffffff";
	}

	if (section == "monographs")
	{
		obj.style.backgroundColor = "#ffffff";
		obj.style.backgroundPosition = "100% 0";
		obj.style.backgroundRepeat = "repeat-y";
	}
	if (section == "publications")
	{
		obj.style.backgroundImage = "none";
	}
	if (section == "auctions")
	{
		obj.style.backgroundColor = "#ffffff";
		obj.style.backgroundRepeat = "repeat-y";
	}
	if (section == "photographs")
	{
		obj.style.backgroundColor = "#ffffff";
		obj.style.backgroundRepeat = "repeat-y";
	}
	if (section == "amazon")
	{
		obj.style.background = "none";
	}
	if (section == "bookmarks")
	{
		obj.style.background = "none";
	}
}

function goIndexItem(section,item)
{location.href=("http://www.archaeological-center.com/en/" + section + "/" + item + "/");
	if (section == "header")
	{location.href=("http://www.archaeological-center.com/en/" + item + "/");
	}
}

function stretchContainerDivs() 
{
	var main = document.getElementById("main");
	var sidebar = document.getElementById('sidebar');
	var paper = document.getElementById('paper');
	var paperShadow = document.getElementById('paper-shadow');
	if (document.getElementById('bg-ac')) var bg = document.getElementById('bg-ac');
	if (document.getElementById('bg-rd')) var bg = document.getElementById('bg-rd');
	var mainHeight = main.offsetHeight;
	var sidebarHeight = sidebar.offsetHeight;
	var paperHeight = mainHeight;
	if (sidebarHeight > mainHeight) paperHeight = sidebarHeight;
	paperHeight = paperHeight + "px";
	paper.style.minHeight = paperHeight;
	paper.style.height = paperHeight;
	paperShadow.style.minHeight = paperHeight;
	bg.style.minHeight = paperHeight;
	bg.style.height = paperHeight;
}

function stretchFullContainerDivs() 
{
	var details = document.getElementById('details');
	var detailsOther = document.getElementById('details-other');
	if (detailsOther) detailsOtherHeight = detailsOther.offsetHeight;
	var detailsDescription =  document.getElementById('details-description');
	if (detailsDescription) 
	{
		var detailsDescriptionHeight = detailsDescription.offsetHeight;
		var detailsHeight = detailsOtherHeight;
		if (detailsDescriptionHeight > detailsOtherHeight) detailsHeight = detailsDescriptionHeight;
		detailsHeight = detailsHeight + "px";
		details.style.minHeight = detailsHeight;
		details.style.height = detailsHeight;
	}
	var cart = document.getElementById('cart');

	if (cart) var cartHeight = cart.offsetHeight;
	var price = document.getElementById('price');
	if (price) var priceHeight = price.offsetHeight;
	var aboveHeight = cartHeight;
	if (priceHeight > cartHeight) aboveHeight = priceHeight;
	var cap = document.getElementById('full-title');
	if (cap) var capHeight = cap.offsetHeight;
	var newHeight = capHeight + aboveHeight - 40;
	newHeight = newHeight + "px";
	if (cap) cap.style.minHeight = newHeight;
	if (cap) cap.style.height = newHeight;
}

function highlightEngaging(obj)
{
	obj.style.cursor = 'pointer';
	obj.style.backgroundImage = "url(http://www.archaeological-center.com/images/engaging.gif)";
}

function unhighlightEngaging(obj)
{
	obj.style.backgroundImage = "url(http://www.archaeological-center.com/images/bg-bottom.gif)";
}

function goEngaging()
{location.href=("http://www.engaging.net");}

function highlightXHTML(obj)
{
	obj.style.cursor = 'pointer';
	obj.style.backgroundImage = "url(http://www.archaeological-center.com/images/xhtml.gif)";
}

function unhighlightXHTML(obj)
{
	obj.style.backgroundImage = "url(http://www.archaeological-center.com/images/bg-bottom.gif)";
}

function goXHTML()
{location.href=("http://validator.w3.org/check?uri=referer");}

function overPopupLink(obj)
{
	obj.style.cursor = 'move';
}

function fakeLink(obj)
{
	obj.style.background = '#FFEDD9';
}

function fakeLinkOut(obj)
{
	obj.style.background = 'transparent';
}

function popupLink(obj)
{
	var goon = obj.id;
	var showme = goon.split("-link");
	var themoney = showme[0];
	var please = document.getElementById(themoney);
	please.style.display = "block";
	if (themoney == "catalog")
	{
		if (ie6)
		{
			var main = document.getElementById('main');
			main.style.zIndex = "-1";
			var footer = document.getElementById('footer');
			footer.style.zIndex = "-1";
		}
	}
}

function zoomOpen(obj)
{
	var big = document.getElementById(obj);
	var smallLabel = obj + "s";
	var small = document.getElementById(smallLabel);
	big.style.display = "block";
	big.innerHTML = "<img onmouseover=\"overPopupLink(this)\" onclick=\"zoomClose('" + obj + "')\"  src=\"http://www.archaeological-center.com/images/" + obj + "g.jpg\" alt=\"Click to reduce picture\" />";
	small.style.display = "none";
	stretchContainerDivs();
}

function zoomClose(obj)
{
	var big = document.getElementById(obj);
	var smallLabel = obj + "s";
	var small = document.getElementById(smallLabel);
	big.style.display = "none";
	var please = document.getElementById(obj);
	small.style.display = "block";
	stretchContainerDivs();
}

function sidebarPopupOpen(obj)
{
	var please = document.getElementById(obj);
	if (ie6)
	{
		var main = document.getElementById('main');
		main.style.zIndex = "-1";
		var bgac = document.getElementById('bg-ac');
		bgac.style.zIndex = "-1";
	}
	please.style.display = "block";
	please.innerHTML = "<img onmouseover=\"overPopupLink(this)\" onclick=\"closePopup(this,'" + obj + "')\"  src=\"http://www.archaeological-center.com/images/close-small.gif\" alt=\"Close Popup\" /><img onmouseover=\"overPopupLink(this)\" onclick=\"closePopup(this,'" + obj + "')\"  src=\"http://www.archaeological-center.com/images/ac-tellafriend.gif\" alt=\"Close Popup\" /><img onmouseover=\"overPopupLink(this)\" onclick=\"closePopup(this,'" + obj + "')\"  class=\"zoom-display\" src=\"http://www.archaeological-center.com/images/" + obj + "g.jpg\" alt=\"\" />";
}

function closePopup(obj,window)
{
	var please = document.getElementById(window);
	please.style.display = "none";
	if (ie6)
	{
		var main = document.getElementById('main');
		main.style.zIndex = "2";
		var bgac = document.getElementById('bg-ac');
		bgac.style.zIndex = "0";
		var footer = document.getElementById('footer');
		footer.style.zIndex = "150";
	}
}

function pausecomp(Amount)
{
d = new Date() //today's date
while (1)
{
mill=new Date() // Date Now
diff = mill-d //difference in milliseconds
if( diff > Amount ) {break;}}
}

function navigate()
{
	var item = document.forms.navigator.destination.value;
	if (navigatorTest())
	{location.href=("http://www.archaeological-center.com/en/auctions/" + item);
		var destination = "http://www.archaeological-center.com/en/auctions/" + item;
		var b=document.forms.navigator;
		b.action = destination;
	}
	else
	{
		alert( "\"" +  item + "\" is not a valid lot. Please use the format XX-XXX, e.g., for lot #95 in Auction 32, use \"32-095\".");
	}
}

function navigatorTest()
{
	var returnval = false;
	var item = document.forms.navigator.destination.value;
	pattern = /^\d[-]\d$/; 
	if (item.match(pattern)) returnval = true;
	return returnval;
}



function activateTellafriend()
{
	var button = document.getElementById("tell-a-friend-link-holder");
	button.innerHTML = "<img id=\"tell-a-friend-link\" onmouseover=\"overPopupLink(this)\" onclick=\"popupLink(this)\" src =\"http://www.archaeological-center.com/images/tell-a-friend.gif\" alt=\"Tell a friend\" />";
	var newText = document.getElementById("tell-a-friend-holder").innerHTML;
	var DivElement = document.getElementById("tell-a-friend");
	DivElement.innerHTML = newText;
}

function homeLink()
{location.href=("http://www.archaeological-center.com/en/");}

function showTab(area, choice)
{
	marker = document.getElementById(area + '-marker');
	previousName = marker.innerHTML;
	previousTab = document.getElementById(area + '-' + previousName);
	previousTab.style.display = "none";
	previousFrom = document.getElementById('to-' + area + '-' + previousName);
	previousFrom.style.color = "#40668C";

	chosen = document.getElementById(area + '-' + choice);
	chosen.style.display = "block";
	marker.innerHTML = choice;

	from = document.getElementById('to-' + area + '-' + choice);
	from.style.color = "#999";
	from.style.cursor = "text";
	from.style.borderBottomWidth = "0px";
	stretchContainerDivs();
}


function overTab(obj)
{
	if (obj.style.color != "#999")
	{
		obj.style.cursor = "move";
	}
}

function initTab()
{
	marker = document.getElementById('sidebar-marker');
	initial = marker.innerHTML;
	obj = document.getElementById('sidebar-' + initial );
	obj.style.display = "block";

	from = document.getElementById('to-sidebar-' + initial);
	from.style.color = "#999";
	from.style.cursor = "text";
	from.style.borderBottomColor = "#999";
	stretchContainerDivs();
}