<!--

//var tNumber=<%=msTNumber%>;

	function hideDiv(lsDivName){
		eval("div"+lsDivName).style.display = "none";
/*		
		divLogin.style.display = "none";
		divLogOff.style.display = "none";
		divOpenCourse.style.display = "none";
*/
	}
	
	function showDivLogOff(){
		divLogOff.style.display = "";
	}

	function Open_SLR_new(liUserID,isIndex){
		if (isIndex == 1)
			frm = document.selectCourseFrm;
		else
			frm = document.selectCourseFrm1;
		box = frm.selectCourse
		CourseID =  box.options[box.selectedIndex].value;
//		alert(CourseID)
		if (CourseID > 0) {
			var SLR_URL = "/socrates/socrates/OpenSession.asp?CourseID="+CourseID+"&UserID="+liUserID;
			var Slr_Win = window.open(SLR_URL, "Demo", "status=no, location=no,left=0, top=0, resizable=no,width="+window.screen.availWidth+", height="+window.screen.availHeight);
			if (! Slr_Win)
			{
			//alert("The requested window as blocked!\n"
			//+ "Please try again and this time press the 'Ctrl' key parallelly.");
			//return false;
				document.body.innerHTML = "Couldn't not open the requested site!<br />"
				+ "Please click on the following <a href='javascript:void(Open_SLR())'>link</a>";
			}
			else{
				document.location.href="courseOpen.asp";
			}
		}

	}

function closeIt() {
	var xmlHttp;
  try {    // Firefox, Opera 8.0+, Safari    
		xmlHttp=new XMLHttpRequest();    
	}
  catch (e)  {    // Internet Explorer    
		try {      
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
		}
    catch (e) {      
      try {        
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
			}
      catch (e) {        
				alert("Your browser does not support AJAX!");        
				return false;        
			}      
		}    
	}
  xmlHttp.open("GET","/logoff.asp",true);
  xmlHttp.send(null);  
//  xmlHttp.onreadystatechange=function() {
//		if(xmlHttp.readyState==4) {
//			alert(xmlHttp.responseText);
//		  document.getElementById("onbeforeunload").innerHTML="r:"+xmlHttp.responseText;
//	  }
//	}
}

function closeIt1(id) {
	var xmlHttp;
  try {    // Firefox, Opera 8.0+, Safari    
		xmlHttp=new XMLHttpRequest();    
	}
  catch (e)  {    // Internet Explorer    
		try {      
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
		}
    catch (e) {      
      try {        
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
			}
      catch (e) {        
				alert("Your browser does not support AJAX!");        
				return false;        
			}      
		}    
	}
  xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			alert("id"+id);
//		  document.getElementById("onbeforeunload").innerHTML="r:"+xmlHttp.responseText;
	  }
	}
  xmlHttp.open("GET","/logoff.asp?id="+id,true);
  xmlHttp.send(null);  
}



	//SEARCH
	function validSearch() {
		frm = document.searchFrm;
		if (frm.field_search.value == ""){
			alert("Please enter text for search");
			frm.field_search.focus();
			return false;
		}
		else{
			return true;
		}
	}

	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 > 16))
			return false;
		else
			return true;
	}

//checkFrm
	function checkFrm(frm) {
		for (i=0;i<frm.elements.length;i++) {
			e = frm.elements[i];
			if ((e.is_must == "1") && (e.value == "")){
				alert(""+e.title);
				e.focus();
				return false;
			}
			if ((e.field_type == "phone") && (e.value != "") && (!isPhone(e.value))){
				alert(""+e.title1);
				e.focus();
				return false;
			}
			if ((e.field_type == "email") && (e.value != "") && (!isEmail(e.value))){
				alert(""+e.title1);
				e.focus();
				return false;
			}
		}
		return true;
	}

function MM_openBrCenterWindow(theURL,winName,features, width, height) { //v2.0
	var wnd = window.open(theURL,winName,features);

	 wleft = (screen.width - width)/ 2;
	  wtop = (screen.height - height) / 2;


	  // IE5 and other old browsers might allow a window that is
	  // partially offscreen or wider than the screen. Fix that.
	  // (Newer browsers fix this for us, but let's be thorough.)
	  if (wleft < 0) {
	    w = screen.width;
	    wleft = 0;
	  }
	  if (wtop < 0) {
	    h = screen.height;
	    wtop = 0;
	  }
	
	wnd.moveTo(wleft,wtop);
	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	alert('1');
	window.open(theURL,winName,features);
	
}
	
//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 displayImage(id,url,name){
	document.imageFrm.imageID.value = id;
	document.imageFrm.imageName.value = name;
	document.all.bigPic.src = "uploads/"+url;
}


//OPEN PIC WINDOW
function openPic(id){
	id = document.imageFrm.imageID.value;
	url = "gallery_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');
}

function sendToImage(id,miPage)
{
	id = document.imageFrm.imageID.value;
	var sendImage = window.open ("SendImage_pop.asp?page="+miPage+"&ID=" + id, "sendImage", "menubar=no, adress=no, resizable=no, scrollbars=no, width=350, height=300");
}

