﻿
function sStop()
{
   scrollerS.scrollAmount=0
}

function sStart()
{
   scrollerS.scrollAmount=1
}

function CheckImgSrc()
{
	/*var colImages = document.images;

	for (i=0; i < colImages.length; i++)
	{
		if (colImages(i).fileSize==-1)
		{
			colImages(i).style.display="none";
		}

	}*/
}
//Hides a given image
function hideImage(cImg)
{
  cImg.style.display="none";
}
//Returns an xml string of form command structure
   //
   //Accepts:
   // Parameters seperated by a comma. The first is the
   // name of the command and then pairs of parameter name & value.
   //
   //Example:
   // var sCommand = getFormCommand('delProduct', 'prod_id', 331)
   function getFormCommand() {
     var sXML = '<command name="' + arguments[0] + '">'
     var i=1
     while (i<arguments.length){
		sXML += '<param name="' + arguments[i] + '" value="' + arguments[i+1] + '"/>'
		i+=2
     }
     sXML+='</command>'
     return sXML
  }
//for Site's with Hiericial menu
var LastSubDiv;
function SetMenu(subDiv)
{
	var SubObj
	SubObj = window.document.getElementById(subDiv)
	if(SubObj.style.display=="none")
		SubObj.style.display="inline"
	else
		SubObj.style.display="none"

	if(LastSubDiv != subDiv)
	{
		if(LastSubDiv!="" && LastSubDiv!=null)
		{
			SubObj = window.document.getElementById(LastSubDiv)
			SubObj.style.display="none"
		}
		LastSubDiv = subDiv
	}
}
function ChangeHref(vName)
{

       var vData = document.getElementById(vName).value ;
    
       vData = vData.replace(/([hH][rR][eE][fF]=)([\"\'](http:)([^<]*)[\"\'])/ig,"$1$2 onClick='javascript:window.open($2);return false;'");

       return vData;

}

function changeFields(oForm)
{
	try
	{
        if (document.all.opt_pay[0].checked){
		document.all["Card Number"].style.background = "gray";
                document.all["Card Number"].required="";
		try{
                  document.all["ID Number"].style.background = "gray"
                  document.all["ID Number"].required="";
                }catch(e){};
		document.all["Card Holder"].style.background = "gray";
		document.all["Card Holder"].required="";
		document.all["Card Type"].style.background = "gray";
		document.all["Card Type"].required="";
		document.all["Mounth"].style.background = "gray";
		document.all["Mounth"].required="";
		document.all["Year"].style.background = "gray";
		document.all["Mounth"].required="";
                document.all["OrderByName"].style.display="inline";
                document.all["OrderByCard"].style.display="none";
	}
	else{
		document.all["Card Number"].style.background = "white";
		document.all["Card Number"].required="true";
		try{
                  document.all["ID Number"].style.background = "white"
                  document.all["ID Number"].required="true";
                }catch(e){};
		document.all["Card Holder"].style.background = "white";
		document.all["Card Holder"].required="true";
		document.all["Card Type"].style.background = "white";
		document.all["Card Type"].required="true";
		document.all["Mounth"].style.background = "white";
		document.all["Mounth"].required="true";
		document.all["Year"].style.background = "white";
		document.all["Year"].required="true";
                document.all["OrderByName"].style.display="none";
                document.all["OrderByCard"].style.display="inline";
	}
	}
	catch(e){};
}
function ChangeClass(vObj,vClass,vImage)
{
     vObj.className=vClass;
     if(vImage!=null && vImage!="")
     {
       document.getElementById("img_"+vObj.id.substr(3)).src=vImage
     }
}
function checkImageState()
{
//  alert("1")
   if(document.getElementById("imgLarge").style.display=="none")
   {
      document.getElementById("btnLarge").style.display="none";
   }
   else
   {
     try
     {
       //if(document.getElementById("imgLarge").src.indexOf(".jpg")>0)
       //    var xB = document.getElementById("imgLarge").src.replace(".jpg","b.jpg");
       //else
       //    var xB = document.getElementById("imgLarge").src.replace(".gif","b.gif");
       if(document.getElementById("btnLarge").style.display!='none')
       {
         document.getElementById("btnLarge").style.top = parseInt(document.getElementById("btnLarge").style.top) + document.getElementById("imgLarge").offsetTop + document.getElementById("imgLarge").offsetHeight
         document.getElementById("btnLarge").style.display="inline";
       }
     }
     catch(e){}
   }
}
function ChangeAccomp(vSel)
{
	var Arr = vSel.value.split(":");
	var tbl = document.all["tblAccomp"].rows.length;
	if(tbl==3)
		ChangeAccompById(vSel,document.all["chk_accomp_prod"],document.all["accompPrice"],document.all["tdaccompImg"],document.all["tdaccompHref"],document.all["sel_accomp_prod_qty"],document.all["inpCompQty"])
	else
	{
		var i=0;
		for(;i<tbl-2;i++)
		{
			if(Arr[0]==document.all["inpComp"][i].value)
			{
				break;
			}
		}
		ChangeAccompById(vSel,document.all["chk_accomp_prod"][i],document.all["accompPrice"][i],document.all["tdaccompImg"][i],document.all["tdaccompHref"][i],document.all["sel_accomp_prod_qty"][i],document.all["inpCompQty"][i])
	}
}
function ChangeAccompById(vSel,oChk,oPrice,tdImg,tdHref,sQty,iQty)
{
	iQty.value = sQty.value
	var Arr = vSel.value.split(":");
	oChk.value = Arr[1];
	oPrice.innerText= formatCurrency(Arr[4]==0?Arr[3]:Arr[4]);

	var imgPath = "shops/"+Arr[6]+"/p"+Arr[1]+"b."+Arr[7];
	if(Arr[5]!="")
	{
		if(Arr[5].indexOf('http://')>0)
			imgPath = Arr[5]
		else
			imgPath = "shops/"+Arr[6]+"/"+Arr[5];
	}	
	var Img ="<img id='accompImg' name='accompImg' border='0' hspace='0' vspace='0' style='cursor:hand' onclick='"
	Img += "window.open(\"zoom.htm?"+ imgPath + "\", \"Zoom\", \"resizable=yes, menubar=no, titlebar=no, scrollbars=1, toolbar=no, status=no, location=no, directories=no, top=0, left=0\");return false;"
	Img += "' src='"
	Img += "shops/" + Arr[6] + "/small-2.gif"
	Img += "'>"

	tdImg.innerHTML = Img;

	Img = "<a id='accompHref' name='accompHref' href='"
    Img += "javascript:void(window.open(\"printproduct.asp?pc=" + Arr[1] + "\",\"\",\"\"))'>"
    Img += "<img border='0' hspace='0' vspace='0' src='"
    Img += "shops/" + Arr[6] + "/small-1.gif'/></a>"
	tdHref.innerHTML = Img;
}
function formatCurrency(num)
{
	num = num.toString().replace(/\₪|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '₪' + num + '.' + cents);
}

function SetData()
{
   try
   {
	var tbl = document.all["tblAccomp"].rows.length;
	if(tbl==3)
	{
		if(!document.all["chk_accomp_prod"].checked)
		{
			document.all["sel_accomp_prod_qty"].text = "-1";
			document.all["inpCompQty"].value = "";
		}
	}
	else
	{
		var i=0;
		for(;i<tbl-2;i++)
		{
			if(!document.all["chk_accomp_prod"][i].checked)
			{
				document.all["sel_accomp_prod_qty"][i].value = "-1";
				document.all["inpCompQty"][i].value = "";
			}
		}
	}
   }
   catch(e){};
   return true;
}

function CheckTagLogin111(vPath)
{

   var vdata = "<content>check tag user<users><user uid='' psw=''/></users></content>";
   if(document.getElementById("CompanyName").value=="" || document.getElementById("CompanyPassword").value=="")
   {
      alert(msgLoginEmpty);
      return false;
   }

   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vdata);
   var oUID=olXMLsource.selectSingleNode("//user/@uid");
   oUID.text=document.getElementById("CompanyName").value;
   var oPSW=olXMLsource.selectSingleNode("//user/@psw");
   oPSW.text=document.getElementById("CompanyPassword").value;

   //Open http to send data to server
   var httpOb = GetHttp(olXMLsource);
   
   if(httpOb.status==200)
   {
     if(httpOb.getResponseHeader('RetVal')=="0")
        alert(msgLoginWrong)
     else

        if(vPath!='undefined' && vPath!=null)
        {
           window.document.location.href=vPath;
        }
        else
            window.document.location.href=window.document.location.href;
   }
   else
   {
     alert(msgLoginFailed);
     return false;
   }
}

function CheckLogin(vRefresh)
{
   var vdata = "<content>check user<users><user uid='' psw=''/></users></content>";

   if(document.getElementById("username").value=="" || document.getElementById("password").value=="")
   {
      alert(msgLoginEmpty);
      return false;
   }
   
   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vdata);
   var oUID=olXMLsource.selectSingleNode("//user/@uid");
   oUID.text=escape(document.getElementById("username").value);
   var oPSW=olXMLsource.selectSingleNode("//user/@psw");
   oPSW.text=escape(document.getElementById("password").value);

   //Open http to send data to server
   var httpOb = GetHttp(olXMLsource);

   if(httpOb.status==200)
   {     
     document.getElementById("password").value="";
     if(httpOb.getResponseHeader('RetVal')=="0")
        alert(msgLoginWrong)
     else

      window.document.location.href=window.document.location.href;
   }
   else
   {
     alert(msgLoginFailed);
     return false;
   }

}
function CheckCLogin(vPath)
{

   var vdata = "<content>check company user<users><user supplierid='' uid='' psw=''/></users></content>";

   if(document.getElementById("CompanyName").value=="" || document.getElementById("CompanyPassword").value=="")
   {
      alert(msgLoginEmpty);
      return false;
   }



   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vdata);
   

   var oSID=olXMLsource.selectSingleNode("//user/@supplierid");

   oSID.text=document.getElementById("pk_supplier_id").value;


   var oUID=olXMLsource.selectSingleNode("//user/@uid");

   oUID.text=document.getElementById("CompanyName").value;
   var oPSW=olXMLsource.selectSingleNode("//user/@psw");
   oPSW.text=document.getElementById("CompanyPassword").value;


   //Open http to send data to server
   var httpOb = GetHttp(olXMLsource);
   if(httpOb.status==200)
   {
     document.getElementById("CompanyPassword").value="";
     if(httpOb.getResponseHeader('RetVal')=="0")
        alert(msgLoginWrong)
     else

        if(vPath!='undefined' && vPath!=null)
        {
           window.document.location.href=vPath;
        }
        else
            window.document.location.href=window.document.location.href;
   }
   else
   {
     alert(msgLoginFailed);
     return false;
   }

}
function CheckNTVLogin(vPath)
{

   var vdata = "<content>check company user<users><user supplierid='' uid='' psw=''/></users></content>";

   if(document.getElementById("CompanyName").value=="" || document.getElementById("CompanyPassword").value=="")
   {
      alert(msgLoginEmpty);
      return false;
   }


   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vdata);
   

   var oSID=olXMLsource.selectSingleNode("//user/@supplierid");

   //oSID.text=document.getElementById("pk_supplier_id").value;
       oSID.text = "1657";

   var oUID=olXMLsource.selectSingleNode("//user/@uid");

   oUID.text=document.getElementById("CompanyName").value;
   var oPSW=olXMLsource.selectSingleNode("//user/@psw");
   oPSW.text=document.getElementById("CompanyPassword").value;


   //Open http to send data to server
   var httpOb = GetHttp(olXMLsource);
   if(httpOb.status==200)
   {
     document.getElementById("CompanyPassword").value="";
     if(httpOb.getResponseHeader('RetVal')=="0")
        alert(msgLoginWrong)
     else

        if(vPath!='undefined' && vPath!=null)
        {
           window.document.location.href=vPath;
        }
        else
            window.document.location.href=window.document.location.href;
   }
   else
   {
     alert(msgLoginFailed);
     return false;
   }

}


