
//function clickIE() {if (document.all) {(message);return false;}}
//if (document.layers) 
//{document.captureEvents(Event.MOUSEDOWN);}
//else{document.oncontextmenu=clickIE;}
//document.oncontextmenu=new Function("return false")

function Right(str, n)
{
      if (n <= 0)
          return "";
      else if (n > String(str).length)
          return str;
      else
   {
          var iLen = String(str).length;
          return String(str).substring(iLen, iLen - n);
      }
}

function Left(str, n)
{
   if (n <= 0)
         return "";
   else if (n > String(str).length)
         return str;
   else
         return String(str).substring(0,n);
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function Trim(str)
{
	return LTrim(RTrim(str));
}

function LTrim(str) 
{
	for (var i=0; ((str.charAt(i)<=" ")&&(str.charAt(i)!="")); i++);
	return str.substring(i,str.length);
}

function RTrim(str)
{
	for (var i=str.length-1; ((str.charAt(i)<=" ")&&(str.charAt(i)!="")); i--);
	return str.substring(0,i+1);
}


function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : event.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode!=46)//נקודה עשרונית
      return false;

   return true;
}

function isDate(sDate) {
    var scratch = new Date(sDate);
    if (scratch.toString() == "NaN" || scratch.toString() == "Invalid Date") {
        alert("!תאריך שגוי");
        return false;
    } else {
        return true;
    }
}

function getYPosition( oElement )
{
var iReturnValue = 0;
while( oElement != null ) {
iReturnValue += oElement.offsetTop;
oElement = oElement.offsetParent;
}
return iReturnValue;
}

function getXPosition( oElement )
{
var iReturnValue = 0;
while( oElement != null ) {
iReturnValue +=oElement.offsetLeft;
oElement = oElement.offsetParent;
}
return iReturnValue;
}

function AlexGetTop(h,m)
{
	if(name == "Microsoft Internet Explorer")
	{
	    var x = f.offsetLeft + dx;
	    var y = f.offsetTop  + dy;

	    if (x >= document.body.clientWidth - f.offsetWidth)
	        {
	            x  = document.body.clientWidth - f.offsetWidth;
	            dx = -dx;
	        }
	    if (y >= document.body.clientHeight - f.offsetHeight)
	        {
	            y  = document.body.clientHeight - f.offsetHeight;
	            dy = -dy;
	        }

	    if (x <= 0) { x = 0; dx = -dx; }
	    if (y <= 0) { y = 0; dy = -dy; }
	    f.style.left = x + 'px';
	    f.style.top  = y + 'px';
	}

	else
	{

//	    var x = f.offsetLeft + dx;
//	    var y = f.offsetTop  + dy;
//	    if (x >= window.innerWidth - f.offsetWidth) {
//	        x  = window.innerWidth - f.offsetWidth;
//	        dx = -dx;
//	    }
//	    if (y >= window.innerHeight - f.offsetHeight) {
//	        y  = window.innerHeight - f.offsetHeight;
//	        dy = -dy;
//	    }
//	    if (x <= 0) { x = 0; dx = -dx; }
//	    if (y <= 0) { y = 0; dy = -dy; }
//	    f.style.left = x + 'px';
//	    f.style.top  = y + 'px';
	} 
}

function MyFunc(h,m)
	{
	if(m==91)
		{
document.getElementById("menu"+m).style.left=(document.getElementById("hed"+h).offsetLeft);
	var LongLeft1=(document.getElementById("hed"+h).parentNode.parentNode.parentNode.parentNode.offsetLeft+document.getElementById("Logo").parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.offsetWidth);
	var KazarLeft=(document.getElementById("hed"+h).parentNode.parentNode.parentNode.parentNode.offsetLeft);
	var ElementHeight=(document.getElementById("menu"+m).offsetHeight);
	var ElementTop=(document.getElementById("hed"+h).offsetTop);
	var HtmlHeth=document.getElementById("hd"+h).parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.offsetTop;
	var A=document.body.clientWidth;
document.getElementById("menu"+m).style.top=(document.getElementById("hed"+h).offsetTop)-100;	
document.getElementById("tdTest").innerHTML=("body.clientWidth="+A+"  menu"+m+".style.left="+document.getElementById("menu"+m).style.left+"  menu"+m+".offsetLeft="+document.getElementById("menu"+m).offsetLeft+"  hed"+h+".offsetLeft"+document.getElementById("hed"+h).offsetLeft);
//debugger
			return;
		}
		if(m>3)
		{
			document.getElementById("menu"+m).style.left=(document.getElementById("hed"+h).parentNode.parentNode.parentNode.parentNode.offsetLeft);
		}
		else
		{
			document.getElementById("menu"+m).style.left=(document.getElementById("hed"+h).parentNode.parentNode.parentNode.parentNode.offsetLeft+document.getElementById("Logo").parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.offsetWidth);	
		}
		
	}
	
function ajaxGeneral(path,swDebug)
 {  
  s="";
  var xmlHttp;
  var x;
  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;        
		}      
	  } 
	}
	err=new Error();
	try{
		xmlHttp.open("GET",path,false);
		xmlHttp.send("null");
		s=xmlHttp.responseText;
	   }
	catch(err){alert(err.description);s="";}
	
	if (swDebug==1) window.open(path);
	
	return unescape(s);
}


function changeTopView(sView)
{
	if(sView == "pic")
	{
		document.getElementById("picViewTopDisplay").style.display = "block";
		document.getElementById("listViewTopDisplay").style.display = "none";
	}
	else
	{
		document.getElementById("picViewTopDisplay").style.display = "none";
		document.getElementById("listViewTopDisplay").style.display = "block";
	}					
	document.frmGroup.SwViewTop.value = sView;		
}

function changeView(sView,Sug)
{
	if(sView == "pic")
	{
		document.getElementById("picViewDisplay").style.display = "block";
		document.getElementById("listViewDisplay").style.display = "none";
		document.getElementById("bigtable").style.display = "";
	}
	else
	{
		document.getElementById("picViewDisplay").style.display = "none";
		document.getElementById("listViewDisplay").style.display = "block";
		//BigPicture(document.getElementById("DepSelected").value,document.getElementById("DepPathSelected").value,document.getElementById("DepTeorSelected").value);
		document.getElementById("bigtable").style.display = "none";
	}
	document.frmGroup.SwView.value = sView;
	document.getElementById("ifr").src = "SetSessionSwView.asp?SwView="+sView+"&Sug="+Sug;
}
		

		
		
		
		
function OpenDiv(DivID)
{
if(document.getElementById(DivID).style.display == 'none')
	document.getElementById(DivID).style.display = 'inline'
else
	document.getElementById(DivID).style.display = 'none'
}


function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) 
{ //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
	var myLeft = (screen.width-myWidth)/2;
	var myTop = (screen.height-myHeight)/2;
	features+=(features!='')?',':'';
	features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


function pasteInput(obj,txt)
 {
  if(obj.value == '')
	{
		obj.value = txt;
	}
 }
 
function clearInput(obj,txt)
 {
  if(obj.value == txt)
	{
		obj.value = "";
	}
 }



/* -------- Main Page ----------------------------------------------------------------- */

var swfarowrd2=true;
var swfarowrd=true;

var NameDepTeor="";
var DepNmae="";
var NameGrpTeor="";
var GrpNmae="";
var NameGrpTtTeor="";
var GrpTtName="";

var DepPathf="";
var GrpPathf="";
var GrpTtPathf="";

var LastKod=0;
var LastKodDep=-1;
var firstKodDep=0;
var LastKodGrp=0;
var firstKodGrp=0;
var LastKodGrpTt=0;
var firstKodGrpTt=0;
var LastKodPrt=0;
var FirstKodPrt=0;

var DepCounter=0;
var GrpCounter=0;
var GrpTtCounter=0;
var DepCounter2=0;
var GrpCounter2=0;
var ce;
var DK=0;
var LastKodDep2=0;
var firstKodDep2=0;
var LastKodGrp2=0;
var firstKodGrp2=0;
var firstKodGrpTt2=0;

var TwGrpTt=0,TwGrp=0,TwDep=1;

var SwView="pic";
var SwPrtView="pic";
var SwGrpTt=0,SwGrp=0,SwPrt=0,SwDep=1;
var LastKodlist=0;

var orderBy="abc" ;	

	var Eng_Nm="";
	var Ckey="";
	var aName="";
	var Pri1="";
	var AmatMida="";
	var PathF="";
	var BarKodSuChef="";
	
	var SendToEdit="";
	var FromKod=0;
	var editUserSendTo="no"

var PageUp="StartLogo";
var PageDown="Get_Dep";

var TeurLongTxt=""; //מחזיק תאור ארוך של פריט
var VarTeurShimush="";//מחזיק מספר דף של הוראות השימוש שיש להציג

var PackParit=""; // if user checked packing option for parit ==> save it 

function checkPacking()
{
	packing.cheked = PackParit;
		
}

function filter()
{
	frm.filterTable.style.display="";
}


function HalonOraotShimosh()
{
	document.getElementById("HalonOraot").style.display="";
	document.getElementById("HalonOraot").src="OraotShimosh.asp?&TeurShimushKod="+VarTeurShimush;
	
}
function closeHalonOraot()
{
	document.getElementById("HalonOraot").style.display="none";
	document.getElementById("HalonOraot").src="";
}
function openYzranSelection()
{
	tableYzranSelection.style.display="";
	
}
function OnChangeYzranSelection()
{
	parent.RaaionotMivtzaim(YzranSelection.value,0,'יצרנים נבחרים','hofshi');	
	tableYzranSelection.style.display="none";
}
function IEArrows(index,whichPage)
{
	switch (whichPage)
	{
		case "top":
		{
			PageUp=index;
			break;
		}
		case "bottom":
		{
			PageDown=index;
			break;
		}
	}
	window.setTimeout("IEArrowsPrat2()",100)	
}
function IEArrowsPrat2 ()
{
	
	if (PageUp=="TopMenuDep" && PageDown!="Get_Grp" )
	{
		history.back(-1);
		parent.IndexDep.innerText=" >> "+parent.indexNameD;
		parent.IndexGrp.innerText="";
		parent.IndexGrpTt.innerText="";
		A.style.display="";
		B.style.display="none";
	}
	if (PageUp=="TopMenuGrp" && PageDown!="Get_GrpTt")
	{		
		parent.IndexGrp.innerText="";
		parent.IndexGrpTt.innerText="";
		history.back(-1);
		window.setTimeout("SWviewtableOff()",500);
		A.style.display="";
		B.style.display="none";
	}
	if (PageUp=="TopMenuGrpTt" && PageDown!="Get_Prt")
	{	
		parent.IndexGrpTt.innerText="";
		history.back(-1);
		window.setTimeout("SWviewtableOff()",500);
		A.style.display="";
		B.style.display="none";
	}
}
function indec(a,id,qtycmt,swshakil)
{
	if (a=="increase")
	{
		if (swshakil=="1")
				document.getElementById("misparPrt"+id).value=Number(parseFloat(document.getElementById("misparPrt"+id).value)+parseFloat(qtycmt)).toFixed(1);
			else
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+1;
	}else
	{//decrease
		if (swshakil=="1")
				{
					if((parseFloat(document.getElementById("misparPrt"+id).value)-qtycmt)<=0) return;
					document.getElementById("misparPrt"+id).value=Number(parseFloat(document.getElementById("misparPrt"+id).value)-parseFloat(qtycmt)).toFixed(1);
				}
			else{
					if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0) return;
					document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-1;
				}
	}
}



function ActivateFlash (se)
{
	str="";
	str +='	<TABLE  WIDTH="825" HEIGHT="535" BORDER="0" style="position:absolute;z-index:999;top:5;left:-15">';
	str +='				<TR align="center" valign="middle">';
	str +='					<TD>';
	str +='					<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	str +='						WIDTH=825 HEIGHT=535 id=ShockwaveFlash1>';
	str +='						<param name="movie" value="images/flash/selected_animation.swf" />';
	str +='						<param name="quality" value="high" />';
	str +='						<param name="wmode" value="transparent" />';
	str +='						<PARAM NAME=FlashVars VALUE="slct_cat='+se+'">';
	str +='						<param name="bgcolor" value="#ffffff" />';
	str +='						<EMBED src="images/flash/selected_animation.swf" quality="high" wmode="transparent" bgcolor="#ffffff"  WIDTH=825 HEIGHT=535 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>';
	str +='					</OBJECT>';
	str +='					</TD>';
	str +='				</TR>';
	str +='				</TABLE>';
	DoFlash.innerHTML=str;
	window.setTimeout ("closeFlash()",2000)
}
function closeFlash()
{
	DoFlash.innerHTML="";
}	
function UserLoginNm(e)
{
	
	//document.getElementById("UserLoginNm").style.display="";
	//document.getElementById("UserLoginNm").innerText=e 	;
	//document.getElementById("UserNameView").style.display="";
	//document.getElementById("UserNameView").innerText="  שלום   "+e+ "  ";
	//document.getElementById("UserNameOut").style.display="";
	//document.getElementById("UserNameOut").innerText="("+" אם אינך "+e+ " לחץ כאן "+")"
}	
function frmTopMenuAction()
{	
	HalonUserEnter.style.display="";
	document.getElementById("frmTopMenu").src="TopMenu.asp?";
}	
function bringNextPrt()
{	
	
	document.getElementById("frm").src="Get_Prt.asp?FromKod="+FromKod+"&Counter="+GrpTtCounter+"&SwView=OneOne&UPDOWN=Next&GoToEnd=0&orderBy="+orderBy ;	
}
function bringPrevPrt ()
{
	
	document.getElementById("frm").src="Get_Prt.asp?FromKod="+FromKod+"&Counter="+GrpTtCounter+"&SwView=OneOne&UPDOWN=Prev&GoToEnd=0&orderBy="+orderBy ;	
}
function backToGroup ()
{//alert("backToGroup")
	A.style.display="";
	B.style.display="none";
	document.getElementById("frm").src="Get_Prt.asp?FromKod="+FirstKodPrt+"&Counter="+GrpTtCounter+"&SwView="+SwPrtView+"&UPDOWN=reg&GoToEnd=0&orderBy="+orderBy ;	
}
function backToGroupNoRelaod()
{
	A.style.display="";
	B.style.display="none";
}


function SendPrtTo(a)
{
	switch (a)
	{
		case "open":
		{
			document.getElementById("HalonSendPrtTo").style.display="";
			document.getElementById("NewSendToName").focus();
			if (parent.divadd!=""){document.getElementById("others").innerHTML=parent.divadd;}
			break;
		}
		case "close":
		{
			document.getElementById("HalonSendPrtTo").style.display="none";
			break;
		}
		case "add":
		{
			addSendToUser=document.getElementById("NewSendToName").value;
			if (addSendToUser!="")
			{
				parent.divadd = parent.divadd+ "<INPUT type='radio' id='rad1' name='radi"+parent.N+"' value="+addSendToUser+"  /> <td>"+addSendToUser+"</td><br>";
				document.getElementById("others").innerHTML=parent.divadd;
				parent.N++;
				parent.rad1(parent.N).checked=true;
			}
			document.getElementById("NewSendToName").value="";
			break;		
		}
		case "aplye":
		{
			if(parent.N!=0)
			{
				for (i=0;i<=parent.N;i++)
				{
					if (parent.rad1(i).checked == true)
					{
						document.getElementById("sendToView").innerText = parent.rad1(i).value ;
					}
				}
				if (document.getElementById("sendToView").innerText !="") document.getElementById("HalonSendPrtTo").style.display="none";
				
			}
			if(parent.N==0)
			{
				if (rad1.checked==true )
				{
				document.getElementById("sendToView").innerText="עצמי";
				document.getElementById("HalonSendPrtTo").style.display="none";
				}
				
			}
		}
	}
}



