﻿
//disable image flickering in IE
try
{
    document.execCommand("BackgroundImageCache", false, true);
} 
catch(err) 
{

}
            
//create new popup window
function OpenNewWindow(mypage,w,h,myname)
{
//alert('rfge');
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no';
    win=window.open(mypage,'',settings);
    if(parseInt(navigator.appVersion) >= 4)
        {
            win.window.focus();
        }
}


//check/uncheck all checkbox in gridview 
function doAllChecks(ctrl)
{
     re = new RegExp('cb_')
    if(ctrl.checked) // is checked
     {        
          for (var iCount=0;iCount < document.forms[0].elements.length;iCount++)
          {
                el = document.forms[0].elements[iCount]
                if (el.type == 'checkbox') 
                {
                    if (re.test(el.id)) 
                    {
                        el.checked = true;    
                    }
                }
           
          }
     }
     else
     {
              for (var iCount=0;iCount < document.forms[0].elements.length;iCount++)
              {
                    el = document.forms[0].elements[iCount]
                    if (el.type == 'checkbox') 
                    {
                        if (re.test(el.id)) 
                        {
                            el.checked = false;
                        }
                    }
               
              }
     }
 
}