/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\                                                                                              \
\           libraries/function.js                                                              \
\                                                                                              \
\                This file is part of shopping cart of closeadeal.com                          \
\                <webmaster@closeadeal.com>                                                    \
\                                                                                              \
\                                                                                              \
\        (C)Copyright CloseADeal Team 2003                                                     \
\                                                                                              \
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

/*******************************************************************************************

        AUTHOR: Priya Saliya Wijesinghe <priyasaliya@yahoo.com>/<saliya@closeadeal.com>
        FILE:  libraries/function.js
        PURPOSE:
                1.  contain functions for javascript

******************************************************************************************/
  /*==================================================================
       function con_del use for get confirmed request on delete a,
               1. category.
               2. product
       variables :
             getId --> id of removeing
             msg   --> warning massage
             path  --> path for delete code
  */
  function con_del(getId,msg,path,flag,pg)
   {
     if(flag=="c"){
        var link=path+"&use=delc&id=" + getId;
     }else if(flag=="l"){
        var link=path+"&use=dell&id=" + getId + "&pgNo=" + pg;
     }else if(flag=="p"){
        var link=path+"&use=delp&id=" + getId + "&pgNo=" + pg;
     }

            if(confirm(msg)){
            document.location.href=link;
            }
   }
  /*==================================================================
       function for desable
       or for enabled shipping objects in billing info
  */

   function shipHand(thisVal){
       if(thisVal=="Y"){
              document.frmBillNShip.billCountry[0].disabled=true;
             alert("ssss");
           }
   }


  /*==================================================================
       function billNship use for disabled
       or for enabled some objects in billing info
  */
  function billNship()
   {
       if (document.frmBillNShip.bill_s_ship.checked==true)
       {
           document.frmBillNShip.shipName.disabled=true;
           document.frmBillNShip.shipAddress.disabled=true;
           document.frmBillNShip.shipState.disabled=true;
           document.frmBillNShip.shipZip.disabled=true;
           document.frmBillNShip.shipCountry.disabled=true;
       }else{
           document.frmBillNShip.shipName.disabled=false;
           document.frmBillNShip.shipAddress.disabled=false;
           document.frmBillNShip.shipState.disabled=false;
           document.frmBillNShip.shipZip.disabled=false;
           document.frmBillNShip.shipCountry.disabled=false;
       }
   }
  /*==================================================================
       function validate_bill use for validate user inputs
       on billing information window
  */
  function validate_bill()
   {
       if (document.frmBillNShip.bill_s_ship.checked==true)
       {
           document.frmBillNShip.shipName.disabled=true;
           document.frmBillNShip.shipAddress.disabled=true;
           document.frmBillNShip.shipState.disabled=true;
           document.frmBillNShip.shipZip.disabled=true;
           document.frmBillNShip.shipCountry.disabled=true;
       }else{
           document.frmBillNShip.shipName.disabled=false;
           document.frmBillNShip.shipAddress.disabled=false;
           document.frmBillNShip.shipState.disabled=false;
           document.frmBillNShip.shipZip.disabled=false;
           document.frmBillNShip.shipCountry.disabled=false;
       }
   }
  /*==================================================================*/

   function del_alt()
   {
     var msg="WARNING! Sorry, You can not delete this catagory " ;
     alert(msg);
   }
  /*==================================================================*/

   function show_code(item,shop){
        args="width="+300+",height="+400+",resizable=no,scrollbars=yes,status=0";
        myUrl="inc/prod_code.php?shop="+shop +"&myItem="+ item;
        window.open(myUrl,"procode",args);
   }

  /*==================================================================*/
   function show_zoom(item,shop){
        args="width="+600+",height="+500+",resizable=no,scrollbars=yes,status=0";
        myUrl="img_zoom.php?shop="+shop +"&myItem="+ item;
        window.open(myUrl,"zoom",args);
   }
  /*==================================================================*/

   function img_up(item,shop,varify){
        args="width="+400+",height="+250+",resizable=no,scrollbars=yes,status=0";
        myUrl="../img_ftp/img_upload.php?shop="+shop +"&myItem="+ item +"&varify="+ varify;
        window.open(myUrl,"imgup",args);
   }     /*==================================================================*/

   function show_cat_code(item,shop){
        args="width="+300+",height="+200+",resizable=no,scrollbars=yes,status=0";
        myUrl="inc/cat_code.php?shop="+shop +"&myCat="+ item;
        window.open(myUrl,"catcode",args);
   }