<!--
//FIELD VALIDATION
	function isEmail(Email_ad){
		x = Email_ad.indexOf("@");
		y = Email_ad.indexOf(".");
		if ((x == -1 || y == -1))
			return false;
		else
			return true;
	}
	
	function isPhone(num){
		str = num;
		var re=/[a-zA-Zא-ת]/g;
    if (re.test(str))
  		 return false;  
		else if ((num.length < 9) || (num.length > 11))
			return false;
		else
			return true;
	}

	
//CONTACT
	function checkContact() {
		frm = document.contactFrm;
		if (frm.field_fname.value == ""){
			alert("נא למלא שם פרטי");
			frm.field_fname.focus();
			return false;
		}
		else if (frm.field_email.value == ""){
			alert("נא למלא כתובת מייל");
			frm.field_email.focus();
			return false;
		}
		else if (frm.field_cell.value == ""){
			alert("נא למלא מספר טלפון נייד");
			frm.field_cell.focus();
			return false;
		}
		else if (!isEmail(frm.field_email.value)){
			alert("נא למלא כתובת מייל תקינה");
			frm.field_email.focus();
			return false;
		}
		else{
			return true;
		}
	}
	
//PRELOAD IMAGES
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function sendToImage(id)
{
	id = document.imageFrm.imageID.value;
	var sendImage = window.open ("SendImage_pop.asp?ID=" + id, "sendImage", "menubar=no, adress=no, resizable=no, scrollbars=no, width=300, height=220");
}

function printImage(id)
{
	id = document.imageFrm.imageID.value;
	url = "printImage_pop.asp?id="+id;
	printImage=window.open(url,'printImage','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=400 height=450');
}

function checkSendTo() {
	if (document.sendFrm.email.value == ""){
		alert("!נא למלא את כתובת המייל של החבר");
		document.sendFrm.email.focus();
		return false;
	}
	else if (!isEmail(document.sendFrm.email.value)){
		alert("!תקינה Email נא למלא כתובת");
		document.sendFrm.email.focus();
		return false;
	}
	else if (document.sendFrm.name.value == ""){
		alert("!נא למלא שם שולח");
		document.sendFrm.name.focus();
		return false;
	}
	else
		 return true;
}

// GALLERY FUNCTIONS
function gotoGallery(){
	var mylist=document.getElementById("cat_id");
	category_id=mylist.options[mylist.selectedIndex].value;
	document.categoryFrm.category_id.value = category_id;
	document.categoryFrm.submit();
}

//OPEN PIC WINDOW
function openPic(id){
	url = "gallery_pop.asp?id="+id;
	imgWin=window.open(url,'imgWin','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=580 height=455,screenX=260,screenY=120');
}

function displayImage(id,url,name){
	document.imageFrm.imageID.value = id;
	document.imageFrm.imageName.value = name;
	document.all.bigPic.src = "uploads/"+url;
}

function displayProjectImage(id){
	url = "project_pop.asp?id="+id;
	imgWin=window.open(url,'imgWin','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=700 height=550');
}

//OPEN VIDEO WINDOW
function openVideo(){
	url = "video_pop.asp";
	videoWin=window.open(url,'videoWin','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=500 height=500');
	
}

//FORUM FUNCTIONS
function openMessage(id)
{
	if (document.getElementById(id).style.display=="inline")
	{
		document.getElementById(id).style.display="none";
	} else {
		document.getElementById(id).style.display="inline";
	}
}

function addComment(pID)
{
	document.getElementById("parentID").value=pID;
	document.getElementById("forumTable").style.display="inline";

}

function closeForm()
{
	document.getElementById("forumTable").style.display="none";
}

function sendComment(id, page)
{
	page = 0
	var win = window.open ("SendMessage.asp?ID=" + id + "&page=" + page, "win", "menubar=no, adress=no, resizable=no, scrollbars=no, width=300, height=220");
}

//FORUM MSG
	function sendForum() {
		frm = document.forumFrm;
		if (frm.writer.value == ""){
			alert("נא למלא שם הכותב");
			frm.writer.focus();
			return false;
		}
		else if (frm.title.value == ""){
			alert("נא למלא כותרת");
			frm.title.focus();
			return false;
		}
		else{
/*
			if (frm.uploadFile.value != ""){
				frm.enctype="multipart/form-data";
			}
			alert(frm.enctype);
*/
			return true;
		}
	}

//-->
