var lastTD = "";
function onmouseOverDiv(obj,className)
{
	obj.style.display = 'block';
	lastTD.className = className;
}
function onmouseOutDiv(obj,className)
{
	obj.style.display = 'none';
	lastTD.className = className;
}
function showSubMenu(objTd , name)
{
	lastTD=objTd;  // last td on menu bar
	var objDiv = document.getElementById(name);
	objDiv.style.left = getPosX(objTd) + "px";
	objDiv.style.top = getPosY(objTd) + objTd.offsetHeight + "px";
	objDiv.style.display = (objDiv.style.display == "none" || objDiv.style.display == "")? "block" : "none";
	
}
function hideMenu(name)
{
	var objDiv = document.getElementById (name);
	objDiv.style.display = "none";
}
function getPosX(obj)
{
	var curleft = 0;
	while (obj.offsetParent)
	{
	  curleft += obj.offsetLeft;
	  obj = obj.offsetParent;
	  if(obj==document.getElementsByTagName('body')[0]){break};
	}
	return curleft;

}
function getPosY(obj)
{
	var curtop = 0;
	while (obj.offsetParent)
	{
	  curtop += obj.offsetTop;
	  obj = obj.offsetParent;
	  if(obj==document.getElementsByTagName('body')[0]){break};
	}
	return curtop;

}
function changeColor(obj,color)
{
    var ob=document.getElementById(obj);
    if(ob != null)
    {
        ob.style.backgroundColor = color;
    }

}

function hideTitle(id)
{
  var title = document.getElementById(id);
  title.className="Menu1off";
}

function doMenu2off(obj)
{
 obj.className='Menu2off';
}

function doMenu2on(obj)
{
 obj.className='Menu2on';
}


function doBox1off(obj)
{
 obj.className='Box1off';
}

function doBox1on(obj)
{
 obj.className='Box1on';
}




function show_artwork(ID, link)
{
 url = "artwork.asp?ID=" + ID;
 if (link == 'true') url = url + "&link=true";
 window.open(url,"theWin","toolbars=0,manubar=0,scrollbars=1,directories=0,location=0,resizable=1,width=530,height=530,left=70,top=20");
}


function enlargeImage(theSection, theImage)
{
 url = "enlarge_image.asp?theSection=" + theSection + "&theImage=" + theImage;
 window.open(url,"imgWin","toolbars=0,manubar=0,scrollbars=1,directories=0,location=0,resizable=1,width=530,height=530,left=170,top=30");
}


function projectImage(itemID, imageID)
{
 url = "project_image.asp?ID="+ itemID +"&imageID=" + imageID;
 window.open(url,"imgWin","toolbars=0,manubar=0,scrollbars=1,directories=0,location=0,resizable=1,width=530,height=530,left=170,top=30");
}

function newsImage(itemID, imageID)
{
 url = "news_image.asp?ID="+ itemID +"&imageID=" + imageID;
 window.open(url,"imgWin","toolbars=0,manubar=0,scrollbars=1,directories=0,location=0,resizable=1,width=530,height=530,left=170,top=30");
}

function hebrewPage(url)
{
 window.open(url,"imgWin","toolbars=0,manubar=0,scrollbars=1,directories=0,location=0,resizable=1,width=530,height=530,left=170,top=30");
}

function goArtist(artistID)
{
 self.close();
 window.opener.location = "artist.asp?ID=" + artistID;
}



var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"

function showLarge(){
	if(!ns && !ie && !w3) return;
	if (ie){
	 documentWidth=truebody().offsetWidth/2+truebody().scrollLeft-20;
	 documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;
	}
	if (ns){
	 documentWidth=window.innerWidth/2+window.pageXOffset-20;
	 documentHeight=window.innerHeight/2+window.pageYOffset-20;
	} 
	if (w3){
	 documentWidth=self.innerWidth/2+window.pageXOffset-20;
	 documentHeight=self.innerHeight/2+window.pageYOffset-20;
	} 
    document.getElementById("overlayDiv").style.display="block";
	document.getElementById("largeDiv").style.left=0+calunit;
	document.getElementById("largeDiv").style.top=documentHeight-250+calunit;
    document.getElementById("largeDiv").style.display="block";
}

function closeLarge(){
	document.getElementById("largeDivContentImg").src="../images/pixel.gif";
    document.getElementById("largeDiv").style.display="none";
    document.getElementById("overlayDiv").style.display="none";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}

function Enlarge(theImag){
	document.getElementById("largeDivContentImg").src=theImag;
	showLarge();
}


function doShowHide(divID)
{
	var divIDStyle = document.getElementById(divID).style;
	if(divIDStyle.display=="block") divIDStyle.display="none";
	else divIDStyle.display="block";
}

