function togglequestion(id) {
	for (x=0;x<100;x++) {
		if (document.getElementById('answer'+x)!=null) {
			if (x==id) {
			} else {
			  document.getElementById('answer'+x).style.display='none';
			}
		}
	}
	if (document.getElementById('answer'+id).style.display=='') {
		document.getElementById('answer'+id).style.display='none';	
	} else {
		document.getElementById('answer'+id).style.display='';	
	}
}
function displayhidecategories(id) {
	for (x=0;x<1000;x++) {
		if (document.getElementById('cat'+x)!=null) {
			document.getElementById('cat'+x).style.display='none';
		}
	}
	if (id=='cat0') {
	  for (x=0;x<1000;x++) {
		if (document.getElementById('cat'+x)!=null) {
			document.getElementById('cat'+x).style.display='';
		}
	  }
	} else {
	  document.getElementById(id).style.display='';
	}
}
function validateregistration() {
	var fullname=document.getElementById('fullname').value;
	var emailaddress=document.getElementById('emailaddress').value;
	if ((fullname=='')||(emailaddress=='')) {
		alert('נא למלא את השדות');
	} else {
		if (isValidEmail(emailaddress)) {
		  //sUrl = "include/libs/sp/spINSERT_Registration.asp?f="+fullname+"&e="+emailaddress;
	      //var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, { success:spINSERT_Registration_successHandler, failure:failureHandler, cache:false });
		  document.getElementById('irform').submit();
		} else {
		  alert('כתובת דוא"ל אינה תקינה');
		}
	}
}
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
    if (strEmail.search(validRegExp) == -1) 
   {
      return false;
    } 
    return true; 
}
function spINSERT_Registration_successHandler(o) {
	document.getElementById('getupdates').style.display='none';
	document.getElementById('getupdates_ty').style.display='';
}
function failureHandler(o) {
	alert(o.responseText);
}
function validateform(formname) {
	var fullname=formname.fullname.value;
	var telephone=formname.telephone.value;
	var emailaddress=formname.emailaddress.value;
	var issubmit=true;
	if ((fullname=='')||(telephone=='')||(emailaddress=='')) {
		issubmit=false;
	}
	if (issubmit) {
		return true;
	} else {
		alert('חובה למלא את השדות המסומנים בכוכבית');
		return false;
	}
}
