function GetIndex(checkBox,txtIndex)
{
try
   { 
	var tr=checkBox.parentElement.parentElement;
	var tb=tr.parentElement;
	txtIndex.value="";
	for(var i=1;i<tb.rows.length;i++)
	{				
		var checked=(tb.rows[i].cells[0].children[0].checked);
		if (checked)
		{					
			txtIndex.value +=","+tb.rows[i].cells[0].children[0].value;						
		}						
	}
	}catch(e){}
}

function SelectIndex(checkBox,dataGrid,txtIndex)
{
    try
   { 
	var check=checkBox.checked;
	var tb=dataGrid;
	txtIndex.value="";
	for(var i=1;i<tb.rows.length;i++)
	{				
		tb.rows[i].cells[0].children[0].checked=check;
		if (check==true)
		{		
			txtIndex.value +=","+tb.rows[i].cells[0].children[0].value;				
		}									
	}
	}catch(e){}
	
}

function SetIndex(checkBox,txtIndex)
{
	var check=checkBox.checked;
	txtIndex.value =checkBox.value;			
	
}

function ShowDialog(url,iWidth,iHeight) 
{ 
  var  iTop=(window.screen.height-iHeight)/2;
  var  iLeft=(window.screen.width-iWidth)/2;
  window.open(url, "_blank", "titlebar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,edge:Raised,left="+iLeft+",top="+iTop+",width="+iWidth+",height="+iHeight+",false"); 
 // window.open(url,"Detail","fullscreen=3,scrollbars=auto,toolbar=no,location=no,direction=no,edge:Raised,depended=yes,resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft+",false");
} 

function ShowDialogModel(url,iWidth,iHeight) 
{ 
  window.showModelessDialog(url, "dialogWidth="+iWidth+" ,dialogHeight="+iHeight) ;
  //window.showModalDialog(url, "resizeable=no,status=no,dialogWidth="+iWidth+" ,dialogHeight="+iHeight) ;
} 


function modelessDialogShow(url,width,height)
	{
	window.showModelessDialog(url,window,
		"dialogWidth:"+width+"px;scroll:1;dialogHeight:"+height+"px;edge:Raised;center:1;help:0;resizable:1;");
	}
function modalDialogShow(url,width,height)
	{
	window.showModalDialog(url,window,
		"dialogWidth:"+width+"px;scroll:1;dialogHeight:"+height+"px;edge:Raised;center:1;help:0;resizable:1;maximize:1");
	}

function CustomPage_ClientValidate() {
            var i;
            for (i = 0; i < Page_Validators.length; i++) {
                ValidatorValidate(Page_Validators[i]);
            }
            ValidatorUpdateIsValid();    
            return Page_IsValid;
        }
function ButtonDisabled(obj)
{
    if(typeof(ValidatorValidate) == 'function')
    {
        if(CustomPage_ClientValidate())
        {
            obj.disabled=true;
            __doPostBack(obj.name,"");  
        }
    }
    else
    {
        obj.disabled=true;
        __doPostBack(obj.name,"");  
    }
}

function public_getEventTarget()
    {
        var target;
        if (__nonMSDOMBrowser) {
        target = event.target;
        }
        else {
        target = event.srcElement;
        }
        return target;
    }
    function doSelect(node)
    {
        var objNode = public_getEventTarget(); 
        if(objNode.tagName!="A")
        return;
        setUnSelect(node);
        objNode.style.backgroundColor="#99ccff";
    }
    function setUnSelect(divID)
    { 
        var objchild = divID.children;
        var count = objchild.length; 
        for(var i=0;i<objchild.length;i++)
        {
            var tempObj = objchild[i];
//            tempObj.className ="";
            tempObj.style.backgroundColor="";
//            tempObj.style.padding="0px 0px 0px 0px";
            setUnSelect(tempObj); 
        }
    }
