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.display = (objDiv.style.display == "none" || objDiv.style.display == "")? "block" : "none";
	objDiv.style.left = getPosX(objTd);
	objDiv.style.top = getPosY(objTd) + objTd.offsetHeight   ;
	
}
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;
	}
	return curleft;

}
function getPosY(obj)
{
	var curtop = 0;
	while (obj.offsetParent)
	{
	  curtop += obj.offsetTop;
	  obj = obj.offsetParent;
	}
	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;
}