
// JavaScript Document
function showCell(t) 
{
	 var elem = document.getElementById('hidden');
	if (t==0)
	  {
 		document.getElementById('typehome').style.visibility='hidden';
		document.getElementById('searchpro').style.visibility='hidden';
		document.getElementById('code').style.visibility='hidden';
 	    elem.style.position = 'absolute';
  		elem.style.left = '-4000px';
 	  }
    else
 	{	document.getElementById('typehome').style.visibility='visible';
	    document.getElementById('searchpro').style.visibility='visible';
		document.getElementById('code').style.visibility='visible';
    	elem.style.position = 'static';
  	    elem.style.left = '0px';
 	  }
}

function disable(value){

    if (value==1)
     {
      document.form1.price_kol_min.disabled="disabled";
      document.form1.price_kol_max.disabled="disabled";
      document.form1.tarakom.disabled="disabled";
      document.form1.price_rahn_max.disabled="";
      document.form1.price_rahn_min.disabled="";
      document.form1.price_ejare_max.disabled="";
      document.form1.price_ejare_min.disabled="";
  
      document.form1.price_kol_min.style.background="#ECE9D8";
      document.form1.price_kol_max.style.background="#ECE9D8";
      document.form1.price_rahn_max.style.background="";
      document.form1.price_rahn_min.style.background="";
      document.form1.price_ejare_max.style.background="";
      document.form1.price_ejare_min.style.background="";
     }
    if (value==2)
     {
      document.form1.price_kol_min.disabled="";
      document.form1.price_kol_max.disabled="";
      document.form1.tarakom.disabled="";
      document.form1.price_rahn_max.disabled="disabled";
      document.form1.price_rahn_min.disabled="disabled";
      document.form1.price_ejare_max.disabled="disabled";
      document.form1.price_ejare_min.disabled="disabled";
  
      document.form1.price_rahn_max.style.background="#ECE9D8";
      document.form1.price_rahn_min.style.background="#ECE9D8";
      document.form1.price_ejare_max.style.background="#ECE9D8";
      document.form1.price_ejare_min.style.background="#ECE9D8";
      document.form1.price_kol_min.style.background="";
      document.form1.price_kol_max.style.background="";
    }//end if(value=2)
  //end if(value=1)
}//end function

  function insertCommaTotal(id)//insert cama in all fild
	{
	var price;
		price="";
		field=document.getElementById(id);
	   while(field.value.indexOf(',')!=-1)
	   {
	    field.value=field.value.replace(',','');
	    }
	   
		txt_field=document.getElementById("ttd");
		txt_field=field.value.length;
		var counter=0;
		for(var i=txt_field-1;i>=0;i--)
		{
		price=field.value.charAt(i)+price;
		counter++;
		if(counter%3==0&&i>0)
		{
		price=','+price;
		counter=0;
		}
		}
			field.value=price;
	}