function UserLogOut(vRefresh)
{
   var vdata = "<content>user logout<users><user uid='' psw=''/></users></content>";
   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vdata);
   var httpOb = GetHttp(olXMLsource);

   if(httpOb.status==200)
   {
      if(vRefresh!=null && vRefresh!="")
      {
          window.document.location.href=window.document.location.href;
      }
      else
      {
          document.getElementById("logout").style.display="none";
          document.getElementById("login").style.display="inline";
      }
   }
   else
   {
       alert("Logout failed try again");
       return false;
   }
}



var iCounter=5;
var i ;
var arraya;
function SetBanIframe(id)
{
    arraya="   ";
    i=-1 ;
    if (!iCounter)
    {
    	//document.frmNews.submit();
    }
    window.setInterval("showMsg();",10);

    document.getElementById(id).innerHTML = "<iframe id='Ban' src='http://dealme.org/show_ad.php?t=0&s=0&p=787&cat_id=0&width=170&height=170&ref=' width='170px' height='170px' scrolling='no' frameborder='0'></iframe>";

}
function showMsg()
{
  iCounter=iCounter-1;
  i=i+1 ;
  //window.status=window.status + arraya.charAt(i);
  if (i==arraya.length)
  {
    i=-1;
    window.status="";
  }
}
var LastID=1;
function ShowLargePic(vSrc)
{
	var vS = vSrc.src
	vS = vS.replace("/s/s","/s");
	document.getElementById("LargeImage").src =vS;
}
function ChangeImg(vId)
{

        var x;
	var y;
	x = document.getElementById("LargeImage").src ;
	y = x.substr(x.length-4,4);
	x = x.substr(0,x.length-5);
	document.getElementById("tdImg"+LastID).className="page_text";
	document.getElementById("tdImg"+vId).className="silver";
        document.getElementById("LargeImage").src =x+vId+y ;
	LastID=vId;

}