function addkamot()
{	
	//if (misparPrt.value)
	if (VBIsNumeric(misparPrt.value)==false)
	{misparPrt.value=1;}
	parent.HowMany=misparPrt.value;
	//	Userkamot.value=1;
	
	//HalonKamot.style.display="none";
}
function KamotPrt(a)
{
	if(a=="open")
	{HalonKamot.style.display="";}
	if (a=="close")
	{HalonKamot.style.display="";}
}
function MousOn(id,picNm)
{
	document.getElementById(id).src="images/"+picNm+".jpg";
}
function MousOut(id,picNm)
{
	document.getElementById(id).src="images/"+picNm+".jpg";
}
var presedDepList=false;
var presedDepPic=false;
var presedGrepList=false;
var presedGrepPic=false;
var presedGrepTtList=false;
var presedGrepTtPic=false;
function SwViewList(e)
{
	Sw=e;
	if (Sw=="list" & TwDep==1)
	{
		
		swfarowrd2=true;
		SwView="list";
		parent.SwViewer="list";
		if (presedDepList==false)
		{
		document.getElementById("frmtop").src="TopMenuDep.asp?FromKod=0&DepNmae="+DepNmae+"&UPDOWN=Up&SwView="+SwView;
		 presedDepList=true;
		 presedDepPic=false;
		 presedGrepList=false;
		 presedGrepPic=false;
		 presedGrepTtList=false;
		 presedGrepTtPic=false;
		}
	}
	if (Sw=="pic"& TwDep==1)
	{
		SwView="pic";
		parent.SwViewer="pic";
		if (presedDepPic==false)
		{
	     document.getElementById("frmtop").src="TopMenuDep.asp?FromKod=0&DepNmae="+DepNmae+"&UPDOWN=Up&SwView="+SwView;
		 presedDepList=false;
		 presedDepPic=true;
		 presedGrepList=false;
		 presedGrepPic=false;
		 presedGrepTtList=false;
		 presedGrepTtPic=false;
		}
	}
	if (Sw=="list" & TwGrp==1)
	{
		swfarowrd2=true;
		SwView="list";
		parent.SwViewer="list";
		if (presedGrepList==false)
		{
		document.getElementById("frmtop").src="TopMenuGrp.asp?FromKod=0&DepNmae="+GrpNmae+"&Counter="+ce+"&UPDOWN=reg&SwView="+SwView;
		 presedDepList=false;
		 presedDepPic=false;
		 presedGrepList=true;
		 presedGrepPic=false;
		 presedGrepTtList=false;
		 presedGrepTtPic=false;
		}
	}
	if (Sw=="pic" & TwGrp==1)
	{
		SwView="pic";
		parent.SwViewer="pic";
		if (presedGrepPic==false)
		{
			document.getElementById("frmtop").src="TopMenuGrp.asp?FromKod=0&DepNmae="+GrpNmae+"&Counter="+ce+"&UPDOWN=reg&SwView="+SwView;		
		     presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=true;
			 presedGrepTtList=false;
			 presedGrepTtPic=false;
		}
	}
	if (Sw=="list" & TwGrpTt==1)
	{
		swfarowrd2=true;
		SwView="list"; 
		parent.SwViewer="list";
		if (presedGrepTtList==false)
		{
		document.getElementById("frmtop").src="TopMenuGrpTt.asp?FromKod=0&DepNmae="+GrpTtNmae+"&Counter="+CGrptt+"&UPDOWN=reg&SwView="+SwView;
		     presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=false;
			 presedGrepTtList=true;
			 presedGrepTtPic=false;
		}
	}
	if (Sw=="pic" & TwGrpTt==1)
	{
		SwView="pic";
		parent.SwViewer="pic";
		if (presedGrepTtPic==false)
		{
		document.getElementById("frmtop").src="TopMenuGrpTt.asp?FromKod=0&DepNmae="+GrpTtNmae+"&Counter="+CGrptt+"&UPDOWN=reg&SwView="+SwView;		
		     presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=false;
			 presedGrepTtList=false;
			 presedGrepTtPic=true;
		}
	}
	////////////////////////////////////////////////////////////////////חלק תחתון
	if  (Sw=="all" & SwDep==1 )
	{
			 presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=false;
			 presedGrepTtList=false;
			 presedGrepTtPic=false;
		boll=true
		if (swViewAll.innerText=="הצג הכל" &  boll==true)
		{
			SwPrtView="all";
			boll=false
			swViewAll.innerText ="תמונה";
			SWviewtableOff();
			document.getElementById("frm").src="Get_Dep.asp?FromKod=0&SwView="+SwPrtView;
		 }
		if (swViewAll.innerText=="תמונה" & boll==true)
		{	
			SwPrtView="pic";
			boll=false;
			swViewAll.innerText ="הצג הכל";
			SWviewtableOff();
			document.getElementById("frm").src="Get_Dep.asp?FromKod=0&SwView="+SwPrtView;
		 
		}
	}
	if  (Sw=="all" & SwGrp==1)
	{
			 presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=false;
			 presedGrepTtList=false;
			 presedGrepTtPic=false;
		boll=true
		if (swViewAll.innerText=="הצג הכל" &  boll==true)
		{
			
			SwPrtView="all";
			boll=false
			swViewAll.innerText ="תמונה";
			SWviewtableOff();
			GetGrp(ce,DK,DepNmae,"",'dontDo');
		 }
		if (swViewAll.innerText=="תמונה" & boll==true)
		{	
			SwPrtView="pic";
			boll=false;
			swViewAll.innerText ="הצג הכל";
			SWviewtableOff();
			GetGrp(ce,DK,DepNmae,"",'dontDo');
		 
		}
		
	}
	if  ( Sw=="all" & SwGrpTt==1)
	{
			 presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=false;
			 presedGrepTtList=false;
			 presedGrepTtPic=false;
		
		boll=true;
		if (swViewAll.innerText=="הצג הכל" &  boll==true)
		{
			SwPrtView="all";
			boll=false
			swViewAll.innerText ="תמונה";
			SWviewtableOff();
			GetGrpTt(CGrptt,DKGrptt,AGrpTt,"",GrpPathf,'dontDo','','',NameGrpTeor);
		
		}
		if (swViewAll.innerText=="תמונה" & boll==true)
		{	
			SwPrtView="pic";
			boll=false;
			swViewAll.innerText ="הצג הכל";
			SWviewtableOff();
			GetGrpTt(CGrptt,DKGrptt,AGrpTt,"",GrpPathf,'dontDo','','',NameGrpTeor);
		 
		}
		
	}
	if (Sw=="all" & SwPrt==1)
	{
			 presedDepList=false;
			 presedDepPic=false;
			 presedGrepList=false;
			 presedGrepPic=false;
			 presedGrepTtList=false;
			 presedGrepTtPic=false;
			 boll=true
		if (swViewAll.innerText=="הצג הכל" &  boll==true)
		{
			SwPrtView="all";
			boll=false
			swViewAll.innerText ="תמונה";
			SWviewtableOn();
			GetPrt(Cprt,DKprt,Aprt,"",'dontDo');
		 }
		if (swViewAll.innerText=="תמונה" & boll==true)
		{	
			SwPrtView="pic";
			boll=false;
			swViewAll.innerText ="הצג הכל";
			SWviewtableOff();
			GetPrt(Cprt,DKprt,Aprt,"",'dontDo');
		 
		}
	}
	if (Sw=="Xx" & SwPrt==1)
	{
		SwPrtView="Xx";
		GetPrt(Cprt,DKprt,Aprt,"",'dontDo');
	}
				
}
function Order(e)
{
	switch (e)
	{
		case "abc":
		{	
			document.getElementById("mhir").style.color="";
			document.getElementById("Motag").style.color="";
			New.style.color="";
			OnSale.style.color="";
			document.getElementById("abc").style.color="red";
			orderBy="abc";
			if ("<%=SwSerch%>"=="true" & "<%=fromAdvanceSerch%>"=="true" )
			{		
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;		
				break;
			}	
			if ("<%=SwSerch%>"=="true" & "<%=SwMivtzaim%>"!="" )
			{		
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=reg&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;		
				break;
			}	
			if ("<%=SwSerch%>"=="true")
			{
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg" ;	
				break;
			}	
			GetPrt(Cprt,DKprt,Aprt,"",'dontDo');
			break;
		}
		case "mhir":
		{	
			document.getElementById("mhir").style.color="red";
			document.getElementById("Motag").style.color="";
			New.style.color="";
			OnSale.style.color="";
			document.getElementById("abc").style.color="";
			orderBy="Price";
			if ("<%=SwSerch%>"=="true" & "<%=fromAdvanceSerch%>"=="true" )
			{		
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;		
				break;
			}	
			if ("<%=SwSerch%>"=="true" & "<%=SwMivtzaim%>"!="" )
			{		
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=reg&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;		
				break;
			}
			if ("<%=SwSerch%>"=="true")
			{
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg" ;	
				break;
			}	
			GetPrt(Cprt,DKprt,Aprt,"",'dontDo');
			break;
		}
		case "Motag" :
		{
			document.getElementById("mhir").style.color="";
			document.getElementById("Motag").style.color="red";
			New.style.color="";
			OnSale.style.color="";
			document.getElementById("abc").style.color="";
			orderBy="Motag"
			if ("<%=SwSerch%>"=="true" & "<%=fromAdvanceSerch%>"=="true" )
			{		
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;		
				break;
			}
			if ("<%=SwSerch%>"=="true" & "<%=SwMivtzaim%>"!="" )
			{		
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=reg&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;		
				break;
			}	
			if ("<%=SwSerch%>"=="true")
			{
				document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg" ;	
				break;
			}
			GetPrt(Cprt,DKprt,Aprt,"",'dontDo');
			break;
		}
		
	}
}
var selectedPic=false;
var selectedlist=false;
function SwViewPrt(ListPic,p)
{	
	var Url;	
	SwGrp=1;
	p="Group";
	if(p=="Group")
	{ 
		p="Group";
		Counter=DepCounter;
		NameDGG=DepNmae;
		NameTeor=NameDepTeor;
		pathf=DepPathf;
	}	
	else if (p=="GroupTt")
	{
		p="GroupTt";
		Counter=GrpCounter;
		NameDGG=GrpNmae;
		NameTeor=NameGrpTeor;
		pathf=GrpPathf;
	}
	else if(p=="Products")
	{
		p="Products";
		Counter=GrpTtCounter;
		NameDGG=GrpTtNmae;
		NameTeor=NameGrpTtTeor;
		pathf=GrpTtPathf;
	}
	
	switch (ListPic)
	{
		
		case "pic":
		{
			swViewAll.style.display=""
			if (selectedPic==false)
			{ 
			if (p!="Get_Prt")SWviewtableOff();
			SwPrtView="pic";
			//document.getElementById("frm").src=p+".asp?FromKod=0&Counter="+Counter+"&SwView="+SwPrtView+"&orderBy="+orderBy+"&NameTeor="+NameTeor+"&pathf="+pathf+"&DepNmae="+NameDGG;	
			Url = p+".asp?FromKod=0&Counter="+Counter+"&SwView="+SwPrtView+"&orderBy="+orderBy+"&NameTeor="+NameTeor+"&pathf="+pathf+"&DepNmae="+NameDGG;		
			window.location.href = Url
			selectedlist=false;
			selectedPic=true;
			}
			break;
		}
		case "list": 
		{	
			swViewAll.style.display="none"
			if (selectedlist==false)
			{
			SWviewtableOn();
			SwPrtView="list";
			//document.getElementById("frm").src=p+".asp?FromKod=0&Counter="+Counter+"&SwView="+SwPrtView+"&orderBy="+orderBy+"&NameTeor="+NameTeor+"&pathf="+pathf+"&DepNmae="+NameDGG;
			Url = p+".asp?FromKod=0&Counter="+Counter+"&SwView="+SwPrtView+"&orderBy="+orderBy+"&NameTeor="+NameTeor+"&pathf="+pathf+"&DepNmae="+NameDGG;		
			window.location.href = Url
			selectedlist=true;
			selectedPic=false;
			}
			break;
		}
		
	}
}

function backToStart ()
{
	LastKodDep=0;
	LastKodGrp=0;
	LastKodPrt=0;
	LastKodGrpTt=0;
	previous.src="images/prv.jpg";
	previous.disabled=true;
	previous.style.display="none";
	previous9.src="images/bwd.jpg";
	previous9.disabled=true;
	previous9.style.display="none";
	swfarowrd=true;
	if ("<%=SwSerch%>"=="true" & "<%=fromAdvanceSerch%>"=="true" )
	{		
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;		
		return;
	}
	if ("<%=SwSerch%>"=="true" & "<%=SwMivtzaim%>"!="" )
	{		
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=reg&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;		
		return;
	}
	if ("<%=SwSerch%>"=="true")
	{
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=0&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg" ;	
		return;
	}	
	if (SwGrp==0 & SwDep==1 & SwPrt==0 & SwGrpTt==0)
	{
		document.getElementById("frm").src="Get_Dep.asp?FromKod=0&GoToEnd=0&UPDOWN=reg&SwView="+SwPrtView+"&NameTeor="+NameDepTeor+"&DepNmae="+DepNmae+"&pathf="+pathf;
	}
	if (SwGrp==1 & SwDep==0 & SwPrt==0 & SwGrpTt==0)
	{
		document.getElementById("frm").src="Get_Grp.asp?FromKod=0&GoToEnd=0&UPDOWN=reg&Counter="+ce+"&SwView="+SwPrtView+"&NameTeor="+NameDepTeor+"&DepNmae="+DepNmae+"&pathf="+pathf;
	}
	if (SwGrp==0 & SwDep==0 & SwPrt==0 & SwGrpTt==1)
	{
		document.getElementById("frm").src="Get_GrpTt.asp?FromKod=0&Counter="+GrpCounter+"&SwView="+SwPrtView+"&UPDOWN=reg&GoToEnd=0&orderBy="+orderBy+"&NameTeor="+NameGrpTeor+"&DepNmae="+GrpNmae+"&pathf="+DepPathf ;	
	}
	if (SwGrp==0 & SwDep==0 & SwPrt==1 & SwGrpTt==0)
	{
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&Counter="+GrpTtCounter+"&SwView="+SwPrtView+"&UPDOWN=reg&GoToEnd=0&orderBy="+orderBy+"&NameTeor="+NameGrpTtTeor+"&DepNmae="+GrpTtName+"&pathf="+GrpTtPathf;	
	}
}
function JampToEnd ()
{
	swfarowrd=true;
	previous.disabled=false;
	previous.style.display="";
	previous9.disabled=false;
	previous9.style.display="";
	next.src="images/nxt.jpg";
	next.disabled=true;
	next.style.display="none";
	next9.src="images/fwd.jpg";
	next9.disabled=true;
	next9.style.display="none";
	if ("<%=SwSerch%>"=="true" & "<%=fromAdvanceSerch%>"=="true" )
	{
		
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=1&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;	
		return;
	}
	if ("<%=SwSerch%>"=="true" & "<%=SwMivtzaim%>"!="" )
	{		
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=1&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=reg&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;	
		return;
	}
	if ("<%=SwSerch%>"=="true")
	{
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&GoToEnd=1&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=reg" ;	
		return;
	}
	if (SwGrp==0 & SwDep==1 & SwPrt==0 & SwGrpTt==0)
	{
	document.getElementById("frm").src="Get_Dep.asp?FromKod=0&GoToEnd=1&UPDOWN=reg&SwView="+SwPrtView+"&NameTeor="+NameDepTeor+"&DepNmae="+DepNmae;
	}
	if (SwGrp==1 & SwDep==0 & SwPrt==0 & SwGrpTt==0)
	{

	document.getElementById("frm").src="Get_Grp.asp?FromKod=0&GoToEnd=1&UPDOWN=reg&Counter="+ce+"&SwView="+SwPrtView+"&NameTeor="+NameDepTeor+"&DepNmae="+DepNmae+"&pathf="+DepPathf;
	}
	if (SwGrp==0 & SwDep==0 & SwPrt==0 & SwGrpTt==1)
	{
	document.getElementById("frm").src="Get_GrpTt.asp?FromKod=0&Counter="+GrpCounter+"&SwView="+SwPrtView+"&UPDOWN=reg&GoToEnd=1&orderBy="+orderBy+"&NameTeor="+NameGrpTeor+"&DepNmae="+GrpNmae+"&pathf="+GrpPathf;	
	}
	if (SwGrp==0 & SwDep==0 & SwPrt==1 & SwGrpTt==0)
	{
	document.getElementById("frm").src="Get_Prt.asp?FromKod=0&Counter="+GrpTtCounter+"&SwView="+SwPrtView+"&UPDOWN=reg&GoToEnd=1&orderBy="+orderBy+"&NameTeor="+NameGrpTtTeor+"&DepNmae="+GrpTtName;	
	}
}