function printImage(id)
{
	id = document.imageFrm.imageID.value;
	url = "gallery_pop.asp?print=1&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("Please enter email address to send to!");
		document.sendFrm.email.focus();
		return false;
	}
	else if (!isEmail(document.sendFrm.email.value)){
		alert("!Please enter valid email address");
		document.sendFrm.email.focus();
		return false;
	}
	else if (document.sendFrm.name.value == ""){
		alert("!Please enter name");
		document.sendFrm.name.focus();
		return false;
	}
	else
		 return true;
}


//ADD TO FAVORITES
function addToFavorites(url,siteName) {
	window.external.addfavorite(url,siteName);
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function openBox(lsOpenName,lsCloseName) {
	alert(lsOpenName)	setTimeout("MM_showHideLayers(lsOpenName,'','show','close_1','','hide')",10);
  return true;
}
  

function closeBox(lsOpenName,lsCloseName) {
	liID = 1;
	setTimeout("MM_showHideLayers('open_1','','hide','close_1','','show')",10);   
  return true;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function gotoCategory(){
	document.categoryFrm.submit();
}

//OPEN VIDEO WINDOW
function openVideo(id){
	url = "video_pop.asp?id="+id;
	videoWin=window.open(url,'videoWin','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=500 height=500');
	
}


function ShowHideSearch(viCatID){
	//alert(eval("Frame" + viCatID + ".location.href"))
	if (eval("document.all.AllText" + viCatID))	{
		if (eval("AllText" + viCatID + ".style.display=='none'"))		{
			eval("AllText" + viCatID + ".style.display='block'")
		}
		else {
			eval("AllText" + viCatID + ".style.display='none'")
		}
	}
}

function ShowHideMessage(viCatID){
	//alert(eval("Frame" + viCatID + ".location.href"))
	if (eval("document.all.AllText" + viCatID))	{
		if (eval("AllText" + viCatID + ".style.display=='none'"))		{
			eval("AllText" + viCatID + ".style.display='block'")
			eval("btn_close" + viCatID + ".style.display='block'")
			eval("btn_open" + viCatID + ".style.display='none'")
		}
		else {
			eval("AllText" + viCatID + ".style.display='none'")
			eval("btn_close" + viCatID + ".style.display='none'")
			eval("btn_open" + viCatID + ".style.display='block'")
		}
	}
}

function updateUsersDisplay(){
	frm = document.orderFrm;
	value = frm.users_num.options[frm.users_num.selectedIndex].value;
	
//	alert(value)
	for (i = 0; i < 10; i++){
		if (i < value)
			eval("trUser" + i + ".style.display=''")
		else
			eval("trUser" + i + ".style.display='none'")
	}
	
	if (value == 0)
		value = 1
		
	price = frm.field_price_org.value;
	discount = frm.field_discount_org.value;
	newPrice = price * value;
	frm.field_price.value = newPrice;
	frm.field_discount.value = newPrice*discount/100;
	frm.field_total_price.value = newPrice-frm.field_discount.value;
}

	function isPassword(pass){
		str = pass;
		var re = /[\W_]/; 
//		var re=/[a-zA-Z0-9]/;
    if (re.test(str))
  		 return false;  
		else
			return true;
	}

//LOGIN
	function LogIn() {
		frm = document.loginFrm;

		frm.submit();
		return true;
		
		if (frm.CheckLogin_UserName.value == ""){
			alert("<%=gsLangMsgEnterUserName%>");
			frm.CheckLogin_UserName.focus();
			return false;
		}
		else if (!isPassword(frm.CheckLogin_UserName.value)){
			alert("<%=gsLangMsgEnterUserNameErr%>");
			frm.CheckLogin_UserName.focus();
			return false;
		}
		else if (frm.CheckLogin_Password.value == "" || (frm.CheckLogin_Password.value.length < 2 || frm.CheckLogin_Password.value.length > 16)){
			alert("<%=gsLangMsgEnterPassword%>");
			frm.CheckLogin_Password.focus();
			return false;
		}
		else if (!isPassword(frm.CheckLogin_Password.value)){
			alert("<%=gsLangMsgPasswordErr%>");
			frm.CheckLogin_Password.focus();
			return false;
		}
		else{
			return true;
		}
	}

//PASSWORD
	function validPassword() {
		frm = document.forgotFrm;
		if (frm.field_email.value == ""){
			alert("<%=gsLangContactErrorEmail%>");
			frm.field_email.focus();
			return false;
		}
		else if (!isEmail(frm.field_email.value)){
			alert("<%=gsLangContactErrorValidEmail%>");
			frm.field_email.focus();
			return false;
		}
		else{
			return true;
		}
	}


		/* <![CDATA[ */
		
		
		//  הפונקציות הבאות מחזירות טקסט במבנה של soup envelope 
		// אשר מועבר אל השרת לצורך פקודות שונות
		//*****************************************************
		
		// הטקסט הבא יבצע רישום לשרת באמצעות מספר משתמש חיצוני
		function DoLoginEnv(ExternalID, ClientID)
		{
			var Envelope = ""
			+"<?xml version='1.0' encoding='utf-8'?>"
			+"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
			+"<soap:Body>"
			+"<DoLogin xmlns='http://tempuri.org/'>"
			+"<ExternalID>"+ExternalID+"</ExternalID>"
			+"<ClientID>"+Cli