function OpenZoom(vSrc)
{
    var vS = vSrc;
    if(vS.indexOf("_")==-1)
    {
        if(vS.indexOf(".jpg")!='-1')
            vS = vS.replace(".jpg","b.jpg");
        else
            vS = vS.replace(".gif","b.gif");
    }
    var x = "zoom.htm?"+vS
    window.open(x, 'Zoom', 'resizable=yes, menubar=no, titlebar=no, scrollbars=1, toolbar=no, status=no, location=no, directories=no, top=0, left=0');return false;
}
function ClearForm(cForm)
{
	var eLm = new Object()
	
	for(i=0;i<cForm.elements.length;i++)
	{
	  eLm = cForm.elements(i)
	  switch(eLm.tagName.toUpperCase()) 
	  {
	    case "INPUT":
    	    if (eLm.type.toUpperCase()=="TEXT")
    	    {
				 eLm.value = "";
			}	 
    	    else if (eLm.type.toUpperCase()=="CHECKBOX")
    	    {
				 eLm.checked = false;
			}
	    break;
	    case "SELECT":
			eLm.selectedIndex = 0
	    break;
	    case "TEXTAREA":
			eLm.value = "";
	    break;
	 }
	}
}
function ChangeItemPrice(vObj)
{
    var Qty = document.getElementById("quantity").value;
    var Price = vObj.value.split(";")[1];
    var ID = vObj.value.split(";")[0];
    document.getElementById("item").value = ID;
    document.getElementById("tdPrice").innerText =  "₪" + String(Qty * Price) ;
}
function SetTotalPrice(vObj,Index)
{
      var Qty = vObj.value;
      var Price = document.all["Price"][Index-1].value;
      var TPrice = document.all["TPrice"][Index-1];
      var num = Qty * Price
      TPrice.innerText =  String(num.toFixed(2) + " " + "₪") ;
}
function Set1TotalPrice(vObj)
{
      var Qty = vObj.value;
      var Price = document.all["Price"].value;
      var TPrice = document.all["TPrice"];
      var num = Qty * Price
      TPrice.innerText =  String(num.toFixed(2) + " " + "₪") ;
}