function SWviewtableOn() 
{
	
	bigtable.style.display="none";
	colsp.colSpan=2;
	
}
function SWviewtableOff()
{
	bigtable.style.display="";
	colsp.colSpan=1;
}
function PageLeft2(n,m,num)
{	
	Num=parseInt(num)
	if (n<=Num)
	{
		document.getElementById("leftbutton").style.display="none";
		document.getElementById("rieghtbutton").style.display="none";
		return;
	}
	else
	{
		if (swfarowrd2==true)
		{	

			if (m <= Num)
			{	
				document.getElementById("leftbutton").style.display="none";
				document.getElementById("leftbutton").src="images/nxt_B.jpg";
				document.getElementById("leftbutton").disabled=true;
				
				document.getElementById("rieghtbutton").src='images/prv_B.jpg';
				document.getElementById("rieghtbutton").style.display="";
				document.getElementById("rieghtbutton").disabled=false;
			}
			else
			{
				document.getElementById("leftbutton").style.display="";
				document.getElementById("leftbutton").disabled=false;
				document.getElementById("rieghtbutton").style.display="";
				document.getElementById("rieghtbutton").disabled=false;
			}
			if (m==n)
			{	
				document.getElementById("rieghtbutton").style.display="none";
				document.getElementById("rieghtbutton").src='images/prv_B.jpg';
				document.getElementById("rieghtbutton").disabled=true;
			}
		}
		if (swfarowrd2==false)
		{	
			if (m <= 6)
			{
			document.getElementById("rieghtbutton").style.display="none";
			document.getElementById("rieghtbutton").src='images/prv_B.jpg';
			document.getElementById("rieghtbutton").disabled=true;
			document.getElementById("leftbutton").style.display="";
			document.getElementById("leftbutton").disabled=false;
			swfarowrd=true;
			}
			else
			{	
				document.getElementById("leftbutton").style.display="";
				document.getElementById("leftbutton").disabled=false;
				document.getElementById("rieghtbutton").style.display="";
				document.getElementById("rieghtbutton").disabled=false;
			}
		}
	}
}
function PageLeft(n,m,Num)
{

	if (parseInt(n) <= parseInt(Num) & swViewAll.innerText!="תמונה" ){//לא להציג "הצג הכל כאשר יש פחות מ 9"
		swViewAll.innerText="       ";
	}else{
		if (swViewAll.innerText!="תמונה")
		{swViewAll.innerText="הצג הכל";}
	}
	
	num=parseInt(Num)
	if (swfarowrd==true)
	{
		if ((n-m)>=num )
		{
		document.getElementById("previous").disabled=false;
		document.getElementById("previous").style.display="";
		document.getElementById("previous9").disabled=false;
		document.getElementById("previous9").style.display="";
		}
		if (m > num)	
		{
			D=(n-m)+num;
			E=(n-m)+1; 
			document.getElementById("next").disabled=false;
			document.getElementById("next").style.display="";
			document.getElementById("next9").disabled=false;
			document.getElementById("next9").style.display="";
		}
		else 
		{		
			D=n;
			E=(n-m)+1;
			document.getElementById("next").src="images/nxt.jpg";
			document.getElementById("next").disabled=true;
			document.getElementById("next").style.display="none";
			document.getElementById("next9").src="images/fwd.jpg";
			document.getElementById("next9").disabled=true;
			document.getElementById("next9").style.display="none";
		}
	}
    if (swfarowrd==false)
	{	
		
		if (m<=num)
		{
		document.getElementById("previous").src="images/prv.jpg";
		document.getElementById("previous").disabled=true;
		document.getElementById("previous").style.display="none";
		document.getElementById("previous9").src="images/bwd.jpg";
		document.getElementById("previous9").disabled=true;
		document.getElementById("previous9").style.display="none";
		document.getElementById("next").disabled=false;
		document.getElementById("next").style.display="";
		document.getElementById("next9").disabled=false;
		document.getElementById("next9").style.display="";
		
				
		swfarowrd=true;
		}
			
		(D=m);	E=(m -(num-1));
		
	}
		document.getElementById("Xfrom").innerHTML=n;
		document.getElementById("TotalLeft").innerHTML=D;
		document.getElementById("Total").innerHTML=E;
}
function OpenContinueSpan(Title,Teor)
{
	OpenContinueSpanTitle.innerHTML=Title;
	OpenContinueSpanBody.innerHTML=Teor;
	OpenedContinueSpan.style.display="";
}

var DoV="ok"
function BigPicture(n,Pic,from,Teor)
{
	var Teorb="";
	var DontDoMarqu="false";
	var _teor="";
	if (Teor) _teor=Teor.replace(String.fromCharCode(34),"`")//_teor = TeorReplace(Teor);

	
		if (Teor!="" & Teor!= undefined & Teor!="לא מוצג")
		{
			if (Teor.length>300)
			{
				Teorb=Teor.slice(0,280);
				window.setTimeout("ToContinueSpan.style.display='';",100);
				//window.setTimeout("document.getElementById(\"ToContinueSpan\").style.display='';",100);
				
			}else 
			{
				Teorb=_teor;
				window.setTimeout("ToContinueSpan.style.display='none';",100);
			}
				//window.setTimeout("document.getElementById(\"ToContinueSpan\").style.display='';",100);

			if (DontDoMarqu!="true")
			{
				if (n==DepNmae && SwGrp==1 || from=="ssGetGrp" ){					
					document.getElementById("BigPic").innerHTML = "<center><b>"+n+"</b></center><br />"+"<span style='font-weight: normal; font-size: 10px; TEXT-ALIGN: right'>"+ Teorb+"&nbsp;&nbsp;&nbsp;&nbsp<span id=ToContinueSpan style='display:none;font-size: 11px; font-family: Arial; font-weight:500;cursor:pointer;text-decoration:underline;color:blue' onclick=\"OpenContinueSpan('"+n+"','"+_teor+"')\" >לחץ להמשך..</sapn></sapn>";
				}
				else if (n==GrpNmae && SwGrpTt==1 || from=="ssGetGrpTt" ){					
					document.getElementById("BigPic").innerHTML = "<center><b>"+n+"</b></center><br />"+"<span style='font-weight: normal; font-size: 10px; TEXT-ALIGN: right'>"+ Teorb+"&nbsp;&nbsp;&nbsp;&nbsp<span id=ToContinueSpan style='display:none;font-size: 11px; font-family: Arial;font-weight:500;cursor:pointer;text-decoration:underline;color:blue' onclick=\"OpenContinueSpan('"+n+"','"+_teor+"')\" >לחץ להמשך..</sapn></sapn>";
				}
				else{						
					document.getElementById("BigPic").innerHTML = "<center><b>"+n+"</b></center><br />"+"<marquee id='marqTeor' SCROLLAMOUNT='2'  SCROLLDELAY='160' direction='up' BEHAVIOR='scroll' height=60 ><span style='font-weight: bold; font-size: 10px; VERTICAL-ALIGN: middle ; TEXT-ALIGN: right'>"+ Teorb+"<span id=ToContinueSpan style='display:none;font-size: 11px; font-family: Arial;font-weight:600'></span></sapn></marquee>";
				}
			}
		}
		else
		{	
			window.setTimeout("ToContinueSpan.style.display='none';",100)
			document.getElementById("BigPic").innerHTML="<center><b>"+n+"</b></center><br />"+"<marquee id='marqTeor' scrollamount='2'  scrolldelay='70' direction='up' behavior='scroll' width='360'  height='25px' border='1' ><span id=ToContinueSpan style='display:none;font-size: 11px; font-family: Arial;font-weight:600'></span></marquee>";
		}
		
		if(Pic!=null & Pic!="")
		{
			//document.getElementById("BigPic").style.height="60px";
			document.getElementById("BigPicJ").style.display="";
			document.getElementById("ImgJ").src=Pic;
		}
		else 
		{
		//document.getElementById("BigPicJ").style.display="none";
		document.getElementById("BigPic").style.height ="60px";
		}

}



/** 
* Calls to Main.asp
* Opens the window with full description of the products
* and removes the Cover from the picture "onclick"
*/
function addParit(namePrt, path, price, price2, prtCounter , engName, mida, picKod, barKod, idx, teurShort, TeurShimush, emptyA, emptyB, pathL, Mishloach, Cmt, Price3, Price4, Price5, Price6, SwTen, pathFA, pathFB, pathFSmall, pathFSmallA, pathFSmallB)
{
	removeAllCover();
	//('<%=NamePrt%>','<%if SwExs=1 then%><%=Replace(pathF,"\","\\")%><%end if%>',
	//'<%=Price%>','<%=Price2%>','<%=PrtCounter%>','<%=Eng_Nm%>','<%=Mida%>','','<%=picKod%>',
	//'<%=BarKodSuChef%>','','<%=Idx%>','<%=Replace(TeurShort,"'","\'")%>','<%=TeurShimush%>','','',
	//'<%if SwExsL=1 then%><%=Replace(pathL,"\","\\")%><%end if%>',
	//'<%=Mishloach%>','<%=Cmt%>','<%=Price3%>','<%=Price4%>','<%=Price5%>','<%=Price6%>','<%=SwTen%>',
	//'<%if SwExs2=1 then%><%= Replace(pathFA,"\","\\")%><%end if%>',
	//'<%if SwExs3=1 then%><%= Replace(pathFB,"\","\\")%><%end if%>',
	//'<%if SwExs4=1 then%><%= Replace(pathFSmall,"\","\\") %><%end if%>',
	//'<%if SwExs5=1 then%><%= Replace(pathFSmallA,"\","\\")%><%end if%>',
	//'<%if SwExs6=1 then%><%=Replace(pathFSmallB,"\","\\")%><%end if%>')
	
	PrtAdd(namePrt, path ,price, price2,prtCounter, engName, mida,picKod, barKod, idx, teurShort, TeurShimush,emptyA, emptyB, pathL, Mishloach, Cmt, Price3, Price4, Price5, Price6, SwTen, pathFA, pathFB, pathFSmall, pathFSmallA, pathFSmallB);

}



