
var i =1;
var ewew= 0;  
 
 
 function InitShowNew(){

document.getElementById('ShowAllArch').innerHTML= document.getElementById('ShowAll').innerHTML;  
 }
  
function ShowNew(objId){
var IdCur ='m' + objId;
document.getElementById('ShowAll').innerHTML= document.getElementById(IdCur).innerHTML;  
}

function CloseNew(){

document.getElementById('ShowAll').innerHTML= document.getElementById('ShowAllArch').innerHTML;  
}


function writeFlash (flashID, flashMovie, width, height) {

	var t ="";
	t += '<object ';
	t += '	id="' + flashID + '"';
	t += '	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	t += '	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" ';
	t += '	width="' + width + '" ';
	t += '	height="' + height + '">';
	t += '		<param name="movie" value="' + flashMovie + '">';
	t += '		<param name="wmode" value="transparent" quality="high">';
	t += '		<embed wmode="transparent" src="' + flashMovie + '" ';
	t += '			name="' + flashID + '"';
	t += '			quality="high" ';
	t += '			pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	t += '			type="application/x-shockwave-flash" ';
	t += '			width="' + width + '" ';
	t += '			height="' + height + '">';
	t += '		</embed>';
	t += '</object>';
	
	document.write (t);
}





function movepic(img_name,img_src) {
document[img_name].src=img_src;
}





<!-- START ONMOUSE OVER COLOR IN TABLE -->
 

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD"&&source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if
(ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TR"||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
source.style.backgroundColor=originalcolor
}
<!-- END ONMOUSE OVER COLOR IN TABLE -->





var win = null;
function NewWindow(mypage,myname,w,h,scroll){

LeftPosition =  (screen.width/2)-(w/2);
TopPosition =  (screen.height/2)-(h/2);


settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}



<!------------------------------------ DHTML email validation script -------------------------->

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}
<!------------------------------------ DHTML email validation script end -------------------------->




<!------------------------------------ onlyDigits -------------------------->
function onlyDigits(e) {
var _ret = true;
if (window.event.keyCode < 46 || window.event.keyCode > 57) {
window.event.keyCode = 0;
_ret = false;
}
return (_ret); 
}
<!------------------------------------ onlyDigits  end -------------------------->