function imgOver(vImg)
{
   vImg.src = vImg.src.replace(".jpg","_over.jpg");
}
function imgOut(vImg)
{
   vImg.src = vImg.src.replace("_over.jpg",".jpg");
}
var LastSubMenu="";
function OpenSubMenu(vID)
{
    try
    {
      if(LastSubMenu!="")
      {
        document.getElementById(LastSubMenu).style.display="none";
      }
    }catch(e){};
    try
    {
       document.getElementById(vID).style.display="inline";
    }catch(e){};
    LastSubMenu = vID;
}

var eOpenMenu = null;

function OpenMenu(vID,vHeight,vLeft)
{
    CloseMenu()
    var vHgt = 20;
    if(vHeight!=null) vHgt=vHeight;

    var eSrc = document.getElementById("divMenuBar_"+vID)
    //alert(eSrc.offsetWidth)
    var eMenu = document.getElementById("divMenu_"+vID)
    //alert(eMenu.style.left.indexOf('px'))
    if (eMenu.style.left.indexOf('px')==-1)
    {
        if(vHeight!=null)
        {
           eMenu.style.left = (eSrc.offsetLeft + eSrc.offsetWidth) - eMenu.offsetWidth ;
        }
        else
        {
           eMenu.style.left = eMenu.offsetLeft - eMenu.offsetWidth ;
        }
        if(vLeft!=null)
        {
          var sLeft = screen.availWidth - ((screen.availWidth-780)/2)- vLeft*2;
          eMenu.style.left = sLeft;
        }
    }
    if (eMenu.style.top.indexOf('px')==-1)
    {
        eMenu.style.top = eMenu.offsetTop + vHgt ;
    }
    eMenu.style.visibility = "visible";
    eOpenMenu = eMenu;
}