var Vpri1;
var VPrice3;
var VPrice5;
var VSwTen;
var SWThina;
//---------------1--2----3----4--5---6---7----8-----9------10----------11-----12-----13---------14----------15---------16-----------17 ----18------19---20----21------22------23----24-- /////////////////this function displayes selected Prt Stage
function PrtAdd(a,pic,pri2,pri1,C,E_Nm,mid,PrtKod,Kod,KodSuChef,kamotPrtEdit,Idx,TeurShort,TeurShimush,SendToEdit,editUserSendTo,PathL,Mishloach,Cmt,Price3,Price4,Price5,Price6,SwTen,picA,picB,picSmall,picSmallA,picSmallB)
{		

		//alert (PathL)
		//alert (pic + "\r\n" + picA + "\r\n" + picB + "\r\n" +picSmall + "\r\n" +picSmallA + "\r\n" +picSmallB + "\r\n" )
		
		//close the "Shipment to Window"
		//SendPrtTo('close');
				
		if (Price3!=undefined & Price3!=0)
		{
			Vpri1=pri2;
			VPrice3=Price3;
			VPrice5=Price5;
			VSwTen=SwTen;
		}
		
		if (Mishloach == undefined ){Mishloach='';}
		
		if (Cmt!="")
		{
			if(parseInt(Cmt) >0) {document.getElementById("EartMlay").innerHTML="המוצר במלאי. בד''כ נשלח בתוך 2-6 ימי עבודה";}
			if(parseInt(Cmt) <=0){document.getElementById("EartMlay").innerHTML="חסר זמנית במלאי. בד''כ נשלח בתוך 6-14 ימי עבודה";}
			if(parseInt(Cmt) <=0 & Mishloach =="פריט חסר במלאי"){
			document.getElementById("EartMlay").innerHTML="המוצר אזל מהמלאי.";
			document.getElementById("MlayIsNull").style.display="";
			}else{document.getElementById("MlayIsNull").style.display="none";}
		}
		
		if (GrpTtCounter=="231" & Price3!=undefined & Price3!="" & Price3!=0 ){ //תצוגת קומבו טחינה רק כאשר קבוצת משנה 231 נבחרה
			SWThina="true"
			document.getElementById("ThinaCombo").style.display="";
			document.getElementById("ThinaKotert").style.display="";
		}else{
			document.getElementById("ThinaCombo").style.display="none";
			document.getElementById("ThinaKotert").style.display="none";}
		
		if (PathL !="" & PathL!= undefined){
			document.getElementById("tage").innerHTML="";
			document.getElementById("IdxKod").style.display="";
			document.getElementById("IdxKod").src=PathL;
		}else{
			document.getElementById("tage").innerHTML="   ";
			document.getElementById("IdxKod").style.display="none";}
		 		
		if (editUserSendTo=="yes"){
			document.getElementById("HalonSendPrtTo").style.display="";
			document.getElementById("NewSendToName").focus();}
			
		if (SendToEdit!="" & SendToEdit!=undefined){
			document.getElementById("sendToView").innerHTML=SendToEdit;}
			
		if (kamotPrtEdit!=undefined & kamotPrtEdit!= ""){
			document.getElementById("HowMany").value=kamotPrtEdit;}
		
		FromKod=Kod;
		window.setTimeout("	document.getElementById('misparPrt').focus();",100);
		
		var test=typeof(document.getElementById("misparPrt").value);
		if (test!=undefined && document.getElementById("misparPrt").value!="")
		{
			if (VBIsNumeric(document.getElementById("misparPrt").value)==false)
			{document.getElementById("misparPrt").value=1;}
			document.getElementById("misparPrt").value=parent.HowMany;
			document.getElementById("ToolBar").style.display="none";
			document.getElementById("ToolBarBack").style.display="none";
		}
		else
		{document.getElementById("misparPrt").value=1;}
		
		var testEng_Nm=typeof(E_Nm);
		if (testEng_Nm!=undefined && E_Nm!="")
		{
			var TmpEng_Nm=E_Nm;
			E_Nm=TmpEng_Nm.replace('&quot;','\"');
			E_Nm=TmpEng_Nm.replace("&apos;","'");
			
			Eng_Nm=E_Nm;
		}
		else
		{Eng_Nm="";}
			
	
		var testA=a;
		testA=typeof(testA);
		if (testA!=undefined && a!="")
		{
			var TmpA=a;
			a=TmpA.replace('&quot;','\"');
			a=TmpA.replace("&apos;","'");
			aName=a;
		}
		else
		{aName="";}
			
		var testmid=typeof(mid);
		if (testmid!=undefined && mid!="")
		{
			var Tmpmid=mid;
			mid=Tmpmid.replace('&quot;','\"');
			mid=Tmpmid.replace("&apos;","'");
			AmatMida=mid;
		}
		else
		{AmatMida="";}
		
		Pri1=(parseFloat(pri2));
		if (VPrice3!=undefined & VPrice3!=""  & VPrice3!=0)
		{
			if (VSwTen=="True"){AmatMida="100 גרם";}
			if (VSwTen=="False"){AmatMida="500 גרם";}
		}
		Ckey=C;
		PathF=pic;
		BarKodSuChef=KodSuChef;
		document.getElementById("Cmakat").innerHTML=BarKodSuChef;
		
		if (TeurShimush!=undefined & TeurShimush!= "")
		{
			VarTeurShimush=TeurShimush;
			document.getElementById("OraotShimush").style.display="";
		}
		else
		{
			document.getElementById("OraotShimush").style.display="none";
			VarTeurShimush="";
		}
		 
		if(Eng_Nm!= undefined & Eng_Nm!=null ){document.getElementById("Pro_Nm").innerHTML = Eng_Nm;}
		
		if(Mishloach != '' & Mishloach !="פריט חסר במלאי")
		{
			var TmpMishloach=Mishloach;
			Mishloach=TmpMishloach.replace('&quot;','\"');
			Mishloach=TmpMishloach.replace("&apos;","'");

			document.getElementById("EartMishloach").style.display="";
			document.getElementById("EartMishloach").innerHTML=Mishloach;
		}
		else
		{document.getElementById("EartMishloach").style.display="none";}
		
		R=(pri1-pri2);
//R=VBFormatNumber(R,1);

		if (R!=0){document.getElementById("hisahon").style.visibility="visible";}
		else{document.getElementById("hisahon").style.visibility="hidden";}
	
		if(document.getElementById("A")!=null){document.getElementById("A").style.display="none";}
		document.getElementById("B").style.display="";

		var TmpTeurShort=TeurShort;
		TeurShort=TmpTeurShort.replace('&quot;','\"');
		TeurShort=TmpTeurShort.replace("&apos;","'");
		
		TeurLongTxt=TeurShort;
		Teur=Check7Rows(TeurShort);
		document.getElementById("OdotShort").innerHTML=Teur;
		
		document.getElementById("mida").innerHTML =mid;
		document.getElementById("mhHanot").innerHTML = pri1-0 +" "+"₪";
		document.getElementById("mhAtar").innerHTML  = pri2-0 +" "+"₪";
		

//---------------------- JAVA FormatNumber ------------------------------------
		var TmpR=new String(R);
		var	sS=TmpR.indexOf(".");
		var	sL=TmpR.length;
		var strS=new String(Math.round(TmpR.substring(0,sS)));
		var	strT=new String(Math.round(TmpR.substring(sS,TmpR.length)));
		var	NewR = ((strS + ".") +( strT + "  ₪"));
//---------------------- End FormatNumber ------------------------------------
			
		document.getElementById("hisahon").innerHTML = NewR; 
		HideShakilText();
		
		if (SwTen=="True")
		{	
			document.getElementById("mida").innerHTML ="100 גרם";
			document.getElementById("mida2").innerHTML ="500 גרם";
			document.getElementById("mida3").innerHTML ="1 ק''ג";
		}
		if (SwTen=="False")
		{
			document.getElementById("mida").innerHTML ="500 גרם";
			document.getElementById("mida2").innerHTML ="1 ק''ג";
			document.getElementById("mida3").innerHTML ="5 ק''ג";	
		}
		
		if (Price3!=undefined & Price3!=""  & Price3!=0 )
		{
			displayShakilText();				
			R2=(Price4-Price3);
//R2=VBFormatNumber(R2,1);
			
			if (R2!=0)
			{document.getElementById("hisahon2").style.visibility="visible";}
			else
			{document.getElementById("hisahon2").style.visibility="hidden";}
			
			document.getElementById("mhHanot2").innerHTML = Price4-0 +" "+"₪";
			document.getElementById("mhAtar2").innerHTML  = Price3 +" "+"₪";
			document.getElementById("hisahon2").innerHTML = R2+" "+"₪"; 
			 
			R2=(Price6-Price5);
//R2=VBFormatNumber(R2,1);
			if (R2!=0){
			document.getElementById("hisahon3").style.visibility="visible";
			}else{document.getElementById("hisahon3").style.visibility="hidden";}
			document.getElementById("mhHanot3").innerHTML = Price6-0 +" "+"₪";
			document.getElementById("mhAtar3").innerHTML  = Price5 +" "+"₪";
			document.getElementById("hisahon3").innerHTML = R2+" "+"₪";
		}
		
//document.getElementById("prodact").innerHTML =a;
//document.getElementById("misparPrt").value=1;
	
		if (pic!=null &pic!=""){
			document.getElementById("bigpictuerJ").style.display="";
			document.getElementById("ImgJA").src=pic;
			if (picSmall!=null &picSmall!=""){
			document.getElementById("sampelpicJ2").style.display="";
			document.getElementById("ImgJB").src=picSmall;}
			else
			{document.getElementById("sampelpicJ2").style.display="none";
			document.getElementById("ImgJAb").src="images/noImgSmall.png";}	
			if (picSmallA!=null &picSmallA!=""){
			document.getElementById("sampelpicJ1").style.display="";
			document.getElementById("ImgJC").src=picSmallA;}
			else
			{document.getElementById("sampelpicJ1").style.display="none";
			document.getElementById("ImgJAb").src="images/noImgSmall.png";}	
			if (picSmallB!=null &picSmallB!=""){
			document.getElementById("sampelpicJ3").style.display="";
			document.getElementById("ImgJAb").src=picSmallB;}
			else
			{document.getElementById("sampelpicJ3").style.display="none";
			document.getElementById("ImgJAb").src="images/noImgSmall.png";}	
		}else{
			document.getElementById("bigpictuerJ").style.display="";
			document.getElementById("ImgJA").src="images/noImgSmall.png";
			document.getElementById("sampelpicJ3").style.display="";
			document.getElementById("sampelpicJ1").style.display="none";
			document.getElementById("sampelpicJ2").style.display="none";
			document.getElementById("ImgJAb").src="images/noImgSmall.png";}
}
function displayShakilText()
{
			document.getElementById("mida2").style.visibility="visible";
			document.getElementById("mida3").style.visibility="visible";
			document.getElementById("mhHanot2").style.visibility="visible";
			document.getElementById("mhAtar2").style.visibility="visible";
			document.getElementById("mhHanot3").style.visibility="visible";
			document.getElementById("mhAtar3").style.visibility="visible";
}
function  HideShakilText()
{
			document.getElementById("mida2").style.visibility="hidden";
			document.getElementById("mida3").style.visibility="hidden";
			document.getElementById("mhHanot2").style.visibility="hidden";
			document.getElementById("mhAtar2").style.visibility="hidden";
			document.getElementById("hisahon2").style.visibility="hidden";
			document.getElementById("mhHanot3").style.visibility="hidden";
			document.getElementById("mhAtar3").style.visibility="hidden";
			document.getElementById("hisahon3").style.visibility="hidden";
}
var lastMishkalSelected='';
function selectMishkalStyle(e)
{
	RLastSelectMishkalStyle(lastMishkalSelected);
	document.getElementById("mida"+e).style.backgroundColor="#f2f2f2";
	document.getElementById("mhHanot"+e).style.backgroundColor="#f2f2f2";
	document.getElementById("mhAtar"+e).style.backgroundColor="#f2f2f2";
	document.getElementById("hisahon"+e).style.backgroundColor="#f2f2f2";
	lastMishkalSelected=e;
	SwPri1Mida();
}
function RLastSelectMishkalStyle (e)
{
	document.getElementById("mida"+e).style.backgroundColor="";
	document.getElementById("mhHanot"+e).style.backgroundColor="";
	document.getElementById("mhAtar"+e).style.backgroundColor="";
	document.getElementById("hisahon"+e).style.backgroundColor="";
}
function SwPri1Mida()
{
	if (VPrice3!=undefined & VPrice3!=""  & VPrice3!=0)
	{
			switch (lastMishkalSelected)
			{
				case "":
				{
					Pri1=Vpri1;
					if (VSwTen=="True"){AmatMida="100 גרם";}
					if (VSwTen=="False"){AmatMida="500 גרם";}
					break;
				}
				case "2":
				{
					Pri1=VPrice3;
					if (VSwTen=="True"){AmatMida="500 גרם";}
					if (VSwTen=="False"){AmatMida="1 ק''ג";}
					break;
				}
				case "3":
				{
					Pri1=VPrice5;
					if (VSwTen=="True"){AmatMida="1 ק''ג";}
					if (VSwTen=="False"){AmatMida="5 ק''ג";}
					break;
				}
			}
	}
}

function Check7Rows(Teur)
{
	if (Teur.length >=350)
	{
		Teur=VBLeft(Teur,350)
		document.getElementById("toContinue").style.display="";
		return Teur;
	}
	else
	{
		document.getElementById("toContinue").style.display="none";
		Teur=Teur;
		return Teur;
	}
}
function showTeorEmshech(TeurLongTxt)
{
	document.getElementById("TeorEmshech").style.display="";
	document.getElementById("InnerTextTeorEmshech").innerHTML=TeurLongTxt;
}
function backToItems() 
{
		document.getElementById("ToolBar").style.display="";
		document.getElementById("ToolBarBack").style.display="";
		A.style.display="";
		B.style.display="none";
}
var from="";
	


	
function PrtAdded ()  /////////////this function addes Prt To Xml --> PrtRow
{
	alert(document.getElementById("misparPrt").value);

				
	
	if (isNaN(document.getElementById("misparPrt").value))
	{
		document.getElementById("misparPrt").value = 1;
	}
	document.getElementById("HowMany").value = document.getElementById("misparPrt").value ;
	

	aName="name"
	Eng_Nm = "";
	Pri1 = "12";
	AmatMida = "";
	PathF = "";
	BarKodSuChef = "";
	SendTo = "";
	ThinaComboValue = "";



	document.getElementById("PrtRow").value = document.getElementById("PrtRow").value + "<ROW id='"+document.getElementById("IndId").value+"' Prt='"+document.getElementById("Ckey").value+"' Eng_Nm='"+Eng_Nm+"' Nm='"+ aName+"' Mhr='"+Pri1+"' Mida='"+AmatMida+"' Pictur='"+PathF+"'  HowMany='"+document.getElementById("HowMany").value+"' BarKodSuChef='"+BarKodSuChef+"' SendToUser='"+SendTo+"'  packing='1'  MarazType='"+ThinaComboValue+"' closer='"+document.getElementById("IndId").value+"'/>";
	
	document.getElementById("IndId").value = document.getElementById("IndId").value + 1
	
	SumRow=getVfXML(document.getElementById("PrtRow").value,"Mhr",1,document.getElementById("iRow").value-1);
	SumRow = 1;		
	SumRow = SumRow * document.getElementById("HowMany").value;
	document.getElementById("iRow").value=document.getElementById("iRow").value+1; 
	Coun=getCountRXML(document.getElementById("PrtRow").value)+(document.getElementById("HowMany").value-1);
	
	prtSumMhr=prtSumMhr + parseFloat(SumRow);
	document.getElementById("totalPrice").innerText=prtSumMhr+" "+"ש\"ח" ;     //VBFormatNumber(prtSumMhr,2)+" "+"ש\"ח" ;

	TotalPrtSum+=parseInt(HowMany);
	document.getElementById("itemsNumber").innerText=TotalPrtSum;
	
		
	//document.location.href =  "Agala.asp?FromKod="+FirstKodPrt+"&Counter="+GrpTtCounter+"&SwView=pic&UPDOWN=reg&GoToEnd=0&orderBy="+orderBy ;	
}


function PrtAdded88888 ()  /////////////this function addes Prt To Xml --> PrtRow
{

		// save packing option
		PackParit = packing.checked;
		// close the window with choice to where to send it
		HalonSendPrtTo.style.display="none";
		//================================
			
		addkamot();

		parent.TotalPrtNotNullSpacer.style.display="none";
		parent.TotalPrtNotNull.style.display="";
		parent.TotalPrtIsNull.style.display="none";
		parent.closebill.style.display="";
		//----------------------------------------
		aName=VBReplace(aName,"\"","&quot;");
		aName=VBReplace(aName,"'","&apos;");
			
		SendTo=document.getElementById("sendToView").innerText;
		SendTo=VBReplace(SendTo,"\"","&quot;");
		SendTo=VBReplace(SendTo,"'","&apos;");
			
		AmatMida=VBReplace(AmatMida,"\"","&quot;");
		AmatMida=VBReplace(AmatMida,"'","&apos;");
						
		Eng_Nm=VBReplace(Eng_Nm,"\"","&quot;");
		Eng_Nm=VBReplace(Eng_Nm,"'","&apos;");
		//------------------------------------------
			
		if (SWThina=="true"){ThinaComboValue=document.getElementById("ThinaComboVal").value;}
		else{ThinaComboValue="";}
						
		parent.PrtRow=parent.PrtRow+"<ROW id='"+parent.IndId+"' Prt='"+Ckey+"' Eng_Nm='"+Eng_Nm+"' Nm='"+ aName+"' Mhr='"+Pri1+"' Mida='"+AmatMida+"' Pictur='"+PathF+"'  HowMany='"+parent.HowMany+"' BarKodSuChef='"+BarKodSuChef+"' SendToUser='"+SendTo+"'  packing='"+packing.checked+"'  MarazType='"+ThinaComboValue+"' closer='"+parent.IndId+"'/>";
		parent.IndId=parent.IndId+1;
		SumRow=getVfXML(parent.PrtRow,"Mhr",0,parent.iRow);
			
		SumRow = SumRow * parent.HowMany;
		parent.iRow=parent.iRow+1; 
		Coun=getCountRXML(parent.PrtRow)+(parent.HowMany-1);
		parent.ADDPrtNum(Coun,SumRow);
		
		document.getElementById("ToolBar").style.display="";
		document.getElementById("ToolBarBack").style.display="";
		
	//	document.forms['frm1'].elements['A'].style.display="";
	//	document.forms['frm1'].elements['B'].style.display="none";

			
		if (from == "prtNext")
		{
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+FirstKodPrt+"&Counter="+GrpTtCounter+"&SwView=pic&UPDOWN=reg&GoToEnd=0&orderBy="+orderBy ;	
		}
		if("<%=con%>"=="2")///אם מגיע מהעגלה edit
		{
			parent.document.getElementById("closebill").innerText="סגור חשבון";
			parent.Billclose();
		}
		//alert(parent.PrtRow);	
		
}


function StretcheBottom()
{
	
		document.getElementById("Tbl1").style.display="none" ;
		document.getElementById("Tbl2").style.display="" ;
		document.getElementById("BottomMenue").style.height="100%";
		document.getElementById("Tbl2").style.height="100%" ;	
		document.getElementById("ToolBar").style.display="none";
		document.getElementById("ToolBarBack").style.display="none";
		document.getElementById("standard").style.display="none";
		document.getElementById("standardBackDown").style.display="";
		SwViewList('Xx');
}
function StretcheTop()
{
	    document.getElementById("Tbl2").style.display="none" ;
	    document.getElementById("Tbl1").style.display=""  ;
		document.getElementById("Tbl1").style.height="100%"  ;
}
function standartDisplay()
{
		SwViewPrt('pic');
		document.getElementById("standardBackDown").style.display="none";
		document.getElementById("inTopMenue").style.display=""	;
		document.getElementById("Tbl1").style.display="";
		document.getElementById("Tbl2").style.display="";
		document.getElementById("Tbl2").style.height="404";
		document.getElementById("BottomMenue").style.height="404";
		document.getElementById("Tbl1").style.height="30%";
		document.getElementById("ToolBar").style.display="";	
		document.getElementById("ToolBarBack").style.display="";
}
function getDep()
{
		document.getElementById("viewForm").style.display="none";
		document.getElementById("OrderBy").style.display="none";
		document.getElementById("abc").style.display="none";
		document.getElementById("mhir").style.display="none";
		document.getElementById("Motag").style.display="none";	
		document.getElementById("filtering").style.display="none";	
		document.getElementById("topClose").style.display="none";
		document.getElementById("ToolBar").style.left="790";
		SWviewtableOff();
		document.getElementById("frm").src="Get_Dep.asp?FromKod=0&SwView=pic";
		HideMidelToolBar();
		SwDep=1;
		SwGrp=0;
		SwGrpTt=0;
		SwPrt=0;
		
		TwDep=1;
		TwGrp=0;
		TwGrpTt=0;
}
function backOnePose()
{
	if (SwGrpTt==1 & TwGrp==1)
	{parent.returnToGrp();}
	if (TwGrpTt==1 &SwPrt==1 )
	{parent.returnToGrpTt();}
	
		/*SwDep=1;
		SwGrp=0;
		SwGrpTt=0;
		SwPrt=0;
		
		TwDep=1;
		TwGrp=0;
		TwGrpTt=0;) */
}
function ShowmidelToolBar()
{
		document.getElementById("viewForm").style.display="";
		minimize.style.display="";
//		document.getElementById("standard").style.display="";
}
function HideMidelToolBar()
{	
		document.getElementById("viewForm").style.display="none";
		minimize.style.display="none";
		document.getElementById("standard").style.display="none";
		BackIndex.style.display="none";
}
function getbeck()
{	
		document.getElementById("ToolBar").style.display="";
		document.getElementById("ToolBarBack").style.display="";
		Pictuers.style.display="";
		Baners.style.display="none";				
		SWviewtableOff();
		ShowmidelToolBar();
		document.getElementById("OrderBy").style.display="none";
		document.getElementById("abc").style.display="none";
		document.getElementById("mhir").style.display="none";
		document.getElementById("Motag").style.display="none";
		document.getElementById("filtering").style.display="none";
		document.getElementById("topClose").style.display="none";
		document.getElementById("ToolBar").style.left="790";
		swfarowrd=true;
		
}


