﻿
    function addLocalParam(obj, value)
    {
        document.getElementById(obj).value = value;
        
        document.forms[0].hdnSelParam1.value = value;
        
        
    }   
    
    function setInvoiceParam(obj, value)
    {
        document.getElementById(obj).value = value;
        
        //document.forms[0].hdnSelParam1.value = value;
        
        
    }
    
    // ********************** Grid Functions **********************
    function handleClick(o, value)
    {
        
	    if (!o)
	    {
		    o = event.srcElement;
	    }

	    switch (o.tagName)
	    {
		    case "TD":
			    o = o.parentElement;
			    break;
	    }
  
	    if (!o.selected)
	    {
		    handleSelectRow(o, value);
	    }
    }
    
   

    function handleSelectRow(o, value)
    {
       
	    unselectRows(o.parentElement.parentElement);

   	    selectRow(o, value);
    }
        
    function selectRow(o, value)
    {
        o.style.backgroundColor = "#DAE0EB"
        document.forms[0].hdnSelParam1.value = value;
    }    
       
    function unselectRow(o)
    {
	    if (o.style.backgroundColor == "#DAE0EB" || o.style.backgroundColor == "#dae0eb")
            o.style.backgroundColor = "#FFFFFF"
       document.forms[0].hdnSelParam1.value = "";
    }   
       
    function unselectRows(oSkip)
    {

	    for (var i=0; i < oSkip.rows.length; i++)
	    {
		    var oTr = oSkip.rows[i];

		    if (oTr != oSkip)
		    {
			    unselectRow(oTr);
		    }
	    }
    }   
    
    function applyStyle(o, sClass)
    {
	    var i = 0;
	    var ii = o.cells.length;

	    while (i < ii)
	    {
		    o.cells[i].style.backgroundColor = sClass;
		    i++;
	    }
    }   
    
    function toggleBtn(btnId, setVisible){
        
        if(setVisible == 'true'){
            document.getElementById(btnId).style.display = 'inline';
        }else{
            document.getElementById(btnId).style.display = 'none';
        } 
    }
    
    //

  