function CloseMenu()
{
    try
    {
      eOpenMenu.style.visibility = "hidden";
      eOpenMenu = null;
    }
    catch(e){}
}

function document.onmouseover()
{
    var eSrc = window.event.srcElement;
    if (eOpenMenu && eSrc.id.indexOf('divMenu')==-1)
    {
      CloseMenu();
    }
}
/* MENUS */
function SendDynamicSurvay(vPk)
{
   var i
   var vCount = document.getElementById("pos").value;
   var vData = "<content>Update Questionnaire<forms>"
   for(i=0; i<vCount ;i++ )
   {
     if(fin[i].checked)
     {
       vData += "<form pk_dynanic_report_id='"+vPk+"' field_index='1' value='"+fin[i].value+"'/>";
     }
   }
   vData += "</forms></content>"
   

   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vData);
   var httpOb = GetHttp(olXMLsource);
   
   
   if(httpOb.responseText == "0")
   {
     alert(msgChoose);
     window.location.replace(window.location.href);
   }  
   else
     alert(L_SAVED_NONE);
}
function AddProductToChart(Index)
{
   var Qty = document.all["Quantity"][Index-1].value;
   if(Qty=="" || Qty=="undefined" || Qty==null)
   {
     Qty="1";
     document.all["Quantity"][Index-1].value = "1"
     SetTotalPrice(document.all["Quantity"][Index-1],Index);
   }

   var vData = "<content>Add To Shoping Cart<carts>"
   vData += "<cart pk_prod_id='"+ document.all["ProdID"][Index-1].value +"' Qty='"+ Qty +"' Item='"+document.all["item"][Index-1].value+"'/>";
   vData += "</carts></content>"
   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vData);
   var httpOb = GetHttp(olXMLsource);
   if(httpOb.responseText == "0")
   {

     document.all["sSend"][Index-1].style.display="none";
     document.all["sUpdate"][Index-1].style.display="inline";
     document.all["sDelete"][Index-1].style.display="inline";
     document.all["sSign"][Index-1].style.display="inline";
   }
}
function Add1ProductToChart()
{
   var Qty = document.all["Quantity"].value;
   if(Qty=="" || Qty=="undefined" || Qty==null)
   {
     Qty="1";
     document.all["Quantity"].value = "1"
     Set1TotalPrice(document.all["Quantity"]);
   }

   var vData = "<content>Add To Shoping Cart<carts>"
   vData += "<cart pk_prod_id='"+ document.all["ProdID"].value +"' Qty='"+ Qty +"' Item='"+document.all["item"].value+"'/>";
   vData += "</carts></content>"
   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vData);
   var httpOb = GetHttp(olXMLsource);
   if(httpOb.responseText == "0")
   {
     document.all["sSend"].style.display="none";
     document.all["sUpdate"].style.display="inline";
     document.all["sDelete"].style.display="inline";
     document.all["sSign"].style.display="inline";
   }
}
function UpdateProductInChart(Index)
{
   var Qty = document.all["Quantity"][Index-1].value;
   if(Qty=="" || Qty=="undefined" || Qty==null)
   {
     Qty="1";
     document.all["Quantity"][Index-1].value = "1"
   }

   var vData = "<content>Update Shoping Cart<carts>"
   vData += "<cart pk_prod_id='"+ document.all["ProdID"][Index-1].value +"' Qty='"+ Qty +"' Item='"+document.all["item"][Index-1].value+"'/>";
   vData += "</carts></content>"
   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vData);
   var httpOb = GetHttp(olXMLsource);
   if(httpOb.responseText == "0")
   {
     SetTotalPrice(document.all["Quantity"][Index-1],Index);
     document.all["sSend"][Index-1].style.display="none";
     document.all["sUpdate"][Index-1].style.display="inline";
     document.all["sDelete"][Index-1].style.display="inline";
     document.all["sSign"][Index-1].style.display="inline";
   }
}
function Update1ProductInChart()
{
   var Qty = document.all["Quantity"].value;
   if(Qty=="" || Qty=="undefined" || Qty==null)
   {
     Qty="1";
     document.all["Quantity"].value = "1"
   }

   var vData = "<content>Update Shoping Cart<carts>"
   vData += "<cart pk_prod_id='"+ document.all["ProdID"].value +"' Qty='"+ Qty +"' Item='"+document.all["item"].value+"'/>";
   vData += "</carts></content>"
   var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
   olXMLsource.async = false;
   olXMLsource.loadXML(vData);
   var httpOb = GetHttp(olXMLsource);
   if(httpOb.responseText == "0")
   {
     Set1TotalPrice(document.all["Quantity"]);
     document.all["sSend"].style.display="none";
     document.all["sUpdate"].style.display="inline";
     document.all["sDelete"].style.display="inline";
     document.all["sSign"].style.display="inline";
   }
}