function IsNumericCheck(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


   
   
   
function SearchProducts(){   

     if (document.form.Product_Title.value!="")     {
     var Product_Title=HebDecode(document.form.Product_Title.value);
     }
     else{
    var  Product_Title="";
     }
     var Brend=document.form.Brend.value;
     var Product_Type=document.form.Product_Type.value;
     
    str="?Product_Title="+Product_Title
    str=str+"&Brend="+Brend
    str=str+"&Product_Type="+Product_Type
     str=str+"&search=yes"
     var location_str="Dynamic_contestFrame_inc.asp"+str;
   
      load(location_str,'dynamic_contest');

   }
   
   //11111111111111111111111 server 11111111111111111111111111
   
   
   function  CheckServiceForm(Alert1,Alert2,Alert3,Alert4,Alert5,Alert6,Alert7){

 if (document.form.ClientName.value==""){
		window.alert(Alert1)
		document.form.ClientName.focus();
		return false;
	}

	 if (document.form.CustomerPhone1.value==""){
		window.alert(Alert4)
		document.form.CustomerPhone1.focus();
		return false;
	}
 if (document.form.CustomerContactPerson.value==""){
		window.alert(Alert5)
		document.form.CustomerContactPerson.focus();
		return false;
	}
 if (document.form.CustomerContactPersonMobile.value==""){
		window.alert(Alert6)
		document.form.CustomerContactPersonMobile.focus();
		return false;
	}


 if (document.form.TabuaNo.value==""){
		window.alert(Alert7)
		document.form.TabuaNo.focus();
		return false;
	}
 

 if (document.form.CustomerEmail.value==""){
		window.alert(Alert2)
		document.form.CustomerEmail.focus();
		return false;
	}
	
if ( document.form.CustomerEmail.value!="" && echeck(document.form.CustomerEmail.value)==false){
		window.alert(Alert3);
		document.form.CustomerEmail.focus();
		return false
		}
	
    
      var FullName=HebDecode(document.form.ClientName.value)
      var CompanyNo=HebDecode(document.form.CompanyNo.value)
      var Telephone=HebDecode(document.form.CustomerPhone1.value)
      var address=HebDecode(document.form.CustomerAddress.value)
      var city=HebDecode(document.form.CustomerCity.value)
      var Customerzip=HebDecode(document.form.Customerzip.value)
      
      
      var ContactName=HebDecode(document.form.CustomerContactPerson.value)
      var ContactPersonMobile=HebDecode(document.form.CustomerContactPersonMobile.value)
      
      var Email=HebDecode(document.form.CustomerEmail.value)
      var ProductModel=HebDecode(document.form.ProductModel.value)
      var OrderNo=HebDecode(document.form.OrderNo.value)
      var Telephone2=HebDecode(document.form.CustomerPhone2.value)
      var ProductMona=HebDecode(document.form.ProductMona.value)
       var TabuaNo=HebDecode(document.form.TabuaNo.value)
       
	   
        var DecsrTypeObj=document.form.DecsrType;
		for (i=0; i<DecsrTypeObj.length; i++){
			if (DecsrTypeObj[i].checked) {
				var DecsrType = DecsrTypeObj[i].value;
			}
		}
		
      var ResponserDescription=HebDecode(document.form.ResponserDescription.value)
      
      
      str="?FullName="+FullName
      str=str+"&CompanyNo="+CompanyNo
      str=str+"&Telephone="+Telephone
      str=str+"&address="+address
      str=str+"&city="+city
        str=str+"&Customerzip="+Customerzip
      str=str+"&ContactName="+ContactName
        str=str+"&ContactPersonMobile="+ContactPersonMobile
      
      str=str+"&Email="+Email
      str=str+"&ProductModel="+ProductModel
      str=str+"&OrderNo="+OrderNo
      str=str+"&Telephone2="+Telephone2
      str=str+"&ProductMona="+ProductMona
      str=str+"&TabuaNo="+TabuaNo
       str=str+"&DecsrType="+DecsrType
      
      str=str+"&ResponserDescription="+ResponserDescription
  
    
 var location_str="DoSendServiceForm_inc.asp"+str;
document.form.str.value=location_str;
 load(location_str,'dynamic_contest');

}

//11111111111111111111111 server end 11111111111111111111111111111111111
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

function CheckContact(Alert1,Alert2,Alert3){

 if (document.form.FullName.value==""){
		window.alert(Alert1)
		document.form.FullName.focus();
		return false;
	}

	


 if (document.form.email.value==""){
		window.alert(Alert2)
		document.form.email.focus();
		return false;
	}
	
if ( document.form.email.value!="" && echeck(document.form.email.value)==false){
		window.alert(Alert3);
		document.form.email.focus();
		return false
		}
	
    
    var FullName=HebDecode(document.form.FullName.value)
    var Telephone=HebDecode(document.form.Telephone.value)
    var Email=HebDecode(document.form.email.value)
    var CompanyName=HebDecode(document.form.CompanyName.value)
    var Role=HebDecode(document.form.Role.value)
    var address=HebDecode(document.form.address.value)
    var Comments=HebDecode(document.form.Comments.value)
   var TheContactTime=HebDecode(document.form.TheContactTime.value)
 

    str="?FullName="+FullName
    str=str+"&Telephone="+Telephone
    str=str+"&Email="+Email
    str=str+"&CompanyName="+CompanyName
    str=str+"&Role="+Role
    str=str+"&address="+address
    str=str+"&Comments="+Comments
    str=str+"&TheContactTime="+TheContactTime
 
  //  document.form.str.value=str;
    
 var location_str="DoSendContact_inc.asp"+str;
  load(location_str,'dynamic_contest');

}


function CleanContact(){
document.form.reset();
}




    
    

function changestyleOver(current,location,id)
	{
   bgstr= 'url(images/MenuCategory/but0'+location+'_sug_down.png)';
  var itm = null;
		if (document.getElementById) {
			itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
   itm.className='TitleTatMenuWhite';
   current.style.background=bgstr;

}

function changestyleOut(current,location,id)
	{
        var itm = null;
		if (document.getElementById) {
			itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
   itm.className='TitleTatMenu';
 current.style.background="url(images/MenuCategory/b_sug_up.png)";
  
}










function OnMouseChangeStyle(current,id,bgstr,className)
	{
    
          var itf = null;
		if (document.getElementById) {
			itf = document.getElementById(current);
		} else if (document.all){
			itf = document.all[current];
		} else if (document.layers){
			itf = document.layers[current];
		}
    
  var itm = null;
		if (document.getElementById) {
			itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
        
   
        
        
  
   itf.background=bgstr;
    itm.className=className;

    
    
    
}





function OnMouseChange(id,imagesrc){

	var itm = null;
	var itf= null;
	
		if (document.getElementById) {
			itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
	itm.src=imagesrc
}



function OnMouseTitle(id,className){

	var itm = null;

		if (document.getElementById) {
			itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
        
       
	
	itm.className=className;
}









// ------------------------------Login-------------------------------------------------

function ClearUserName(UserNamePar){

 if (document.form.UserName.value==UserNamePar){
 
 document.form.UserName.value="";
 }
 
 
 }



function ClearPassword(PasswordPar){
//alert(document.form.Password.type)
 if (document.form.Password.value==PasswordPar){
 
 //document.form.Password.type="Password";
 document.form.Password.value="";
 }
 
 
 }

function Login(UserNamePar,PasswordPar,Alert1,Alert2){

 if (document.form.UserName.value=="" || document.form.UserName.value==UserNamePar  ){
		window.alert(Alert1)
		document.form.UserName.focus();
		return false;
	}
 if (document.form.Password.value=="" || document.form.Password.value==PasswordPar){
		window.alert(Alert2)
		document.form.Password.focus();
		return false;
	}
    
    var location_str="Login2_inc.asp?UserName="+document.form.UserName.value+"&Password="+document.form.Password.value;
    load(location_str,'login_div');
    
    
	}
    

// ------------------------------Login end- ------------------------------------------------


    
    
function LoginOut(){

    
    var location_str="Login2_inc.asp?LogOut=yes";
    load(location_str,'login_div');
    
    
	}
    
    
    
    
    
    
    
    
    
    // ------------------------------Login Exist -------------------------------------------------

function ClearUserNameExist(UserNamePar){

 if (document.form.UserNameExist.value==UserNamePar){
 
 document.form.UserNameExist.value="";
 }
 
 
 }



function ClearPasswordExist(PasswordPar){

 if (document.form.PasswordExist.value==PasswordPar){
 
 document.form.PasswordExist.value="";
 }
 
 
 }

function LoginExist(UserNamePar,PasswordPar,Alert1,Alert2){

 if (document.form.UserNameExist.value=="" || document.form.UserNameExist.value==UserNamePar  ){
		window.alert(Alert1)
		document.form.UserNameExist.focus();
		return false;
	}
 if (document.form.PasswordExist.value=="" || document.form.PasswordExist.value==PasswordPar){
		window.alert(Alert2)
		document.form.PasswordExist.focus();
		return false;
	}
    
    var location_str="Checkout_inc.asp?UserName="+document.form.UserNameExist.value+"&Password="+document.form.PasswordExist.value+"&Product_Id_Str="+document.form.ProductQuantity_Str.value+"&ProductQuantity_Str="+document.form.ProductQuantity_Str.value;
   
 //  alert(location_str)
    load(location_str,'dynamic_contest');
    
    
	}
    

// ------------------------------Login end- ------------------------------------------------

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    <!-------------------- load to div---------------------->

function ahah(url, target) {
//	alert(url)
	//document.getElementById("debug").innerHTML = url;
  document.getElementById(target).innerHTML = '';
 
  if (window.XMLHttpRequest) {
  
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
  
     
    req = new ActiveXObject("Msxml2.XMLHTTP");

  }
  

  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=windows-1255");
    req.send(null);
  }
}  


function ahahDone(url, target) {

  if (req.readyState == 4) { // only if req is "loaded"
  
    if (req.status == 200) { // only if "OK"
          document.getElementById(target).innerHTML = req.responseText;
         
    } else {
      document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
    }
  }
}



function load(name, div) {
//alert(name)
return	ahah(name,div);
}




function loadunload(name, div) {
if (document.getElementById(div).innerHTML == "") { 
	ahah(name,div);
    }
else{
    document.getElementById(div).innerHTML = "";
   }
}


<!--------------------load to div end ------------------->





<!----------------------------- dynamic contest subcategory --------------->




function movedown(){

if (iens6){

var crossobj=document.getElementById? document.getElementById("content") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",20)
}

function moveup(){

if (iens6){

var crossobj=document.getElementById? document.getElementById("content") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",20)

}

function getcontent_height(){


if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}
window.onload=getcontent_height

<!----------------------------- dynamic contest subcategory end --------------->






<!----------------------------- dynamic contest product --------------->




function movedownproduct(){

if (iens6){

var crossobj=document.getElementById? document.getElementById("contentproduct") : document.all.contentproduct
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontentproduct
var contentheight=crossobj.clip.height
}
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedownproduct()",20)
}

function moveupproduct(){

if (iens6){

var crossobj=document.getElementById? document.getElementById("contentproduct") : document.all.contentproduct
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontentproduct
var contentheight=crossobj.clip.height
}
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveupproduct()",20)

}

function getcontent_height(){


if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}
window.onload=getcontent_height

<!----------------------------- dynamic contest product end --------------->


<!------------------------------------ basket -------------------------->

function MinusQuan(productId,price,points,weight)
{

minquan=0
var prefixProductQuantity="ProductQuantity"+productId
var prefixTotalProductprice="TotalProductprice"+productId

var prefixTotalProductPointsNo="TotalProductPointsNo"+productId
var prefixTotalProductWeight="TotalProductWeight"+productId
var currentQuan=0

for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name == prefixProductQuantity)
	    {
      	currentQuan=element.value-1
		if (currentQuan<minquan){
		
		window.alert("Please, insert value>="+minquan)
		return false;
		  }
		  else
		element.value=currentQuan
	     }
  	}

	
	for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name == prefixTotalProductprice) {
      
		TotalProductprice=parseFloat(currentQuan*price)
          element.value = (FormatNumber(TotalProductprice,0,false,false,true)); //Math.round(TotalProductprice*100)/100;
		element.style.width=parseFloat(element.value.length*7)
		
		totalOrderPrice=parseFloat(document.form.totalOrderPrice_hidden.value)-parseFloat(price)
		document.form.totalOrderPrice_hidden.value=Math.round(totalOrderPrice*100)/100;
		totalOrderPrice = (FormatNumber(totalOrderPrice,0,false,false,true));
		 document.form.totalOrderPrice.value=totalOrderPrice; //Math.round(totalOrderPrice*100)/100;
         document.form.totalOrderPrice.style.width=parseFloat( document.form.totalOrderPrice.value.length*8)
		
      /*totalOrderPrice = parseFloat(document.form.totalOrderPrice.value-price)
        document.form.totalOrderPrice.value=Math.round(totalOrderPrice*100)/100;
		 document.form.totalOrderPrice.style.width=parseFloat( document.form.totalOrderPrice.value.length*8)*/
			}
      if (element.name == prefixTotalProductPointsNo) {        
            element.value=parseFloat(currentQuan*points)
            element.style.width=parseFloat(element.value.length*7)
		         document.form.totalOrderPointsNo.value=parseFloat(document.form.totalOrderPointsNo.value-points)
              document.form.totalOrderPointsNo.style.width=parseFloat( document.form.totalOrderPointsNo.value.length*8)
		    }
            
          
            
             if (element.name == prefixTotalProductWeight) { 
               OrderWeight=parseFloat(currentQuan*weight)
                 element.value=Math.round(OrderWeight*100)/100;
                element.style.width=parseFloat(element.value.length*7)
                 totalOrderWeight=  parseFloat(document.form.totalOrderWeight.value-weight)
		         document.form.totalOrderWeight.value=Math.round(totalOrderWeight*100)/100;
                document.form.totalOrderWeight.style.width=parseFloat( document.form.totalOrderWeight.value.length*8)
		 
            }   
  	}

   
	
	

	}

function PlusQuan(productId,price,points,weight)
{

var prefixProductQuantity="ProductQuantity"+productId
var prefixTotalProductprice="TotalProductprice"+productId
var prefixTotalProductPointsNo="TotalProductPointsNo"+productId
var prefixTotalProductWeight="TotalProductWeight"+productId
var currentQuan=0

for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name == prefixProductQuantity)
	    {
        currentQuan= element.value
		currentQuan++
		element.value=currentQuan
	     }
  	}

	
	for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name == prefixTotalProductprice) {
      
		TotalProductprice=parseFloat(currentQuan*price)
		element.value= (FormatNumber(TotalProductprice,0,false,false,true)); //Math.round(TotalProductprice*100)/100;
        element.style.width=parseFloat(element.value.length*7)
        
        totalOrderPrice=parseFloat(document.form.totalOrderPrice_hidden.value)+parseFloat(price)
		document.form.totalOrderPrice_hidden.value=Math.round(totalOrderPrice*100)/100;
		totalOrderPrice = (FormatNumber(totalOrderPrice,0,false,false,true));
		 document.form.totalOrderPrice.value=totalOrderPrice; //Math.round(totalOrderPrice*100)/100;
         document.form.totalOrderPrice.style.width=parseFloat( document.form.totalOrderPrice.value.length*8)
		
		}
         if (element.name == prefixTotalProductPointsNo) {        
            element.value=parseFloat(currentQuan*points)
            element.style.width=parseFloat(element.value.length*7)
		   document.form.totalOrderPointsNo.value=parseFloat(document.form.totalOrderPointsNo.value)+parseFloat(points)
            document.form.totalOrderPointsNo.style.width=parseFloat( document.form.totalOrderPointsNo.value.length*8)
		 
            }
            
           if (element.name == prefixTotalProductWeight) { 
           OrderWeight=parseFloat(currentQuan*weight)
            element.value=Math.round(OrderWeight*100)/100;
            element.style.width=parseFloat(element.value.length*7)
            
             totalOrderWeight=parseFloat(document.form.totalOrderWeight.value)+parseFloat(weight)
		     document.form.totalOrderWeight.value=Math.round(totalOrderWeight*100)/100;
              document.form.totalOrderWeight.style.width=parseFloat( document.form.totalOrderWeight.value.length*8)
		 
            }   
  	}


	   
}	


