var sAboutText = "<b><br>Noa Ben-Shalom graduated from the Bezalel Academy of Art and Design-Jerusalem in 2001.<br>Since then she participated in many group exhibitions in museums and galleries in Israel and other countries. Her work explores various aspects of the local conflict and the human structure which composes Israel.<br>In addition to her own personal work she is the curator of the Photography's Department Gallery of The Midrasha Art Academy.<br><br><a href=\"cv.doc\" style=\"font-family:verdana;font-size:12px;color:black\">Open CV</a>";
var sContactText = "<br><br><b>Telephone:</b> +972-3-6811266<br><br><b>Mobile:</b> +972-50-8269346<br><br><b>Email</b>: info@noabenshalom.com";
var SelectedPicture = null;
var TmrHideText = null;
var bBeforeFirstImage = true;
var nCurrentCachedImg = 0;
var msie=document.all?1:0 ; 
var sLinksText = "<br><br><a style=\"font-family:verdana;font-size:12px;color:black\" href=\"http://www.noasegal.com\" target=\"#\">Noa Segal</a><br><br><a style=\"font-family:verdana;font-size:12px;color:black\"href=\"http://www.joelkantor.com\" target=\"#\">Joel Kantor</a><br><br><a style=\"font-family:verdana;font-size:12px;color:black\"href=\"http://www.kowner.com\" target=\"#\"> Elyasaf kowner </a><br><br><a style=\"font-family:verdana;font-size:12px;color:black\" href=\"http://www.viewfinder.co.il\" target=\"#\">Viewfinder</a><br><br><a style=\"font-family:verdana;font-size:12px;color:black\" href=\"http://www.erev-rav.com/\" target=\"#\"> Erev-Rav </a><br><br><a style=\"font-family:verdana;font-size:12px;color:black\" href=\"http://www.maarav.org.il/classes/PUItem.php?id=228&lang=HEB\" target=\"#\">Maarav, Online Art Magazine</a><br><br><br><a</a><br><br><br><br><br><br><br><br><br>";
function showText(obj)
{

	obj.style.border="2px solid #676767";
	
	//document.body.all["SOUND"].src="sound.wav"
	
}
function hideText()
{
        
	document.getElementById("txtDesc").style.innerText = "";
	if (TmrHideText != null)
	{
		window.clearTimeout(TmrHideText);
		TmrHideText = null;
	}

}
function prevPic()
{
	var nNextPicIndex = parseInt(new String(SelectedPicture.id).substr(3)) - 1;
	if (nNextPicIndex > 0)
		showPicByID("Pic" + nNextPicIndex);				
}
function nextPic()
{
	if (bBeforeFirstImage)
	{
		showPicByID("Pic1");
		bBeforeFirstImage = false;
		return;

	}
var nNextPicIndex = parseInt(new String(SelectedPicture.id).substr(3)) + 1;
	if (nNextPicIndex <= nNumOfPics)
		showPicByID("Pic" + nNextPicIndex);
}
function clearThumbFrame(obj)
{
	obj.style.border="2px solid white";
}
function FirstPicLoaded()
{
	//document.getElementById("picture").style.visibility = "visible"
	document.getElementById("picture").onload = null;

	var LoadImg = document.createElement("img");
	
	LoadImg.style.visibility = "hidden";
	LoadImg.id = "CachedImg";
	LoadImg.onload = cacheNextImg;
	document.body.appendChild(LoadImg);
	cacheNextImg();
}
function cacheNextImg()
{
	window.setTimeout(cacheNextImgAsync, 100);
}
function cacheNextImgAsync()
{

	try {
			if (nCurrentCachedImg == nNumOfPics)
			return;
		
		
		var Pic = document.body.all["Pic" + (++nCurrentCachedImg)];
		var arr = new String(Pic.src).split("/");
		var ImgName = arr[arr.length - 1];
		document.body.all["CachedImg"].src = "pics/" + ImgName;
		document.body.all["CachedImg"].style.visibility = "hidden";
	}
	catch(E){}
}
var nSwitchCounter = 0;
function showPicByID(sID)
{


	var bFirstLoad = false;
//	if (document.getElementById("picture").style.visibility == "hidden")
	if (nSwitchCounter++ == 0)
	{
		bFirstLoad = true;
		showProjInfo();
		document.getElementById("picture").onload=FirstPicLoaded;
		return;
	}
	document.getElementById("picture").style.visibility = "visible";
	var bLeftVisibility = "visible";
	var bRightVisibility = "visible";
	if (sID == "Pic1")
		bLeftVisibility = "hidden";
	if (sID == "Pic" + nNumOfPics)
		bRightVisibility = "hidden";
	for (var i = 1 ; i <= nNumOfPics ; ++i)
		document.getElementById("Pic" + i).style.border="2px solid white";	
	document.getElementById(sID).style.border="2px solid #676767";
	
	document.getElementById("LeftArrow").style.visibility = bLeftVisibility;
	document.getElementById("RightArrow").style.visibility = bRightVisibility;

	if (!bFirstLoad)
	{
		hideProjInfo();
	}	
	var Pic = document.getElementById(sID);
		var arr = new String(Pic.src).split("/");
	var ImgName = arr[arr.length - 1];
	document.getElementById("picture").src = "pics/" + ImgName;
	SelectedPicture = Pic;
	if (TmrHideText != null)
		hideText();
	var sTitle = Pic.alt;
	if (sTitle.indexOf(",") != -1)
	{
		var Arr = sTitle.split(",");
		sTitle = "<b>" + Arr[0] + "</b>" + sTitle.substr(sTitle.indexOf(",") + 1);
	}
	if (!bFirstLoad)
	{
		document.getElementById("txtDesc").innerHTML = sTitle;
	}

	
	TmrHideText = window.setTimeout(hideText, 600000);
}

// changed shaula
function showPic(obj)
{

	showPicByID(obj.id);	
}
function hideProjInfo()
{
	try
	{	
		if ((document.getElementById("picture").style) && (document.getElementById("picture").style.visibility == "hidden"))
		{
			document.getElementById("picture").style.visibility = "visible";
			showPicByID("Pic1");
		}
	}
	
	catch(E){}
	var InfoPanel=document.getElementById("InfoPanel");
	if (msie) InfoPanel.filters.item(0).Apply();
	InfoPanel.style.visibility = "hidden";
	if (msie) InfoPanel.filters.item(0).Play();
	
}
function showProjInfo()
{
	showInfoPanel(sProjectInfo);
}
function showInfoPanel(sText)
{
 	var InfoPanel=document.getElementById("InfoPanel");
	document.getElementById("InfoPanelText").innerHTML = sText;
	if (msie)InfoPanel.filters.item(0).Apply();
	InfoPanel.style.visibility = "visible";
	if (msie)InfoPanel.filters.item(0).Play();
}
function showAbout()
{
	showInfoPanel(sAboutText);
}
function showContactInfo()
{
	showInfoPanel(sContactText);
}
function showLinks()
{
	showInfoPanel(sLinksText);
}
function none()
{
}
function goHome()
{
	document.location.href = "../../index.html";
}