function DelProductFromChart(Index)
{
   if(confirm(msgDelete))
   {
       var vData = "<content>Remove From Shoping Cart<carts>"
       vData += "<cart pk_prod_id='"+ document.all["ProdID"][Index-1].value +"' supplierid='"+ document.all["SupplierID"][0].value +"' Item='"+document.all["item"][Index-1].value+"' />";
       vData += "</carts></content>"
       var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
       olXMLsource.async = false;
       olXMLsource.loadXML(vData);
       var httpOb = GetHttp(olXMLsource);
       if(httpOb.responseText == "0")
       {
         document.all["Quantity"][Index-1].value = "";
         document.all["TPrice"][Index-1].innerText = "";
         document.all["sSend"][Index-1].style.display="inline";
         document.all["sUpdate"][Index-1].style.display="none";
         document.all["sDelete"][Index-1].style.display="none";
         document.all["sSign"][Index-1].style.display="none";
       }
   }
}
function Del1ProductFromChart(Index)
{
   if(confirm(msgDelete))
   {
       var vData = "<content>Remove From Shoping Cart<carts>"
       vData += "<cart pk_prod_id='"+ document.all["ProdID"].value +"' supplierid='"+ document.all["SupplierID"].value +"' Item='"+document.all["item"].value+"' />";
       vData += "</carts></content>"
       var olXMLsource = new ActiveXObject("Microsoft.XMLDOM");
       olXMLsource.async = false;
       olXMLsource.loadXML(vData);
       var httpOb = GetHttp(olXMLsource);
       if(httpOb.responseText == "0")
       {
         document.all["Quantity"].value = "";
         document.all["TPrice"].innerText = "";
         document.all["sSend"].style.display="inline";
         document.all["sUpdate"].style.display="none";
         document.all["sDelete"].style.display="none";
         document.all["sSign"].style.display="none";
       }
   }
}