/** added by kfir - formatNumber Function **/
function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
/**********************************************************************
	IN:
		NUM - the number to format
		decimalNum - the number of decimal places to format the number to
		bolLeadingZero - true / false - display a leading zero for
										numbers between -1 and 1
		bolParens - true / false - use parenthesis around negative numbers
		bolCommas - put commas as number separators.
 
	RETVAL:
		The formatted number!
 **********************************************************************/
{ 
        if (isNaN(parseInt(num))) return "NaN";

	var tmpNum = num;
	var iSign = num < 0 ? -1 : 1;		// Get sign of number
	
	// Adjust number so only the specified number of numbers after
	// the decimal point are shown.
	tmpNum *= Math.pow(10,decimalNum);
	tmpNum = Math.round(Math.abs(tmpNum))
	tmpNum /= Math.pow(10,decimalNum);
	tmpNum *= iSign;					// Readjust for sign
	
	
	// Create a string object to do our formatting on
	var tmpNumStr = new String(tmpNum);

	// See if we need to strip out the leading zero or not.
	if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
		if (num > 0)
			tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
		else
			tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
		
	// See if we need to put in the commas
	if (bolCommas && (num >= 1000 || num <= -1000)) {
		var iStart = tmpNumStr.indexOf(".");
		if (iStart < 0)
			iStart = tmpNumStr.length;

		iStart -= 3;
		while (iStart >= 1) {
			tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
			iStart -= 3;
		}		
	}

	// See if we need to use parenthesis
	if (bolParens && num < 0)
		tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";

	return tmpNumStr;		// Return our formatted string!
}