function GetGrp(c,Dk,a,pathf,order,wich,NameDepTeor)
{
//alert("c="+c+"   a="+a);
		var Url = "Group.asp?FromKod=0&Counter="+c+"&DepNmae=" + a+"&SwView="+SwPrtView+"&pathf="+pathf;
		window.location.href = Url;
}


function GetGrp_OLD(c,Dk,a,pathf,order,wich,NameDepTeor)
{

	

		// close the description window of current group
		OpenedContinueSpan.style.display="none";

		tableYzranSelection.style.display="none";
		swfarowrd2=true;
		DepPathf=pathf;
		
		BigPicture(a,pathf,NameDepTeor,"ssGetGrp");
		document.getElementById("ToolBar").style.display="";
		document.getElementById("ToolBarBack").style.display="";
		FirstNevegationBAr.style.display="none";
		NevegationBAr.style.display="";
		
		parent.document.getElementById("UserNameView").style.display="none";
		parent.document.getElementById("UserNameOut").style.display="none";
		Pictuers.style.display="";
		Baners.style.display="none";
		ShowmidelToolBar();
		parent.indexD(c,Dk,a,pathf,NameDepTeor);

		tableUser.style.display="none"
		TopMenue.style.display=""
		previous.src="images/prv.jpg";
		previous.disabled=true;
		previous.style.display="none";
		previous9.src="images/bwd.jpg";
		previous9.disabled=true;
		previous9.style.display="none";
		ce=c;
		
		DK=Dk;
		NameDepTeor=NameDepTeor;
		DepNmae=a;	
		
		SwGrp=1;
		SwDep=0;
		SwPrt=0;
		SwGrpTt=0;
		
		TwDep=1;
		TwGrp=0;
		TwGrpTt=0;
				
		DepCounter=c;
		DepCounter2=c;
		
		
		if (order!='dontDo')
		{
			PageUp="TopMenuDep";
			document.getElementById("frmtop").src="TopMenuDep.asp?FromKod="+ Dk + "&DepNmae=" + a+"&UPDOWN=reg&SwView="+SwView+"&pathf="+pathf;
		}		
		PageDown="Get_Grp";
		document.getElementById("frm").src="Get_Grp.asp?FromKod=0&Counter="+c+"&NameTeor="+NameDepTeor+"&DepNmae=" + a+"&SwView="+SwPrtView+"&pathf="+pathf;
		
		if (wich!= "" & wich != undefined)
		{
			if (wich-6 > 0)wich=0+(wich-6) ;
			ActivateFlash(wich);
		}
}
	
	var CeParent;
	var DKGrptt;
	var CGrptt;
	var firstKodGrpTop=0;
	
	function GetGrpTt(c,Dk,a,CeParent,pathf,order,wich,firstKodGrpTop,GrpTeor)
	{
		//var Url = "GroupTt.asp?FromKod=0&Counter=" +c+"&NameTeor="+NameGrpTeor+"&DepNmae="+a+"&SwView="+SwPrtView +"&orderBy="+orderBy +"&pathf="+pathf;	
		var Url = "GroupTt.asp?FromKod=" +Dk+"&Grp=" +c+"&Counter=" +wich+"&NameTeor="+NameGrpTeor+"&DepNmae="+a+"&SwView="+SwPrtView +"&orderBy="+orderBy +"&pathf="+pathf;	
		window.location.href = Url;
	}
	
	function GetGrpTt_OLD(c,Dk,a,CeParent,pathf,order,wich,firstKodGrpTop,GrpTeor)
	{	
		// close the description window of current group
		OpenedContinueSpan.style.display="none";
		
		swfarowrd2=true;
		BackIndex.style.display="";
		GrpPathf=pathf;
		NameGrpTeor=GrpTeor;
		
		BigPicture(a,pathf,NameGrpTeor,"ssGetGrpTt");
		
		CGrptt=c;
		DKGrptt=Dk;
		AGrpTt=a;
		Baners.style.display="none";
		FirstNevegationBAr.style.display="none";
		NevegationBAr.style.display="";
		ShowmidelToolBar();
		tableUser.style.display="none";
		TopMenue.style.display="";
		previous.src="images/prv.jpg";
		previous.disabled=true;
		previous.style.display="none";
		previous9.src="images/bwd.jpg";
		previous9.disabled=true;
		previous9.style.display="none";
		if (CeParent != undefined & CeParent!="" )
		{
		 ce=CeParent;
		}
		
		parent.indexG(c,Dk,a,ce,GrpPathf,NameGrpTeor);
					
		SwPrt=0;
		SwGrp=0;
		SwDep=0;
		SwGrpTt=1;
		
		TwDep=0;
		TwGrp=1;
		TwGrpTt=0;	
		
		GrpCounter=c;
		GrpNmae=a;
		GrpCounter2=c;
	   	DepCounter2=ce;
   
		if (order!="dontDo")
    	{
    		if(firstKodGrpTop){ firstKod=firstKodGrpTop;}
    		else {firstKod=Dk;}
    	PageUp="TopMenuGrp";
    	 
    	document.getElementById("frmtop").src="TopMenuGrp.asp?FromKod="+firstKod+"&DepNmae="+a+"&Counter="+ce+"&UPDOWN=reg&SwView="+SwView+"&pathf="+pathf;
		}
		
		PageDown="Get_GrpTt";
		document.getElementById("frm").src="Get_GrpTt.asp?FromKod=0&Counter=" +c+"&NameTeor="+NameGrpTeor+"&DepNmae="+a+"&SwView="+SwPrtView +"&orderBy="+orderBy +"&pathf="+pathf;	
		
			if (wich!= "" & wich!= undefined)
		{
			if (wich-6 > 0)wich=0+(wich-6) ;
			ActivateFlash(wich);
		}
	}


	function getProductPage(NamePrt)
	{
		var Url = "ProductPage.asp?FromKod=0&NamePrt="+NamePrt ;
		window.location.href = Url;
	}	
	
	function GetPrt(c,Dk,a,pathF,order,wich,firstKodGrpTtTop,preload,IfSerch)
	{
		var Url = "Products.asp?FromKod=0&Counter=" +c+"&Grp=" +wich+"&DepNmae="+a+"&SwView="+SwPrtView +"&orderBy="+orderBy ;
		window.location.href = Url;
	}
	
	function GetPrtDescription(a,pic,pri2,pri1,C,E_Nm,mida,PrtKod,Kod,KodSuChef,kamotPrtEdit,Idx,TeurShort,TeurShimush,SendToEdit,editUserSendTo,PathL,Mishloach,Cmt,Price3,Price4,Price5,Price6,SwTen,picA,picB,picSmall,picSmallA,picSmallB)
	{
		var Url = "ProductPage.asp?a="+a+"&pic="+pic+"&pri2="+pri2+"&pri1="+pri1+"&C="+C+"&E_Nm="+E_Nm+"&mida="+mida+"&PrtKod="+PrtKod+"&Kod="+Kod+"&KodSuChef="+KodSuChef+"&kamotPrtEdit="+kamotPrtEdit+"&Idx="+Idx+"&TeurShort="+TeurShort+"&TeurShimush="+TeurShimush+"&SendToEdit="+SendToEdit+"&editUserSendTo="+editUserSendTo+"&PathL="+PathL+"&Mishloach="+Mishloach+"&Cmt="+Cmt+"&Price3="+Price3+"&Price4="+Price4+"&Price5="+Price5+"&Price6="+Price6+"&SwTen="+SwTen+"&picA="+picA+"&picB="+picB+"&picSmall="+picSmall+"&picSmallA="+picSmallA+"&picSmallB="+picSmallB;
//alert(Url);
		window.location.href = Url;
		
	}
		
	function GetPrt_OLD(c,Dk,a,pathF,order,wich,firstKodGrpTtTop,preload,IfSerch)
	{
	
		// close the description window of current group
		OpenedContinueSpan.style.display="none";
		
		if (preload!= undefined && preload!= "")
		{  frm.loading.style.display="";
			frm.document.getElementById("BottomMenue").style.display="none";
		}
		swfarowrd2=true;
		Cprt=c;
		DKprt=Dk;
		Aprt=a;
		tableUser.style.display="none"
		TopMenue.style.display=""
		ShowmidelToolBar();
		FirstNevegationBAr.style.display="none";
		NevegationBAr.style.display="";
		document.getElementById("OrderBy").style.display="";
		document.getElementById("abc").style.display="";
		document.getElementById("mhir").style.display="";
		document.getElementById("Motag").style.display="";
		document.getElementById("filtering").style.display="";
		document.getElementById("topClose").style.display=""
		document.getElementById("ToolBar").style.left="770"
		previous.src="images/prv.jpg";
		previous.disabled=true;
		previous.style.display="none";
		previous9.src="images/bwd.jpg";
		previous9.disabled=true;
		previous9.style.display="none";
		parent.indexGTt(c,a);
		
		SWviewtableOn();
		
		SwPrt=1;
		SwGrp=0;
		SwDep=0;
		SwGrpTt=0;
		
		TwDep=0;
		TwGrp=0;
		TwGrpTt=1;	
		
		GrpTtCounter=Cprt; 
		GrpTtNmae=a;
		
			if (order!="dontDo")
		{
			if(firstKodGrpTtTop!="" & firstKodGrpTtTop!=0 & firstKodGrpTtTop != undefined){ firstKod=firstKodGrpTtTop;}
    		else {firstKod=DKprt;}
    		PageUp="TopMenuGrpTt";
			document.getElementById("frmtop").src="TopMenuGrpTt.asp?FromKod="+firstKod+"&DepNmae="+a+"&Counter="+CGrptt+"&UPDOWN=reg&SwView="+SwView;
		}
		PageDown="Get_Prt";
		document.getElementById("frm").src="Get_Prt.asp?FromKod=0&Counter=" +c+"&SwView="+SwPrtView +"&orderBy="+orderBy ;	
				
		if (wich!= "" & wich!= undefined)
		{
			if (wich-6 > 0)wich=0+(wich-6) ;
			ActivateFlash(wich);
		}
	}
function SerchDifduf(e)
{

	if (e == 1)
	{
		swfarowrd=true;
		previous.disabled=false;
		previous.style.display="";
		previous9.disabled=false;
		previous9.style.display="";
		LastKod=LastKodPrt;
		
		if ("<%=fromAdvanceSerch%>"=="true")
		{
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+LastKod+"&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=Up&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;	
			return;
		}
		if ("<%=SwMivtzaim%>"!="")
		{
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+LastKod+"&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=Up&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;	
			return;
		}
				
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+LastKod+"&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=Up" ;	
		
	}
	if (e == -1)
	{
		next.disabled=false;
		next.style.display="";
		next9.disabled=false;
		next9.style.display="";
		swfarowrd=false;
		LastKod=FirstKodPrt;
		if ("<%=fromAdvanceSerch%>"=="true")
		{
			
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+LastKod+"&SwView=XxAdvanceSerch&orderBy=Serch"+orderBy+"&UPDOWN=Down&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;	
			return;
		}
		if ("<%=SwMivtzaim%>"!="")
		{
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+LastKod+"&SwView=Mivtzaim&orderBy=Serch"+orderBy+"&UPDOWN=Down&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;	
			return;
		}		 
		
			document.getElementById("frm").src="Get_Prt.asp?FromKod="+LastKod+"&SerchWord=<%=SerchWord%>&SwView=XxSerch&orderBy=Serch"+orderBy+"&UPDOWN=Down" ;
		
	}
}
function GetGrpDifduf(e)
{
	if ("<%=SwSerch%>"=="true")
	{
		SerchDifduf(e);
		return;
	}
//---------------------------	
	if (e == 1)
	{
		swfarowrd=true;
		previous.disabled=false;
		previous.style.display="";
		previous9.disabled=false;
		previous9.style.display="";
		p="Get_Dep";
		Counter=0;
				
		LastKod=LastKodDep;
		
		if(SwGrp==1)
		{ 
			p="Get_Grp";
			Counter=DepCounter;
			LastKod=LastKodGrp;
			NameDGG=DepNmae;
			NameTeor=NameDepTeor;
			pathf=DepPathf;
		}	
		if (SwGrpTt==1)
		{
			p="Get_GrpTt";
			Counter=GrpCounter;
			LastKod=LastKodGrpTt;
			NameDGG=GrpNmae;
			NameTeor=NameGrpTeor;
			pathf=GrpPathf;
		}
		if(SwPrt==1)
		{
			p="Get_Prt";
			Counter=GrpTtCounter;
			LastKod=LastKodPrt;
			NameDGG=GrpTtNmae;
			NameTeor=NameGrpTtTeor;
			pathf=GrpTtPathf;
		}
		document.getElementById("frm").src=p+".asp?FromKod="+LastKod+"&Counter=" +Counter+"&NameTeor="+NameTeor+"&DepNmae="+NameDGG+"&UPDOWN=Up&SwView="+SwPrtView+"&orderBy="+orderBy+"&pathf="+pathf;
	}
	if (e == -1)
	{
		next.disabled=false;
		next.style.display="";
		next9.disabled=false;
		next9.style.display="";
		swfarowrd=false;
		
		p="Get_Dep";
		Counter=0;
				
		LastKod=firstKodDep;
		
		if(SwGrp==1)
		{	
			p="Get_Grp";
			Counter=DepCounter;
			LastKod=firstKodGrp;
			NameDGG=DepNmae;
			NameTeor=NameDepTeor;
			pathf=DepPathf;
		}	
		if(SwGrpTt==1)
		{
			p="Get_GrpTt";
			Counter=GrpCounter;
			LastKod=firstKodGrpTt;
			NameDGG=GrpNmae;
			NameTeor=NameGrpTeor;
			pathf=GrpPathf;
		}
		if(SwPrt==1)	
		{
			p="Get_Prt";
			Counter=GrpTtCounter;
			LastKod=FirstKodPrt;
			NameDGG=GrpTtNmae;
			NameTeor=NameGrpTtTeor;
			pathf=GrpTtPathf;
		}
		
		document.getElementById("frm").src=p+".asp?FromKod="+LastKod+"&Counter=" +Counter+"&NameTeor="+NameTeor+"&DepNmae="+NameDGG+"&UPDOWN=Down&SwView="+SwPrtView+"&orderBy="+orderBy+"&pathf="+pathf;
	}
	if (e == 2) 
	{
		document.getElementById("rieghtbutton").disabled=false;
		swfarowrd2=true;
		if (TwDep == 1)
		{
			p="TopMenuDep";
			thisName=DepNmae;
			Counter=0;
			LastKod=LastKodDep2;
		}
		if (TwGrp == 1)
		{
			p="TopMenuGrp";
			Counter=DepCounter2;
			LastKod=LastKodGrp2;
			thisName=GrpNmae;
		}
		if (TwGrpTt ==1)
		{
			p="TopMenuGrpTt";
			Counter=GrpCounter2;
			LastKod=LastKodGrpTt2;
			thisName=GrpTtNmae;
		}
		document.getElementById("frmtop").src=p+".asp?FromKod="+LastKod+"&Counter=" +Counter+"&UPDOWN=Up&DepNmae="+ thisName+"&SwView="+SwView;
	}
	if (e == -2)  
	{	
		swfarowrd2=false;
		if (TwDep == 1)
		{
			p="TopMenuDep";
			Counter=0;
			LastKod=firstKodDep2;
			thisName=DepNmae;
		}
		if(TwGrp==1)
		{	
			
			p="TopMenuGrp";
			Counter=DepCounter2;
			LastKod=firstKodGrp2;
			thisName=GrpNmae;
		}
		if(TwGrpTt==1)
		{	
			p="TopMenuGrpTt";
			Counter=GrpCounter2;
			LastKod=firstKodGrpTt2;
			thisName=GrpTtNmae;			
		}	
		
		document.getElementById("frmtop").src=p+".asp?FromKod="+LastKod+"&Counter=" +Counter+"&UPDOWN=Down&DepNmae="+ thisName+"&SwView="+SwView;
	}			
}
function goToLink(page,menu,loc)
{
	parent.goToLink(page,menu,loc)
}
function userName (ans)
{
	//parent.UserDetail()
	UserLoginNm(ans)
}
if ("<%=NewName%>" != "")userName("<%=NewName%>");	
if("<%=returnToDep%>"=="1")parent.returnToDepCont();
if("<%=returnToDep%>"=="2")parent.returnToGrpCont();
if("<%=returnToDep%>"=="3")parent.returnToGrpTtCont();
if("<%=con%>"=="1")parent.BillcloseAction();
if("<%=con%>"=="3")parent.gotoLastePageAction();
function EditRow5()
{	
	A.style.display="none";
	B.style.display="";
	
}
function  OnLoad ()
{
	if ("<%=SwSerch%>"=="true")
	{	
		SwPrt=1;
		SwGrp=0;
		SwDep=0;
		SwGrpTt=0;
		
		TwDep=0;
		TwGrp=0;
		TwGrpTt=1;	
		SWviewtableOn();
	//------------------------------------	StretcheBottom()
		document.getElementById("Tbl2").style.display="" ;
		document.getElementById("BottomMenue").style.height="100%";
		document.getElementById("Tbl2").style.height="100%" ;	
		document.getElementById("standard").style.display="none";
	//------------------------------------	show-topToolBar
		NevegationBAr.style.display="";
		document.getElementById("OrderBy").style.display="";
		document.getElementById("abc").style.display="";
		document.getElementById("mhir").style.display="";
		document.getElementById("Motag").style.display="";
		document.getElementById("filtering").style.display="";
		document.getElementById("previous").disabled=true;
		document.getElementById("previous").style.display="none";
		document.getElementById("previous9").disabled=true;
		document.getElementById("previous9").style.display="none";
	//------------------------------------
	
		if ("<%=fromAdvanceSerch%>"=="true")
		{
			document.getElementById("frm").src="Get_Prt.asp?FromKod=0&SwView=XxAdvanceSerch&orderBy=Serchabc&SerchWord=<%=SerchWord%>&choice=<%=choice%>&Kategory=<%=Kategory%>&ExactPhrase=<%=ExactPhrase%>&Min=<%=Min%>&Max=<%=Max%>&Izran=<%=Izran%>" ;	
			return;
		}
		if ("<%=SwMivtzaim%>"!="")
		{
			document.getElementById("frm").src="Get_Prt.asp?FromKod=0&SwView=Mivtzaim&orderBy=Serchabc&DegemC=<%=SwMivtzaim%>&GDGimor=<%=GDGimor%>" ;	
			return;
		}
			document.getElementById("frm").src="Get_Prt.asp?FromKod=0&SwView=XxSerch&orderBy=Serchabc&SerchWord=<%=SerchWord%>" ;	
	}
	else
	{
		if (parent.HowMany=="")
		{
			parent.HowMany=1;
		}
		if("<%=con%>"=="2")
		{
			A.style.display="none";
			B.style.display="";
			NvegationBar.style.display="none";
			cartStat.innerText="חזור לסל";
			//alert("<%=Nm%>"+"&"+"<%=PathF%>"+"&="+"<%=Mhr%>"+"&"+"<%=Mida%>"+"&"+"<%=kamot%>"+"&"+"<%=SendToEdit%>"+"&"+"<%=editUserSendTo%>")
     		//    --------1------------2-----------3-------------4--------5---------6-----------7------8--9------------10---------11------12-----------13--------14---------15-----------------16---------			
			PrtAdd("<%=NamePrt%>","<%=PathShow%>","<%=Price%>","<%=Price2%>","","<%=Eng_Nm%>","<%=Mida%>","","","<%=BarKodSuChef%>","<%=kamot%>","","<%=TeurShort%>","<%=TeurShimush%>","<%=SendToEdit%>","<%=editUserSendTo%>","<%=pathLShow%>","<%=Mishloach%>","<%=Cmt%>","<%=Price3%>","<%=Price4%>","<%=Price5%>","<%=Price6%>","<%=SwTen%>");
		}
		
	}		
	
	switch ("<%=LinkTo%>")
	{	
		case "Pgt" :
		{
			ce="<%=GrpTopCounterX%>"
			GetGrpTt("<%=GrpCounterX%>","0","<%=NameGrpX%>","<%=GrpTopCounterX%>","<%=Prt_Grp_PathShow%>","abc","dontDo","0","<%=NameGrpTeorX%>");
			
		}
	}
}

