function limitText (textObj, maxCharacters){
	if (textObj.innerText.length >= maxCharacters){
	if ((event.keyCode >= 32 && event.keyCode <= 126) || (event.keyCode >= 128 && event.keyCode <= 254)){
	event.returnValue = false;
}}}
function noPressEnter(e, buttonid){
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        e.keyCode == null; 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        event.keyCode == null;
                        return false; 
                  } 
            } 
      } 
}
function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
} 

// this is for select all checkbox function
function select_deselectAll (chkVal, idVal) 
{ 
    var frm = document.forms[0];
    // Loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        // Look for our Header Template's Checkbox
        if (idVal.indexOf ('CheckAll') != -1) 
        {
            // Check if main checkbox is checked, then select or deselect datagrid checkboxes 
            if(chkVal == true) 
            {
                frm.elements[i].checked = true;
            } 
            else 
            {
                frm.elements[i].checked = false;
            }
            // Work here with the Item Template's multiple checkboxes
        } 
        else if (idVal.indexOf ('DeleteThis') != -1) 
        {
            // Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
            if(frm.elements[i].checked == false) 
            {
                frm.elements[1].checked = false; //Uncheck main select all checkbox
            }
        }
    }

}


// Please wait...////////////////////////////////////////////////////////////////////////////////////////////////

    var oElement;
    function onUpdating(){
        // get the update progress div
        var updateProgressDiv = $get('updateProgressDiv'); 

        
        // make it visible
        updateProgressDiv.style.display = '';    
        //var gridView = $get('EditDIV');
        //var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
        //var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);

        //var x;
        //var y;
        
          //  x = gridViewBounds.x;
          //  y = gridViewBounds.y;
 
       // Sys.UI.DomElement.setLocation (updateProgressDiv, x, y);
       var h2;
       h2=ietruebody().scrollTop;

        Sys.UI.DomElement.setLocation (updateProgressDiv, 0, h2);
    }

    function onUpdated() {
        // get the update progress div
        var updateProgressDiv = $get('updateProgressDiv'); 
        // make it invisible
        updateProgressDiv.style.display = 'none';
    }
    function ietruebody(){
        return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


    function ImgError(source) {
        source.onerror = "";
        source.style.display = "none";
        return true;
    } 