/** added by kfir - formatNumber Function **/


function ChangeQuan(productId,price,points,weight)
{

minquan=0
var prefixProductQuantity="ProductQuantity"+productId

var prefixTotalProductpriceAll="TotalProductprice"
var prefixTotalProductprice="TotalProductprice"+productId

var prefixtotalProductPointsNoAll="TotalProductPointsNo"
var prefixTotalProductPointsNo="TotalProductPointsNo"+productId

var  prefixTotalProductWeightAll="TotalProductWeight"
var prefixTotalProductWeight="TotalProductWeight"+productId



var currentQuan=0
var totalOrderPrice=0
var totalOrderPointsNo=0
var totalOrderWeight=0
for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name == prefixProductQuantity)
	    {
      	currentQuan=element.value
		}
  	}
for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name == prefixTotalProductprice) {
      
		TotalProductprice=parseFloat(currentQuan*price)
         element.value=Math.round(TotalProductprice*100)/100;
		element.style.width=parseFloat(element.value.length*7)
    	}
        
         if (element.name == prefixTotalProductPointsNo) {
      
		element.value=parseFloat(currentQuan*points)
		element.style.width=parseFloat(element.value.length*7)
    	}
        if (element.name == prefixTotalProductWeight) {
        OrderWeight=parseFloat(currentQuan*weight)
        element.value=Math.round(OrderWeight*100)/100;
		
		element.style.width=parseFloat(element.value.length*7)
    	}
        
  	}