/* -------- Main Page End -------------------------------------------------------------- */




/* -------- Get Dep -------------------------------------------------------------- */
var lastqube;
var onload=true;
function doOut(idi)
{	
	document.getElementById(idi).style.display="none"
}
function BigPicture_OLD(name,pathf,id,Teor)
{

	if (onload==false)
	{
		
		document.getElementById(lastqube).style.display="none";
	}	
	
	//BigPicture(name,pathf,Teor,"Get_Dep.asp");
	lastqube=id;
	document.getElementById(id).style.display="";
	onload=false;
	
}
function NoBigPicture(id)
{	
	if (onload==false)
	{
		
		document.getElementById(lastqube).style.display="none";
	}	
		
	lastqube=id;
	document.getElementById(id).style.display="";
	onload=false;
}
//parent.tableUser.style.display="";//מטפל בדפדוף אחורה
//parent.TopMenue.style.display="none";//מטפל בדפדוף אחורה
//parent.PageUp="StartLogo";
//parent.IEArrows("Get_Dep","bottom");

//parent.LastKodDep="<%=LastKodDep%>";
//parent.firstKodDep="<%=firstKodDep%>"; 
//parent.PageLeft("<%=countRs%>","<%=countCurrent%>","<%=num%>");

/* -------- Get Dep End ----------------------------------------------------------- */


/* -------- Get Grp  -------------------------------------------------------------- */
function BigPicture2(n,Pic,id,idPic,th)
{
underline(th);
if (id != "" & id != null & id!=undefined & document.getElementById(id)!=null){	document.getElementById(id).innerText = n;}
		if(Pic != undefined & Pic!= null & Pic!= "" & document.getElementById(idPic)!=null)
		{
			document.getElementById(idPic).style.display="";
			document.getElementById(idPic).src=Pic;
		}
		if (Pic == ""  & document.getElementById(idPic)!=null )
		{ 
			document.getElementById(idPic).style.display="";
			document.getElementById(idPic).src="images/noImgSmall.png";
		}
}

function underline (e)
{	
	document.getElementById(e).style.background = "#f2f2f2";
}
function rline (e)
{
	document.getElementById(e).style.background = "";
}

//parent.firstKodGrpTop="<%=firstKodGrpTop%>"
//parent.LastKodGrp="<%=LastKodGrp%>";
//parent.firstKodGrp="<%=firstKodGrp%>";
//parent.PageLeft("<%=countRs%>","<%=countCurrent%>","<%=num%>");

//parent.IEArrows("Get_Grp","bottom");

/* -------- Get Grp  End ---------------------------------------------------------- */




/* -------- topMenuDep  ------------------------------------------------------------ */
var onload=true;
function OverOver(idi)
{
	document.getElementById(idi).style.display=""
}
function doOutTop(name,pathf,idi)
{		
	document.getElementById(idi).style.display="none"
	if (pathf=="")pathf="images/noImgSmall.png";
	//parent.BigPicture(name,pathf);
}
function removAllCovers()
{
	last="<%=endofcover%>"
	for (i=1;i<=last;i++)
	{
		document.getElementById('idi'+i).style.display="none"
	}
}
function mouseOn(name,pathf,id)
{	
	if (onload==false)
	{
		
		document.getElementById(lastqube).style.display="none";
	}	
	//if (pathf=="")pathf="images/Logo.jpg"
	//parent.BigPicture(name,pathf);	
	lastqube=id;
	document.getElementById(id).style.display="";
	onload=false;
}
function setOpacity(e,value)
{
	document.getElementById(e).style.filter = "Alpha(Opacity="+value+")"; 
}

function underline (e,g,z)
{
	if (g != z)
	{
	document.getElementById(e).style.color=""
	document.getElementById(e).style.textDecoration=""
	setOpacity(e,20);
	}
	
}
function rline (e)
{
	document.getElementById(e).style.color=""
	document.getElementById(e).style.textDecoration=""
	setOpacity(e,75);
} 

function ChangeKamot(id)
{
	itemQty = document.getElementById('misparPrt'+id).value;
			
	var val=parseFloat(itemQty);
	if (isNaN(val))
	{
		alert ("!ניתן להקיש מספר בלבד");
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	else if (val==0)
	{
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	var CartStr = ajaxGeneral('ajaxUpdateCart.asp?CartC='+ id + '&Qty='+ itemQty,0);
	CartItems = CartStr.substring(0,CartStr.indexOf(','));
	CartPrice = CartStr.substring(CartStr.indexOf(',')+1);
	sal_kniotStr="<table border=0 title='סיכום חשבון' width=190 style='cursor:pointer;' align=left onclick='document.location.href=&quot;Agala.asp?FromPage=<%=SCRIPT_NAME%>&quot;' ><tr><td><b>&nbsp;&nbsp;"+addCommas(Number(CartPrice).toFixed(2))+"&nbsp;ש''ח</b></td><td width=32><img  src='images/ico_sal.png'  width='32' height=21></td></tr></table>";
	document.getElementById('sal_kniot').innerHTML =sal_kniotStr ;
}
		
function indecPrt(a,id,row,qtycmt,swshakil)
{ 
	if(document.getElementById("SwCart"+id).innerText=="1"  )
		return;
	if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
		if (a=="increase")
		{
			if (swshakil=="1"){
			
				document.getElementById("misparPrt"+id).value=Number(parseFloat(document.getElementById("misparPrt"+id).value)+parseFloat(qtycmt)).toFixed(1);}
			else
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+1;
		}
		else
		{//decrease
			if (swshakil=="1")
				{
					if((parseFloat(document.getElementById("misparPrt"+id).value)-qtycmt)<=0) return;
					document.getElementById("misparPrt"+id).value=Number(parseFloat(document.getElementById("misparPrt"+id).value)-parseFloat(qtycmt)).toFixed(1);
				}
			else{
					if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0) return;
					document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-1;
				}
		}
}
				
function addToCart(id,row,SwShakil,Path,LkC,qtycmt)
{
	if( LkC != "")
	{
	if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==1)
		alert("יש להקיש כמות");
	else {if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==0)	
			document.getElementById("misparPrt"+id).value=1;}
	   //  else
		//	document.getElementById("misparPrt"+id).value=Number(qtycmt).toFixed(1);}
	if((parseFloat(document.getElementById("misparPrt"+id).value))>0)
		{	
			if (Path == undefined) Path="";
			ajaxGeneral(Path+"ajaxAddToCart.asp?Prt="+id+"&Qty="+ document.getElementById('misparPrt'+id).value,0);
			document.getElementById(row).innerHTML="&nbsp;&nbsp;<img SRC='images/ico_sal.png' width=32 height=21 border=0  onclick='document.location.href=&quot;Agala.asp?FromPage=<%=SCRIPT_NAME%>&quot;' style='cursor:pointer;'  title='סיכום חשבון'><span id='SwCart"+id+"' style='display:none;'>1</span>";
			document.getElementById("misparPrt"+id).readOnly="true";
			document.getElementById("inc"+id).style.display ="none";
			document.getElementById("dec"+id).style.display ="none";
			document.getElementById(row).style.background="";
			ChangeKamot(id);
		}	
	}
	else document.location.href="Registration.asp";		
}



function ChangeKamotOrganic(id)
{
	itemQty = document.getElementById('misparPrt'+id).value;
			
	var val=parseFloat(itemQty);
	if (isNaN(val))
	{
		alert ("!ניתן להקיש מספר בלבד");
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	else if (val==0)
	{
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	var CartStr = ajaxGeneral('../ajaxUpdateCart.asp?CartC='+ id + '&Qty='+ itemQty,0);
	CartItems = CartStr.substring(0,CartStr.indexOf(','));
	CartPrice = CartStr.substring(CartStr.indexOf(',')+1);
	sal_kniotStr="<b>&nbsp;&nbsp;"+addCommas(Number(CartItems).toFixed(2))+"&nbsp;פריטים</b>";
	document.getElementById('sal_kniot').innerHTML =sal_kniotStr ;
	if (document.getElementById('TblAgala').style.display=="none")
		{document.getElementById('TblAgala').style.display="";
		document.getElementById('TblAgala2').style.display="";
		document.getElementById('TdAgala').style.visibility="hidden";}
}
function ChangeKamotFunky(id)
{
	itemQty = document.getElementById('misparPrt'+id).value;
			
	var val=parseFloat(itemQty);
	if (isNaN(val))
	{
		alert ("!ניתן להקיש מספר בלבד");
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	else if (val==0)
	{
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	var CartStr = ajaxGeneral('../ajaxUpdateCart.asp?CartC='+ id + '&Qty='+ itemQty,0);
	CartItems = CartStr.substring(0,CartStr.indexOf(','));
	CartPrice = CartStr.substring(CartStr.indexOf(',')+1);
	sal_kniotStr="&nbsp;&nbsp;"+addCommas(Number(CartItems).toFixed(2));
	document.getElementById('sal_kniot').innerHTML =sal_kniotStr ;
	if (document.getElementById('TblAgala').style.display=="none")
		{document.getElementById('TblAgala').style.display="";
		document.getElementById('TblAgala2').style.display="";
		document.getElementById('TdAgala').style.visibility="hidden";}
}
function addToCartOrganic(id,row,SwShakil,MidaTchula,Path,LkC,BGColor)
{
flag=0;
	if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==1)
		document.getElementById("misparPrt"+id).value=MidaTchula;
	else if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==0)	
		document.getElementById("misparPrt"+id).value=1;
	if((parseFloat(document.getElementById("misparPrt"+id).value))>0)
		{
			if (Path == undefined) Path="";
			ajaxGeneral(Path+"ajaxAddToCart.asp?Prt="+id+"&Qty="+ document.getElementById('misparPrt'+id).value,0);
			document.getElementById(row).innerHTML="&nbsp;&nbsp;<img SRC='images/ico_salGreen.png' width=40 height=40 border=0  onclick='document.location.href=&quot;Agala.asp?FromPage=<%=SCRIPT_NAME%>&quot;' style='cursor:pointer;'  title='סיכום חשבון'><span id='SwCart"+id+"' style='display:none;'>1</span>";
			if (document.getElementById("tdQty"+id).style.display=="") flag=1;
			document.getElementById("tdQty"+id).style.display="";
			document.getElementById("tableGreen"+id).style.backgroundColor=BGColor;
			//document.getElementById("misparPrt"+id).readOnly="true";
			//document.getElementById("inc"+id).style.display ="none";
			//document.getElementById("dec"+id).style.display ="none";
			document.getElementById(row).style.background="";
			ChangeKamotOrganic(id);
		}			
AddPrtToAgala(id,flag,SwShakil)
}
function addToCartFunky(id,row,SwShakil,MidaTchula,Path,LkC,BGColor,ItemMida)
{flag=0;
	if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==1)
		document.getElementById("misparPrt"+id).value=MidaTchula;
	else if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==0)	
		document.getElementById("misparPrt"+id).value=1;
	if((parseFloat(document.getElementById("misparPrt"+id).value))>0)
		{
			if (Path == undefined) Path="";
			ajaxGeneral(Path+"ajaxAddToCart.asp?Prt="+id+"&Qty="+ document.getElementById('misparPrt'+id).value,0);
			document.getElementById(row+1).style.display="";
			document.getElementById(row).style.display="none";
			if (document.getElementById("tdQty"+id).style.display=="") flag=1;
			document.getElementById("tdQty"+id).style.display="";
			document.getElementById("tableGreen"+id).style.backgroundColor=BGColor;
			//document.getElementById("misparPrt"+id).readOnly="true";
			//document.getElementById("inc"+id).style.display ="none";
			//document.getElementById("dec"+id).style.display ="none";
			document.getElementById(row).style.background="";
			ChangeKamotFunky(id);
		}			
AddPrtToAgala(id,flag,SwShakil,ItemMida)
}
function AddPrtToAgala(id,flag,SwShakil,Mida)
{	if (Mida=="" || Mida == undefined)
		{Mida=" יח'";
		if (SwShakil==1) Mida=" ק''ג";}
	i=1;
	while(i<6)
	{
		if(document.getElementById("TdPrtSal3"+i).innerHTML==id)
		{
			document.getElementById("TdPrtSal2"+i).innerHTML=document.getElementById("misparPrt"+id).value+"&nbsp;"+Mida;
		}
		i=i+1;
	}
	if (flag==0)
	{
		i=4;
		while(i>0)
		{
			document.getElementById("TdPrtSal1"+parseInt(i+1)).innerHTML=document.getElementById("TdPrtSal1"+i).innerHTML;
			document.getElementById("TdPrtSal2"+parseInt(i+1)).innerHTML=document.getElementById("TdPrtSal2"+i).innerHTML;
			document.getElementById("TdPrtSal3"+parseInt(i+1)).innerHTML=document.getElementById("TdPrtSal3"+i).innerHTML;
			i=i-1;
		}
			document.getElementById("TdPrtSal11").innerHTML="&nbsp;&nbsp;"+document.getElementById("NamePrt"+id).innerHTML.substring(0,18);
			document.getElementById("TdPrtSal21").innerHTML=document.getElementById("misparPrt"+id).value+"&nbsp;"+Mida;
			document.getElementById("TdPrtSal31").innerHTML=id;
	}	
}


