// open big pictures of ships
function openBig(picN)
{
	var source = 'bigPic.asp?picN='+ picN;
	win = window.open(source, "galleryBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
	window.focus;
}
 
// open the window for picture navigation.	
function showGallery(imgPath,itemID,catID)
{
    var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'bigGallery.asp?path='+ imgPath + '&id='+ itemID+'&cat='+ catID +'&urlPath=' + newStr;
	win = window.open(source, "galleryBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
}

// open the window for big picture.	
function showBig (path,nameP) {
	var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'imgBig.asp?path='+ path + '&name=' + nameP + '&urlPath=' + newStr;
	win = window.open(source, "imgBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
}

// open print version window
function printDoc(kindRec,itemID)
{
	var win
	win = window.open('printDoc.asp?id='+itemID+'&kind='+kindRec , 'printDoc', 'top=5, left=5, width=660, height=430, status=no, resizable, scrollbars')
	win.focus()
}

// open send to friend window
function sendFriend(titleID)
{
	var win
	var titleStr = titleID.replace('"','``')
	var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'sendFriend.asp?title=' + titleStr + '&urlPath=' + newStr;
	win = window.open(source, 'sendFriend', 'top=5, left=5, width=390, height=430, status=no, resizable')
	win.focus()
}


// menu over
function overMenu(fld)
{
	fld.style.backgroundColor = '#767676';
	//fld.style.border = '1px solid #FFFFFF';
}

// menu out
function outMenu(fld)
{
	fld.style.backgroundColor = '#868686';
	//fld.style.border = '1px solid #CBCACA';
}

// contact form

function checkForm()
{
	var fJob = document.jobForm;
	
	// first name
	if (fJob.fname.value==""){
		fJob.fname.style.backgroundColor="red";
		return;
	}
	

	// email validation
	var mail = document.jobForm.email.value;
	var x = mail.indexOf ("@");
	var y = mail.indexOf (".");

	if (mail=='') {
		fJob.email.style.backgroundColor="red";
		return;
	}
	
	if (mail!="") {
		if (x==-1 || y==-1) {
			fJob.email.value = 'Invalid E-mail';
			return;
		}
	}
	
	fJob.submit();
}


// client section
function checkPass()
{
	var fdbck = document.supportForm;
	if (fdbck.clientID.value==""){
		fdbck.clientID.style.backgroundColor="red";
		return;
	}
	if (fdbck.pass.value==""){
		fdbck.pass.style.backgroundColor="red";
		return;
	}
	fdbck.submit();
}

// open/close the tips page
function handleInfo(trID,buttonID)
{
	if (document.getElementById(trID).style.display == 'none')
	{
		document.getElementById(trID).style.display = 'inline';
		document.getElementById(buttonID).innerHTML = 'סגור';
	}
	
	else if (document.getElementById(trID).style.display == 'inline')
	{
		document.getElementById(trID).style.display = 'none';
		document.getElementById(buttonID).innerHTML = 'פרטים...';
	}
}

// open/close the tips page
function handleInfoEn(trID,buttonID)
{
	if (document.getElementById(trID).style.display == 'none')
	{
		document.getElementById(trID).style.display = 'inline';
		document.getElementById(buttonID).innerHTML = 'Close';
	}
	
	else if (document.getElementById(trID).style.display == 'inline')
	{
		document.getElementById(trID).style.display = 'none';
		document.getElementById(buttonID).innerHTML = 'Details...';
	}
}