for (i=0; i<document.form.elements.length; i++) {
    element = document.form.elements[i];
    if (element.name.substring(0,17) == prefixTotalProductpriceAll) {
	
     	  totalOrderPrice =parseFloat(totalOrderPrice)+parseFloat(element.value) 
          totalOrderPrice=Math.round(totalOrderPrice*100)/100;
        
	 	}
     if (element.name.substring(0,20) == prefixtotalProductPointsNoAll) {
	 	  totalOrderPointsNo =parseFloat(totalOrderPointsNo)+parseFloat(element.value) 
        
	 	}
         
        if (element.name.substring(0,18) == prefixTotalProductWeightAll) {
        
       
        
	 	  totalOrderWeight =parseFloat(totalOrderWeight)+parseFloat(element.value) 
          totalOrderWeight=Math.round(totalOrderWeight*100)/100;
        
	 	}
           
  	}

   
 
 	        document.form.totalOrderPrice.value=totalOrderPrice
            document.form.totalOrderPrice.style.width=parseFloat( document.form.totalOrderPrice.value.length*8)
		 
            
      
		   
}

function SelectedPoints()
{


prefix_Master_totalOrderPrice_shipping= "Master_totalOrderPrice_shipping"
prefixtotalOrderMainPrice_shipping="totalOrderMainPrice_shipping"
 client_points_count= document.submitorder.client_points_count.value
 totalOrderPriceMaster= document.submitorder.totalOrderPriceMaster.value
 OrderPriceTottallyMaster= document.submitorder.OrderPriceTottallyMaster.value
 totalOrderPrice=parseFloat(totalOrderPriceMaster-client_points_count)

 
  document.submitorder.totalOrderPrice.value=Math.round(totalOrderPrice*100)/100;
 OrderPriceTottally=parseFloat(OrderPriceTottallyMaster-client_points_count)
    document.submitorder.OrderPriceTottally.value=Math.round(OrderPriceTottally*100)/100;
   
 
    DiffOrderPriceTottallyMaster= document.submitorder.DiffOrderPriceTottallyMaster.value
    DiffOrderTottally=parseFloat(DiffOrderPriceTottallyMaster)+parseFloat(client_points_count)
    document.submitorder.DiffOrderPriceTottally.value=Math.round(DiffOrderTottally*100)/100;
   document.submitorder.DiffOrderPriceTottally.style.width=parseFloat( document.submitorder.DiffOrderPriceTottally.value.length*10)
   
  
   for (i=0; i<document.submitorder.elements.length; i++) {
    element = document.submitorder.elements[i];
     
   
     if (element.name.substring(0,31) == prefix_Master_totalOrderPrice_shipping) {
	   
         points_value =element.value
     	  points_count =eval(points_value-client_points_count)
         
     	}
  
    
        
   if (element.name.substring(0,28) == prefixtotalOrderMainPrice_shipping) {
	
     	  element.value =points_count
      }
      }
  
  
}