function indecPrtOrg(a,id,row,SwShakil,MidaTchula,Path,LkC,BGColor)
{  
	if(SwShakil==1)
	{if (MidaTchula==1) MidaTchula=0.5;
		if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
			if (a=="increase")
			{
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+parseFloat(MidaTchula);
			}
			else
			{//decrease
				if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0)
				{
					return;
				}
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-parseFloat(MidaTchula);
			}
	}
	else
	{
		if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
			if (a=="increase")
			{
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+1;
			}
			else
			{//decrease
				if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0)
				{
					return;
				}
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-1;
			}
	}	
addToCartOrganic(id,row,SwShakil,MidaTchula,Path,LkC,BGColor);
}
function indecPrtFunky(a,id,row,SwShakil,MidaTchula,Path,LkC,BGColor,ItemMida)
{  
	if(SwShakil==1)
	{if (MidaTchula==1) MidaTchula=0.5;
		if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
			if (a=="increase")
			{
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+parseFloat(MidaTchula);
			}
			else
			{//decrease
				if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0)
				{
					return;
				}
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-parseFloat(MidaTchula);
			}
	}
	else
	{
		if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
			if (a=="increase")
			{
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+1;
			}
			else
			{//decrease
				if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0)
				{
					return;
				}
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-1;
			}
	}	
addToCartFunky(id,row,SwShakil,MidaTchula,Path,LkC,BGColor,ItemMida);
}
function indecPrtMister(a,id,row,SwShakil,MidaTchula,Path,LkC,BGColor)
{  
	if(SwShakil==1)
	{if (MidaTchula==1) MidaTchula=0.5;
		if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
			if (a=="increase")
			{
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+parseFloat(MidaTchula);
			}
			else
			{//decrease
				if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0)
				{
					return;
				}
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-parseFloat(MidaTchula);
			}
	}
	else
	{
		if(document.getElementById("misparPrt"+id).value=="")document.getElementById("misparPrt"+id).value=0;
			if (a=="increase")
			{
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)+1;
			}
			else
			{//decrease
				if((parseFloat(document.getElementById("misparPrt"+id).value)-1)<=0)
				{
					return;
				}
				document.getElementById("misparPrt"+id).value=parseFloat(document.getElementById("misparPrt"+id).value)-1;
			}
	}	
addToCartMister(id,row,SwShakil,MidaTchula,Path,LkC,BGColor);
}
function ChangeKamotMister(id)
{
	itemQty = document.getElementById('misparPrt'+id).value;
			
	var val=parseFloat(itemQty);
	if (isNaN(val))
	{
		alert ("!ניתן להקיש מספר בלבד");
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	else if (val==0)
	{
		document.getElementById('misparPrt'+id).value="1";
		itemQty = 1;
	}
	var CartStr = ajaxGeneral('../ajaxUpdateCart.asp?CartC='+ id + '&Qty='+ itemQty,0);
	CartItems = CartStr.substring(0,CartStr.indexOf(','));
	CartPrice = CartStr.substring(CartStr.indexOf(',')+1);
	sal_kniotStr="<table border=0 title='סיכום חשבון' width=190 style='cursor:pointer;' align=left onclick='document.location.href=&quot;Agala.asp?FromPage=<%=SCRIPT_NAME%>&quot;' ><tr><td><b>&nbsp;&nbsp;"+addCommas(Number(CartPrice).toFixed(2))+"&nbsp;ש''ח</b></td><td width=32><img  src='images/ico_agala.png'  width='32' height=21></td></tr></table>";
	document.getElementById('sal_kniot').innerHTML =sal_kniotStr ;
}
function addToCartMister(id,row,SwShakil,MidaTchula,Path,LkC,BGColor,Prt_Makbil,Mashlim_Nm)
{flag=0;
	if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==1)
		document.getElementById("misparPrt"+id).value=MidaTchula;
	else if((parseFloat(document.getElementById("misparPrt"+id).value))==0 && SwShakil==0)	
		document.getElementById("misparPrt"+id).value=1;
	if((parseFloat(document.getElementById("misparPrt"+id).value))>0)
		{
			if (Path == undefined) Path="";
			ajaxGeneral(Path+"ajaxAddToCart.asp?Prt="+id+"&Qty="+ document.getElementById('misparPrt'+id).value,0);
			var Dirbun = ajaxGeneral("../ajaxDirbun.asp?Prt="+id+"&Qty="+ document.getElementById('misparPrt'+id).value,0);
			if (Dirbun!="") alert(Dirbun);
			document.getElementById(row).innerHTML="&nbsp;&nbsp;<img SRC='images/ico_salGreen.png' width=32 height=32 border=0  onclick='document.location.href=&quot;Agala.asp?FromPage=<%=SCRIPT_NAME%>&quot;' style='cursor:pointer;'  title='סיכום חשבון'><span id='SwCart"+id+"' style='display:none;'>1</span>";
			if (document.getElementById("tdQty"+id).style.display=="") flag=1;
			document.getElementById("tdQty"+id).style.display="";
			document.getElementById("tableGreen"+id).style.backgroundColor=BGColor;
			document.getElementById("TrSal"+id).style.visibility="";
		
			if(Prt_Makbil!='')
			{
				if (window.confirm( " ? האם להוסיף "+Mashlim_Nm+" לסל"))
				{
					ajaxGeneral(Path+"ajaxAddToCart.asp?Prt="+Prt_Makbil+"&Qty="+ 1,0);
					if (document.getElementById("Sal"+Prt_Makbil)!=null)
					{
						document.getElementById("Sal"+Prt_Makbil).innerHTML="&nbsp;&nbsp;<img SRC='images/ico_salGreen.png' width=32 height=32 border=0  onclick='document.location.href=&quot;Agala.asp?FromPage=<%=SCRIPT_NAME%>&quot;' style='cursor:pointer;'  title='סיכום חשבון'><span id='SwCart"+Prt_Makbil+"' style='display:none;'>1</span>";
						document.getElementById("tdQty"+Prt_Makbil).style.display="";
						document.getElementById("tableGreen"+Prt_Makbil).style.backgroundColor=BGColor;
						document.getElementById("TrSal"+Prt_Makbil).style.visibility="";
						document.getElementById("misparPrt"+Prt_Makbil).value=1;
					}
					
				}
			}
			
			//document.getElementById("misparPrt"+id).readOnly="true";
			//document.getElementById("inc"+id).style.display ="none";
			//document.getElementById("dec"+id).style.display ="none";
			//document.getElementById(row).style.background="";
			
			ChangeKamotMister(id);
		}			

}
//parent.LastKodDep2="<%=LastKodDep2%>";
//parent.firstKodDep2="<%=firstKodDep2%>";
//parent.PageLeft2("<%=countRs%>","<%=countCurrent%>","<%=num%>");

//parent.IEArrows("TopMenuDep","top");
/* -------- topMenuDep  End ---------------------------------------------------------- */








/* -------- SuEnter ------------------------------------------------------------------ */


var indexNameG="";
var indexFirstG=-1;
var indexCounterG=-1;
var indexNameD="";
var indexNameDTeor="";
var indexpathfG="";
var indexNameGTeor="";
var indexpathfD="";
var indexCe;
var indexFirstD=-1;
var indexCounterD=-1;
var oldin=0;
var LastToClose="";//מזהה הטבלה האחרונה עליה נעמדנו
var LastToCloseHed=1;
var lastsun=1;
var lastsunf=2;
var onload=true;
var onsun=true;
var onin=true;
var prtSumMhr=0;
var TotalPrtSum=0;//שורות
var PrtRow="";//xml
var MainUserDetail="";//xml
var CloseBillStage2="" //xml - saves user's input in closebill2 form 
var iRow=0;
var iBill=0;
var HowMany="";
var SwViewer="pic";
var WhereTo="";
var IndId=0;
//////////////שומר את SEND TO PRT
var divadd="";
var N=0;
//////////////

function ComboHipus(ev,Path)
{	
	key=ev;
	//if(document.getElementById("frmHipus"))
	//{if (key==38  || key==40 || key==13){document.all("frmHipus").onkyUpDown(key);}}
	
	
	if ((key==40 || key==38) &&  document.getElementById("frmHipus").style.display=="") 
    {	
       document.getElementById('frmHipus').contentWindow.onkyUpDown(key);
    }
    else
    {
	document.getElementById("frmHipus").style.display="";
	var SerchInput=document.getElementById("SerchInput").value;
	PathOrganic="";
	if (Path!="") PathOrganic="Organic/";
	if(Path=="misterzol") {PathOrganic="misterzol/";Path='../'}
	if(Path=="FunkyFish") {PathOrganic="FunkyFish/";Path='../'}
//		window.setTimeout(' document.getElementById("frmHipus").src=Path + " Web_Hipus.asp?SerchInput="+SerchInput+"&PathOrganic="+PathOrganic+"&ComboFinish=SerchInput"',10);
document.getElementById("frmHipus").src=Path+"Web_Hipus.asp?SerchInput="+SerchInput+"&PathOrganic="+PathOrganic+"&ComboFinish=SerchInput";

//a="document.getElementById('frmHipus').src=" + Path + " Web_Hipus.asp?SerchInput=" + SerchInput + "&PathOrganic=" + PathOrganic + "&ComboFinish=SerchInput"
//	window.setTimeout(a,10);
    }   
	
}
function ComboCity(ev,Path)
{	
	key=ev;
	//if(document.getElementById("frmCity"))
	//{if (key==38  || key==40 || key==13){document.getElementById("frmCity").onkyUpDown(key);}}
	
	
	if ((key==40 || key==38) &&  document.getElementById('frmCity').style.display=="") 
    {
		  document.getElementById('frmCity').contentWindow.onkyUpDown(key);
    }
    else
    {
	document.getElementById("frmCity").style.display="";
	var SerchCity=document.getElementById("SerchCity").value;
	PathOrganic="";
	if (Path!="") PathOrganic="Organic/";
	if(Path=="misterzol") {PathOrganic="misterzol/";Path='../'}
	document.getElementById("frmCity").src=Path+"Web_City.asp?SerchCity="+SerchCity+"&PathOrganic="+PathOrganic+"&ComboFinish=SerchCity";
    }   
	
}
function onClick(val,Path)
{
document.getElementById("SerchInput").value=val;
document.getElementById("frmHipus").style.display="none";
serch(Path);
}

function onClickCity(val,Path)
{
document.getElementById("SerchCity").value=val;
document.getElementById("frmCity").style.display="none";
//serch(Path);
}

function serch (Path,e,SerchWord,DepToSerchIn,choice,IzranNm,Min,Max,BarKod)
{ 
if(document.getElementById("searchM")!=null)
{	if (document.getElementById("searchM").style.fontWeight=='bold')
		{
		 if ( Path.indexOf("bio-center")!=-1 )
			var Url=Path+"SearchResultsM.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&IzarnToSerchIn="+document.getElementById("IzarnToSerchIn").value+"&StorePrt="+e ;
		else
			var Url=Path+"SearchResultsM.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&StorePrt="+e ;
		
		}
	else
		{
		 if ( Path.indexOf("bio-center")!=-1 )
			var Url=Path+"SearchResults.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&IzarnToSerchIn="+document.getElementById("IzarnToSerchIn").value+"&StorePrt="+e ;
		else
			var Url=Path+"SearchResults.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&StorePrt="+e ;
		}
}
else
{	
	 if ( Path.indexOf("bio-center")!=-1 )
		var Url=Path+"SearchResults.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&IzarnToSerchIn="+document.getElementById("IzarnToSerchIn").value+"&StorePrt="+e ;
	else
		var Url=Path+"SearchResults.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&StorePrt="+e ;
}
window.location.href=Url;
}




function serchCity (Path,e,SerchWord,DepToSerchIn,choice,IzranNm,Min,Max,BarKod)
{ //alert(document.getElementById("DepToSerchIn").value);

		//alert(Path);
		var Url=Path+"SearchResults.asp?From=simple&SerchWord="+document.getElementById("SerchInput").value+"&DepToSerchIn="+document.getElementById("DepToSerchIn").value+"&StorePrt="+e ;
		window.location.href=Url;

	
}

function RaaionotMivtzaim (DegemC,menu,TreeNm,GDGimor)
{
	if (GDGimor == undefined || GDGimor==null){GDGimor="";}
	menuclose(menu);
	IndexDep.innerText=" >> " + TreeNm; 
	IndexGrp.innerText="";
	IndexGrpTt.innerText="";
	document.getElementById("frm1").src="main.asp?SwSerch=true&SwMivtzaim="+DegemC+"&GDGimor="+GDGimor; 
}

function  siginOut()
{	
	UserLoginNm.style.display="none";
	UserNameView.style.display="none";
	UserNameOut.style.display="none";
	//frm1.goToLink('Club\\Registration','','כניסת מנויים');
	goToPLink('Club\\Registration','','כניסת מנויים');
}
function tipToolOn (id,picNm,tipT)
{
	document.getElementById(tipT).style.display="";
	MousOn(id,picNm);
}
function tipToolOut (id,picNm,tipT)
{
	document.getElementById(tipT).style.display="none";
	MousOut(id,picNm);
}
function MousOn(id,picNm)
{
	document.getElementById(id).src="images/"+picNm+".jpg";
}
function MousOut(id,picNm)
{
	document.getElementById(id).src="images/"+picNm+".jpg";
}
function Billclose()
{	
	if (PrtRow!="" || closebill.innerText=="המשך קניה...")
	{	
		TotalPrtNotNullSpacer.style.display="none";
		TotalPrtNotNull.style.display="";
		TotalPrtIsNull.style.display="none";
		swCloseBill=true;
		if (swCloseBill==true & closebill.innerText=="סגור חשבון")
		{
			swCloseBill=false;
			closebill.innerText="המשך קניה...";
			SavelastPage ();
			BillcloseAction();
			
		}
			if (swCloseBill==true & closebill.innerText=="המשך קניה...")
		{
			closebill.innerText = "סגור חשבון";
			IndexDep.innerText="" ;
			WhereTo="";
			gotoLastePage ();
		}
	}
	else
	{
		TotalPrtNotNullSpacer.style.display="";
		TotalPrtNotNull.style.display="none";
		TotalPrtIsNull.style.display="";
	
	}
}

