// send search string
function testKeyDown()
{
	var x = event.keyCode;
	if (x == 13)
		goSearch(1);
}

// send search string
function goSearch(park)
{
	var str = document.getElementById("strSearch");
	if (str.value=='')
		document.getElementById("strSearch").style.backgroundColor='#c9c9c9';
	else
		location.href = "search.asp?park="+park+"&name=חיפוש&strSearch=" + str.value;
}

// open the window for big picture.	
function openBig (path,nameP) {
	var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'imgBigNew.asp?path='+ path + '&name=' + nameP + '&urlPath=' + newStr;
	win = window.open(source, "imgBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
}

// open the window for map.	
function openMap (picH) {
	var wWin = screen.width-50
	var hWin = screen.height-100
	win = window.open("bigMap.asp?img="+picH, "imgBig", "top=0, left=0, width="+wWin+", height="+hWin+", status=no, resizable, scrollbars=yes")
	win.focus
}

// open the window for manual for ganim.	
function openManual (picH) {
	var wWin = 400
	var hWin = screen.height-100
	win = window.open("bigManual.asp?img="+picH, "imgBig", "top=0, left=0, width="+wWin+", height="+hWin+", status=no, resizable, scrollbars=yes")
	win.focus
}

//open large image in gallery item
function showLarge(tbl,imgItem,title)
{
	document.getElementById("mainPic").src = "images/" +tbl+ "/"+imgItem ;
	document.getElementById("mainTxt").innerHTML = title ;
}

function showPlace(tbl,imgItem,itemID,gardenID,whereTo,title)
{
	document.all("largePic").filters[0].Apply();
	document.all("largePic").style.visibility="hidden";
	document.all("largePic").innerHTML = "<a href='"+whereTo+".asp?id="+itemID+"&park="+gardenID+"'><img class='mainImgIn' alt='"+title+"&nbsp;-&nbsp;כניסה' id='mainPic' name='mainPic' src='images/"+tbl+"/"+imgItem+"' width='380' height='278' border='0' style='cursor:hand;'></a>";
	document.all("largePic").style.visibility="visible";
	document.all("largePic").filters[0].Play();
}

// change map in the main window and font size - in map.asp

function changeImage(what,pic,txt,picH)
{
	document.all("mainPic").innerHTML = "<img alt='לחץ להגדלה' name='mainMap' src='images/"+pic+"' width='380' height='278' border='0' style='cursor:hand;' onclick='openMap(&quot;"+picH+"&quot;)'>";
	document.getElementById('yarkon').style.font = 'bold 15px;';
	document.getElementById('yarkonP').innerHTML = '';
	document.getElementById('begin').style.font = 'bold 15px;';
	document.getElementById('beginP').innerHTML = '';
	document.getElementById('teva').style.font = 'bold 15px;';
	document.getElementById('tevaP').innerHTML = '';
	document.getElementById(what).style.font = 'bold 18px;';
	if (what=='teva')
		document.all(txt).innerHTML = '<br>למפת התמצאות בגן הזאולוגי <a href="javascript:openMap(&quot;map_zeologi.jpg&quot;)">לחץ כאן</a><br>למפת התמצאות בגן הבוטני <a href="javascript:openMap(&quot;map_botani.jpg&quot;)">לחץ כאן</a>';
	else
		document.all(txt).innerHTML = '<br>להגדלה/הדפסה של המפה <a href="javascript:openMap(&quot;'+picH+'&quot;)">לחץ כאן</a>';
}

// access.asp - change images, big images and info about park access
function changeAccess(what,pic,txt,picH)
{
	document.all("mainPic").innerHTML = "<img alt='לחץ להגדלה' name='mainMap' src='images/"+pic+"' width='380' height='278' border='0' style='cursor:hand;' onclick='openMap(&quot;"+picH+"&quot;)'>";
	document.getElementById('yarkon').style.font = 'bold 15px;';
	document.getElementById('yarkonP').innerHTML = '';
	document.getElementById('begin').style.font = 'bold 15px;';
	document.getElementById('beginP').innerHTML = '';
	document.getElementById('teva').style.font = 'bold 15px;';
	document.getElementById('tevaP').innerHTML = '';
	document.getElementById(what).style.font = 'bold 18px;';
	
	switch(what)
		{
			case 'yarkon': //פארק הירקון
				document.all(txt).innerHTML = '<br><b>ברכבת - </b>ירידה בתחנת האוניברסיטה.<br><b>אוטובוס - </b>קוים: 21,27,28,47,48,113<br>להגדלה/הדפסה של המפה <a href="javascript:openMap(&quot;'+picH+'&quot;)">לחץ כאן</a>';
				break;
			case 'begin': //פארק מנחם בגין
				document.all(txt).innerHTML = '<br><b>אוטובוס - </b>קוים: 9,16,59<br>להגדלה/הדפסה של המפה <a href="javascript:openMap(&quot;'+picH+'&quot;)">לחץ כאן</a>';
				break;
			case 'teva': //גני הטבע
				document.all(txt).innerHTML = '<br><b>אוטובוס - </b>קוים: 1,2,92<br>להגדלה/הדפסה של המפה <a href="javascript:openMap(&quot;'+picH+'&quot;)">לחץ כאן</a>';
				break;
		}
	
}

// open sub categories for events and galleries
var olditem;
olditem = '';

function showSub(kind,plc)
{
	var pos  = ((screen.width-770)/2)+(47*plc);
	if (kind != olditem && olditem!= '' )
	{
		document.getElementById(olditem).style.visibility = 'hidden';
		document.getElementById(olditem+'TD').bgColor = '';
		document.getElementById(olditem+'TD').style.color = '#05533E';
	}
	document.getElementById(kind).style.left = pos-2;
	document.getElementById(kind).style.top = 87;
	document.getElementById(kind).style.visibility = 'visible';
	document.getElementById(kind+'TD').bgColor = '#05533E';
	document.getElementById(kind+'TD').style.color = '#D9EFEA';
	
	if (document.getElementById(kind).style.visibility == 'visible')
		olditem = kind
}

// close sub categories for events and galleries
function hideSub()
{
	document.getElementById("Events").style.visibility = 'hidden';
	document.getElementById("EventsTD").bgColor = '';
	document.getElementById("EventsTD").style.color = '#05533E';
	document.getElementById("Gallery").style.visibility = 'hidden';
	document.getElementById("GalleryTD").bgColor = '';
	document.getElementById("GalleryTD").style.color = '#05533E';
}

// check form validation (incl. e-mail) and send it to comment table with parameters
function checkForm() { 	// check the form and put values of type and doc_id before sending.
	
	
	var mailStr = document.sendTo.email.value;
	var x = mailStr.indexOf ("@");
	var y = mailStr.indexOf (".");
	
	if (document.sendTo.fname.value=="") {
		document.sendTo.fname.style.backgroundColor='red';
		return;
	}
	
	if (document.sendTo.lname.value=="") {
		document.sendTo.lname.style.backgroundColor='red';
		return;
	}

	if (mailStr=="") {
		document.sendTo.email.style.backgroundColor='red';
		return;
	}
	
	else if (x==-1 || x==-1) {
		document.sendTo.email.value='האי-מייל אינו חוקי';
		return;
	}	
	
	document.sendTo.submit();

}


<!--
// check form validation (incl. e-mail) and send it to comment table with parameters


function checkDel() { 	// check the form and put values of type and doc_id before sending.
	
	
	var mailStr = document.sendOut.email.value;
	var x = mailStr.indexOf ("@");
	var y = mailStr.indexOf (".");

	if (mailStr=="") {
		document.sendOut.email.style.backgroundColor='red';
		return;
	}
	
	else if (x==-1 || x==-1) {
		document.sendOut.email.value='האי-מייל אינו חוקי';
		return;
	}	
	
	document.sendOut.submit();

}

// check feedback form - comments.asp
function checkFeedback()
{
	var fdbck = document.feedback;
	var mail = document.feedback.email.value;
	var x = mail.indexOf ("@");
	var y = mail.indexOf (".");
	
	if (fdbck.fname.value==""){
		fdbck.fname.style.backgroundColor="red";
		return
	}
	if (fdbck.lname.value==""){
		fdbck.lname.style.backgroundColor="red";
		return
	}
	
	if (mail=='') {
		fdbck.email.style.backgroundColor="red";
		return;
	}
	else if (x==-1 || y==-1) {
		fdbck.email.value = 'אי-מייל לא חוקי';
		return;
	}
	
	fdbck.submit();
	
}

// used in gallery
function galleryImg(imgPath,picN,Page,title)
{
	var source = 'galleryImg.asp?path='+ imgPath + '&picN='+ picN + '&Page=' + Page + '&title=' + title
	win = window.open(source, "imgGallery", "top=0, left=0, status=no, resizable, scrollbars=yes");
	window.focus;
}