function SelectedPointsMinPrice()
{



 client_points_count= document.submitorder.client_points_count.value
 totalOrderPriceMaster= document.submitorder.totalOrderPriceMaster.value
 
 totalOrderPrice=parseFloat(totalOrderPriceMaster-client_points_count)

  document.submitorder.totalOrderPrice.value=Math.round(totalOrderPrice*100)/100;
  OrderPriceTottally=parseFloat(totalOrderPriceMaster-client_points_count)
   document.submitorder.OrderPriceTottally.value=Math.round(OrderPriceTottally*100)/100;
   
  DiffOrderPriceTottallyMaster= document.submitorder.DiffOrderPriceTottallyMaster.value
    DiffOrderTottally=parseFloat(DiffOrderPriceTottallyMaster)+parseFloat(client_points_count)
    document.submitorder.DiffOrderPriceTottally.value=Math.round(DiffOrderTottally*100)/100;
     document.submitorder.DiffOrderPriceTottally.style.width=parseFloat( document.submitorder.DiffOrderPriceTottally.value.length*10)
   
  
}


function SetShipping(objform){
  
  var GetMethodID=document.form.GetMethodID.value;

  var   shippingname="shipping_span";
  var    totalOrderPrice="totalOrderPrice";
	 var totalOrderPrice2="totalOrderPrice2";
   
        if (document.getElementById) {
			shippingnameObj = document.getElementById(shippingname);
		} else if (document.all){
			shippingnameObj = document.all[shippingname];
		} else if (document.layers){
			shippingnameObj = document.layers[shippingname];
		}
       
         if (document.getElementByName) {
			totalOrderPriceObj = document.getElementByName(totalOrderPrice);
		} else if (document.all){
			totalOrderPriceObj = document.all[totalOrderPrice];
		} else if (document.layers){
			totalOrderPriceObj = document.layers[totalOrderPrice];
		}
         	 totalOrderPrice=totalOrderPriceObj.value;
         

         if (document.getElementByName) {
			totalOrderPrice2Obj = document.getElementById(totalOrderPrice2);
		} else if (document.all){
			totalOrderPrice2Obj = document.all[totalOrderPrice2];
		} else if (document.layers){
			totalOrderPrice2Obj = document.layers[totalOrderPrice2];
		}
         	
         
          // alert("totalOrderPrice="+totalOrderPrice);
          // alert("GetMethodID="+GetMethodID);
          totalOrderPrice2=parseFloat(totalOrderPrice)+parseFloat(GetMethodID)
         //alert("totalOrderPrice2="+totalOrderPrice2);
shippingnameObj.innerHTML=Math.round(GetMethodID*100)/100;
totalOrderPrice2Obj.innerHTML=(FormatNumber(totalOrderPrice2,0,false,false,true))//Math.round(totalOrderPrice2*100)/100;



}