function PrtRowCange(a,con,newTotal,HowM)
{//alert(a)
	PrtRow=a;
	if (HowM != undefined)	TotalPrtSum=HowM;
	if (con  != undefined)
	{
		iRow=con;
		IndId=con;
		if (iRow==""){iRow=0;}
		if (IndId==""){IndId=0;}
	}
	if (newTotal!= undefined)prtSumMhr=newTotal;
}
var SESwPrt;
var SESwGrp;
var	SESwDep;
var	SESwGrpTt;
		
var	SETwDep;
var	SETwGrp;
var	SETwGrpTt;	

var	SEDepCounter;
var	SEfirstKodGrp;
var	SEGrpCounter;
var	SEFirstKodGrpTt;	
var	SEGrpTtCounter;
var	SEFirstKodPrt;
var SEDepNmae;
var SEAGrpTt;
var SEAprt;

function SavelastPage ()
{
	SESwPrt=frm1.SwPrt;
	SESwGrp=frm1.SwGrp;
	SESwDep=frm1.SwDep;
	SESwGrpTt=frm1.SwGrpTt;
		
	SETwDep=frm1.TwDep;
	SETwGrp=frm1.TwGrp;
	SETwGrpTt=frm1.TwGrpTt;
	
	SEDepCounter=frm1.DepCounter;
	
	SEfirstKodGrp=frm1.DK;
	SEGrpCounter=frm1.GrpCounter;
	SEFirstKodGrpTt=frm1.DKGrptt;	
	SEGrpTtCounter=frm1.GrpTtCounter;
	SEFirstKodPrt=frm1.DKprt;
	
	SEDepNmae=frm1.DepNmae;
	SEAGrpTt=frm1.AGrpTt;
	SEAprt=frm1.Aprt;
	
}
function gotoLastePage()
{
	document.getElementById("frm1").src="main.asp?con=3"
	
	if ( closebill.innerText=="המשך קניה...")
	{	
		swCloseBill=false;
		closebill.innerText="סגור חשבון";
	}
}
function gotoLastePageAction ()
{
	frm1.SwPrt=SESwPrt;
	frm1.SwGrp=SESwGrp;
	frm1.SwDep=SESwDep;
	frm1.SwGrpTt=SESwGrpTt;
		
	frm1.TwDep=SETwDep;
	frm1.TwGrp=SETwGrp;
	frm1.TwGrpTt=SETwGrpTt;	
		
	frm1.DepCounter=SEDepCounter;
	frm1.firstKodGrp=SEfirstKodGrp;
	frm1.GrpCounter=SEGrpCounter;
	frm1.FirstKodGrpTt=SEFirstKodGrpTt;	
	frm1.GrpTtCounter=SEGrpTtCounter;
	frm1.FirstKodPrt=SEFirstKodPrt;

	
	if (SESwPrt==1)
	{
	frm1.CGrptt=SEGrpCounter;
	frm1.DKGrptt=SEFirstKodGrpTt;
	frm1.GetPrt(SEGrpTtCounter,SEFirstKodPrt,SEAprt);
	}
	else {document.getElementById("frm1").src="main.asp";}
} 
function BillcloseAction()
{
	WhereTo="עגלת הקניות";
	IndexDep.innerText=" >> עגלת הקניות" ;
	IndexGrp.innerText="";
	IndexGrpTt.innerText="";
	
	frm1.XmlForm.PrtRowT.innerText=escape(PrtRow);
	window.setTimeout ("frm1.XmlForm.submit()",100);
	
}
function ADDPrtNum (a,b)
{	
	prtSumMhr=prtSumMhr + parseFloat(b);
	totalPrice.innerText=VBFormatNumber(prtSumMhr,2)+" "+"ש\"ח" ;

	TotalPrtSum+=parseInt(HowMany);
	itemsNumber.innerText=TotalPrtSum;
}
function  returnToCheck (WhereTo)
{	
	
	if (WhereTo == "" )
	{returnToGrp();}
	if (WhereTo=="כניסת מנויים")
	{goToPLink('Club\\Registration','','כניסת מנויים');}
}
function goToPLink(page,menu,loc)
{ 
	if (loc=="כניסת מנויים"){Swfrom="1"}
	else {Swfrom="";}
	document.getElementById("IndexDep").innerText=" >>  "+loc
	WhereTo=loc;
	goToLink = page+".asp?Swfrom="+Swfrom;
	d=page+".asp?Swfrom="+Swfrom;
	
	if (page=="school\\SuSchoolEnter")
	{		
		parent.location=d;
	}
	else
	{
		window.location.href=d;
	}
	if(menu != null & menu!="") menuclose(menu);
	 document.getElementById("IndexDep").innerText=" >>  "+loc ;
	 document.getElementById("IndexGrp").innerText="";
	 document.getElementById("IndexGrpTt").innerText="";
}
function returnToDep(e)
{
	if(e==1)
	{closebill.innerText ="סגור חשבון" ;}
	document.getElementById("frm1").src="main.asp?returnToDep=1";
	
}
function returnToDepCont()
{
	
	frm1.getDep();
	frm1.tableUser.style.display="";
	frm1.TopMenue.style.display="none";
	frm1.B.style.display="none";
	frm1.A.style.display="";
	IndexDep.innerText="";
	IndexGrp.innerText="";
	IndexGrpTt.innerText="";
	frm1.swfarowrd=true;
}
function returnToGrp()
{
	document.getElementById("frm1").src="main.asp?returnToDep=2";
		frm1.DepCounter=SEDepCounter;
	frm1.firstKodGrp=SEfirstKodGrp;
	frm1.GrpCounter=SEGrpCounter;
	frm1.FirstKodGrpTt=SEFirstKodGrpTt;	
	frm1.GrpTtCounter=SEGrpTtCounter;
	frm1.FirstKodPrt=SEFirstKodPrt;
	
}
function returnToGrpCont ()
{
	
	if(indexNameD != "" & indexFirstD != -1 & indexCounterD != -1)
	{
	frm1.document.getElementById("ToolBar").style.display="";
	frm1.FirstNevegationBAr.style.display="none";
	frm1.NevegationBAr.style.display="";
	frm1.SwView=SwViewer;
	frm1.GetGrp(indexCounterD,indexFirstD,indexNameD,indexpathfD,'','',indexNameDTeor);
	frm1.Pictuers.style.display="";
	frm1.Baners.style.display="none";
	IndexGrp.innerText="";
	IndexGrpTt.innerText="";
	frm1.B.style.display="none";
	frm1.A.style.display="";
	frm1.getbeck();
	frm1.swfarowrd=true;
	}
}
function returnToGrpTt()
{
	SavelastPage();
	document.getElementById("frm1").src="main.asp?returnToDep=3";
	frm1.DepCounter=SEDepCounter;
	frm1.firstKodGrp=SEfirstKodGrp;
	frm1.GrpCounter=SEGrpCounter;
	frm1.FirstKodGrpTt=SEFirstKodGrpTt;	
	frm1.GrpTtCounter=SEGrpTtCounter;
	frm1.FirstKodPrt=SEFirstKodPrt;
}
function returnToGrpTtCont()
{
	
		if(indexNameG != "" & indexFirstG != -1 & indexCounterG != -1)
	{
	
	frm1.document.getElementById("ToolBar").style.display="";
	frm1.FirstNevegationBAr.style.display="none";
	frm1.NevegationBAr.style.display="";
	frm1.Pictuers.style.display="";
	frm1.Baners.style.display="none";
	frm1.SwView=SwViewer;
	frm1.GetGrpTt(indexCounterG,indexFirstG,indexNameG,indexCe,indexpathfG,'','','',indexNameGTeor);
	IndexGrpTt.innerText="";
	frm1.B.style.display="none";
	frm1.A.style.display="";
	frm1.getbeck();
	frm1.swfarowrd=true;
	}
}
function indexD(c,Dk,a,pathf,Teor)
{
	IndexDep.innerText="  >>  "+a;
 	indexCounterD=c;
	indexFirstD=Dk;
	indexNameD=a;
	indexpathfD=pathf;
	indexNameDTeor=Teor;
	
	
} 
function indexG(c,Dk,a,ce,pathf,Teor)
{
	
	IndexGrp.innerText="  >>  " +a;
	indexCounterG=c;
	indexFirstG=Dk;
	indexNameG=a;
	indexCe=ce;
	indexpathfG=pathf;
	indexNameGTeor=Teor;
	
}
function indexGTt(c,a)
{
	IndexGrpTt.innerText="  >>  " +a;
}
function indexstyle(e)
{
	document.getElementById("Index"+e).style.color="red";
}
function outdexstyle(e)
{
	document.getElementById("Index"+e).style.color="";
}
var t="";
function rmov(e,g,tim)
{
	if ( tim == "tim")
	{
	t = setTimeout("rmovaction("+e+","+g+")",100)
	} 
	else
	{
		
		 rmovaction(e,g);
	}
}
function rmovaction(e,g)
{
	if (g != undefined){document.getElementById("hed" +g).style.backgroundColor="";}
	document.getElementById("menu"+e).style.display="none";
}
function MouseOnStyle(e)
{	
	document.getElementById("in" +e).style.backgroundColor="white";
	document.getElementById("in" +e).style.color="black";
	sunclose(lastsunf,lastsun);
}
function MouseOutStyle(e)
{
	document.getElementById("in" +e).style.backgroundColor="";
	document.getElementById("in" +e).style.color="black";
}
function MouseOnSunStyle(e)
{
	document.getElementById("sun" +e).style.backgroundColor="white"
	document.getElementById("sun" +e).style.color="black";
}
function MouseOutSunStyle(e)
{	
	document.getElementById("sun" +e).style.backgroundColor=""
	document.getElementById("sun" +e).style.color="black";
}
function hedOver(e)
{
	//document.getElementById("hed" +e).style.backgroundColor="orange";
	
	document.getElementById("hed" +e).style.color="red";
	document.getElementById("hed" +e).style.fontWeight="bold";
}
function hedOut (e)
{
	//document.getElementById("hed" +e).style.backgroundColor="";
	document.getElementById("hed" +e).style.color="";
	document.getElementById("hed" +e).style.fontWeight="";	
}

function menuopen(e,g)//מזהה הטבלה =E\מזהה הכותרת=G
{
var g1=g;
var e1=e;

	if (t!= "undefined" & t!="" ){clearTimeout (t);}
	//if (onload==true)
	{
		if (e != undefined) LastToClose=("menu"+ e);
		if(g != undefined)
		{
		hedOver(g);
		LastToCloseHed=g;
		}
		if (e != undefined) 
		{
//			if(g>=6)
//			{
//				document.getElementById("menu"+ e1).style.left=document.getElementById("hed" +g1).offsetLeft;
//				document.getElementById("menu"+ e1).style.display="";
//			}
		}
		
		onload=false;
		
	}
	/*else
	{			
		hedOut(LastToCloseHed);
		if (LastToClose == "" ) LastToClose = "1"
		document.getElementById(LastToClose).style.display="none";
		if (e != undefined) LastToClose=("menu"+ e);
		if (e != undefined)document.getElementById("menu"+ e).style.display="";
		if ( g != undefined )
		{
		hedOver(g);
		LastToCloseHed=g;
//			if(g>=6)
//			{
//				document.getElementById("menu"+ e1).style.left=document.getElementById("hed" +g1).offsetLeft;		
//				document.getElementById("menu"+ e1).style.display="";
//			}
		}
	}*/
}
function menuclose(e)
{
	if (e != undefined) document.getElementById("menu"+ e).style.display="none";
}

function sunopen(e,n,g)//E,N=מזהה בן מאיזה מספר עד איזה מספר לפתוח/G=מזהה תפריט האב
{	
	MouseOnStyle(g);
	c=e;
	i=0;
	if (onsun==true)
	{
		lastsunf=(e);
		lastsun=(n);
		for (i=c;i<=n;i++)
		{
		document.getElementById("sun"+ e).style.display="";
		e=e+1;
		}
		onsun=false;
	}
	else
	{
		d=lastsunf;f=lastsun;
		for (i=d;i<=f;i++)
		{
		document.getElementById("sun"+ lastsunf).style.display="none";
		lastsunf=1+lastsunf;
		
		}
		lastsunf=e;
		lastsun=n;
		for (i=e;i<=n;i++)
		{
		document.getElementById("sun"+ e).style.display="";
		e=e+1;
		}
	}
}
function sunclose (e,n)
{
	for (i=e;i<=n;i++)
		{
		document.getElementById("sun"+ e).style.display="none";
		e=e+1;
		}
}

/* -------- SuEnter End --------------------------------------------------------------- */





/* -------- GetGrp_Tt --------------------------------------------------------------- */


function underline (e)
{	
	document.getElementById(e).style.background = "#f2f2f2";
}
function rline (e)
{
	document.getElementById(e).style.background = "";
}


function runMe()
{
	//alert('<%=defId%>')
	//alert('<%=defDep%>')
	//alert('<%=defGrpTeur%>');	
	BigPicture('<%=defDep%>','<%=defPath%>','<%=defId%>','<%=defGrpTeur%>');
}



//parent.LastKodGrpTt="<%=LastKodGrpTt%>";
//parent.firstKodGrpTt="<%=firstKodGrpTt%>";
//parent.PageLeft("<%=countRs%>","<%=countCurrent%>","<%=num%>");

//parent.IEArrows("Get_GrpTt","bottom");

/* -------- GetGrp_Tt End --------------------------------------------------------------- */



/* -------- TopMenuGrp ------------------------------------------------------------------ */

//parent.LastKodGrp2="<%=LastKodGrp2%>";
//parent.firstKodGrp2="<%=firstKodGrp2%>";
//parent.PageLeft2("<%=countRs%>","<%=countCurrent%>","<%=num%>");

//parent.IEArrows("TopMenuGrp","top");

/* -------- TopMenuGrp End --------------------------------------------------------------- */




/* -------- Get_Prt ------------------------------------------------------------------- */


function StartFiltering(checkI)
{
	var FilterByArray = new Array;
	var j=0
	for (var i=0;i< checkI ;i++)
	{	
		if(document.getElementById("filterByCheckBox"+i).checked)
		{ 
			FilterByArray[j]= document.getElementById("filterByCheckBox"+i).value;
			j++;
		}
	}
	//alert(FilterByArray);
	//parent.StartFiltering(FilterByArray);
	
}
function openParams()
{
	filterTable.style.display="none";
	//fiterByParamTitel.innerText=titel;
	filterTableParams.style.display="";
}



function removeAllCover()
{

//alert(document.getElementById('endofcover').value)

//	last="<%=document.getElementById('endofcover').value%>"
	for (i=1;i<=document.getElementById('endofcover').value;i++)
	{
		document.getElementById('idi'+i).style.display="none"
	}
}





function BigPictureParit(n,Pic,id,idPic,th,idMotag,IdPrice,price,MotagPic)
{
	underline(th);
	if (id != "" & id != null & id!=undefined){	document.all(id).innerText = n;}
	if (IdPrice != "" & IdPrice != null & IdPrice!=undefined){document.all(IdPrice).innerText =price+" ₪";}
		if(Pic != undefined & Pic!= null & Pic!= "" )
		{
			document.all(idPic).style.display="";
			document.all(idPic).src=Pic;
		}
		if (Pic == ""  )
		{ 
			document.all(idPic).style.display="none";
		}
		if(MotagPic != undefined & MotagPic!= null & MotagPic!= "" )
		{
			document.all(idMotag).style.display="";
			document.all(idMotag).src=MotagPic;
		} 
		if (MotagPic == ""  )
		{ 
			document.all(idMotag).style.display="none";
		}
		
}
function submitGroup2(gID)
{
	document.frmGroup.action = "GroupTt.asp?C=" + gID ;
	document.frmGroup.submit()
}
	function submitGroup3(Dep,Grp)
{
	document.frmGroup.action = "Group.asp?C=" + Dep +"&Grp="+Grp ;
	document.frmGroup.submit()
}	


//if (parent.from !="prtNext")parent.from = "";

//parent.IEArrows("Get_Prt","bottom");

/* -------- Get_Prt End --------------------------------------------------------------- */

