// 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;
}

function checkForm(lan)
{
	var fJob = document.jobForm;
	
	// first name
	if (fJob.fname.value==""){
		if (lan == 'HE')
			alert ('נא למלא שם פרטי');
		else
			alert ('Please fill your first name');
		fJob.fname.style.backgroundColor="red";
		return;
	}
	
	// last name
	if (fJob.lname.value==""){
		if (lan == 'HE')
			alert ('נא למלא שם משפחה');
		else
			alert ('Please fill your last name');
		fJob.lname.style.backgroundColor="red";
		return;
	}
	
	// tel
	if (fJob.mobile.value=="" && fJob.tel.value==""){
		if (lan == 'HE')
			alert ('יש למלא פרטי טלפון להתקשרות נייד או רגיל');
		else
			alert ('Please fill telephone or mobile details');
		fJob.tel.style.backgroundColor="red";
		fJob.mobile.style.backgroundColor="red";
		return;
	}
	
	
	// email validation
	var mail = document.jobForm.email.value;
	var x = mail.indexOf ("@");
	var y = mail.indexOf (".");

	if (mail=='') {
		if (lan == 'HE')
			alert ('יש למלא כתובת אי-מייל');
		else
			alert ('Please fill E-mail address');
		fJob.email.style.backgroundColor="red";
		return;
	}
	
	if (mail!="") {
		if (x==-1 || y==-1) {
			if (lan == 'HE')
				alert ('האי מייל שרשמת אינו חוקי, נא להקליד מחדש');
			else
				alert ('E-mail not valid. Please try again.');
			fJob.email.value = 'אי-מייל לא חוקי';
			return;
		}
	}
	

	fJob.submit();
}


// 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")
}
	