function DeleteItem(num,id)
{
	
    var  quantityname="ProductQuantity"+id;
      if (document.getElementByName) {
			quantitynameObj = document.getElementByName(quantityname);
		} else if (document.all){
			quantitynameObj = document.all[quantityname];
		} else if (document.layers){
			quantitynameObj = document.layers[quantityname];
		}
		
       //  alert('quantitynameObj='+quantitynameObj)  
        
         var QuantityItems_div="QuantityItems_div"

 if (document.getElementByName) {
			QuantityItemsObj = document.getElementByName(QuantityItems_div);
		} else if (document.all){
			QuantityItemsObj = document.all[QuantityItems_div];
		} else if (document.layers){
			QuantityItemsObj = document.layers[QuantityItems_div];
		}
       

         QuantityItemsObj.innerHTML=parseFloat(QuantityItemsObj.innerHTML-quantitynameObj.value)
  
    
      var location_str="Basket_inc.asp?number="+num+"&delupdate=delete&QuantityItems="+QuantityItemsObj.innerHTML;
    load(location_str,'dynamic_contest');
    
   
}

function DeleteAll()
{
   var location_str="Basket_inc.asp?delupdate=delal";
    load(location_str,'dynamic_contest');
   

}


function SendBasket()
{
document.form.action="https://www.laserprint.co.il/checkout.asp";	
//document.form.action="checkout.asp";
document.form.submit();

}



function KeepBasket(down)
{
ProductQuantity_Str="";
Product_Id_Str=document.form.Product_Id_Str.value;

var QuantityItems=0

Product_Id_arr=Product_Id_Str.split(',');
for (i=0;i<Product_Id_arr.length;i++)
        {
        quantityname="ProductQuantity"+Product_Id_arr[i]
        if (document.getElementByName) {
			quantitynameObj = document.getElementByName(quantityname);
		} else if (document.all){
			quantitynameObj = document.all[quantityname];
		} else if (document.layers){
			quantitynameObj = document.layers[quantityname];
		}
		
        
        if(ProductQuantity_Str==""){
        ProductQuantity_Str=quantitynameObj.value
        }
        else{
         ProductQuantity_Str=ProductQuantity_Str+","+quantitynameObj.value
        }
     
        QuantityItems=parseFloat(QuantityItems)+parseFloat(quantitynameObj.value)
     
	}
     var QuantityItems_div="QuantityItems_div"

 if (document.getElementByName) {
			QuantityItemsObj = document.getElementByName(QuantityItems_div);
		} else if (document.all){
			QuantityItemsObj = document.all[QuantityItems_div];
		} else if (document.layers){
			QuantityItemsObj = document.layers[QuantityItems_div];
		}
       

    //  alert('QuantityItemsObj.innerHTML1='+QuantityItemsObj.innerHTML)  
 QuantityItemsObj.innerHTML=QuantityItems;
     //   alert('QuantityItemsObj.innerHTML2='+QuantityItemsObj.innerHTML)  
       //    alert('down='+down)  
if (down=='yes')
{
 var location_str="Basket_inc.asp?keep=yes&Product_Id_Str="+Product_Id_Str+"&ProductQuantity_Str="+ProductQuantity_Str+"&QuantityItems="+QuantityItems;


  // alert(location_str)
document.form.str_test.value  =location_str;
 load(location_str,'dynamic_contest');
}
}


<!----------------------------- basket end  --------------->






function HebDecode(str) { 
   var str2="";
   var ch;
   
  if(str!="")
  {
   for (j=0;j<str.length;j++)
        {
		ch=str.charCodeAt(j);
		if (str2=='')
		{str2=ch}
		else
		{str2=str2+','+ch}
		
		}
   return str2;
   }
 }
 

 
  <!-------------------- Ajax  ---------------------->

function Ajax(url, target) {
  document.getElementById(target).innerHTML = '';
 
  if (window.XMLHttpRequest) {
  
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
  
     
    req = new ActiveXObject("Msxml2.XMLHTTP");

  }
  

  if (req != undefined) {
    req.onreadystatechange = function() {
    
    
    };
    req.open("GET", url, true);
    req.send(null);
  }
}  




  <!-------------------- Ajax  end ---------------------->

function OpenCloseDivs(target1, target2) {

document.getElementById(target1).style.display='none';
document.getElementById(target2).style.display='block';

}


function OpenDiv(target1) {
document.getElementById(target1).style.display='block';
}

function CloseDiv(target1) {
document.getElementById(target1).style.display='none';
}



  <!--------------------  search drivers ---------------------->
  
  
  function SelectTypeProduct(b,from)
	{
	 var xmlDoc
  var xslDoc
  var Product_Type=b.form.Product_Type.value;
  xmlDoc = new ActiveXObject('Microsoft.XMLDOM')
  xmlDoc.async = false;

  xslDoc = new ActiveXObject('Microsoft.XMLDOM')
  xslDoc.async = false;
  
 xmlDoc.load("admin/Scripts/ProductTypeselect/Product_SubTypeselect.asp?from="+from+"&Product_Type="+Product_Type)
   xslDoc.load("admin/Scripts/ProductTypeselect/Product_SubTypeIndexUser.xsl")

  Product_SubType.innerHTML = xmlDoc.documentElement.transformNode(xslDoc)
  
  	}
    
    
function SelectSubTypeProduct(b,from)
	{
	 var xmlDoc
  var xslDoc
  var Product_Type=b.form.Product_Type.value;
  
  xmlDoc = new ActiveXObject('Microsoft.XMLDOM')
  xmlDoc.async = false;

  xslDoc = new ActiveXObject('Microsoft.XMLDOM')
  xslDoc.async = false;
 
 xmlDoc.load("admin/Scripts/ProductSubTypeselect/Product_selectUtf8.asp?Product_Type="+Product_Type)
   xslDoc.load("admin/Scripts/ProductSubTypeselect/Product_IndexUser.xsl")

  Product_div.innerHTML = xmlDoc.documentElement.transformNode(xslDoc)
  
  	}
  
    
    
    function SearchDrivers(){   

     if (document.form.Driver_Title.value!="")     {
     var Driver_Title=HebDecode(document.form.Driver_Title.value);
     }
     else{
    var  Driver_Title="";
     }
     
     
   
     var Product_Type=document.form.Product_Type.value;
     var ProductID=document.form.ProductID.value;
     
    str="?Driver_Title="+Driver_Title
    str=str+"&Product_Type="+Product_Type
     str=str+"&ProductID="+ProductID
     str=str+"&search=yes"
     var location_str="Content_Drivers_inc.asp"+str;

      load(location_str,'dynamic_contest');
  }
    
    
    
    <!--------------------  search drivers end ---------------------->
