var browserName = navigator.appName;

function htmlElement(el)
{
    if (browserName == "Netscape")
        return document.getElementById(el)
    else
        return document.all[el]
}

function displayObject(itemId, classID){
	document.getElementById(itemId).className = classID;
}

function HighTdOver(cell, classId){
	cell.className = classId;
}

function openWin(URLStr, width, height){
    open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height);
}

//To show/hide div by exemple
function DisplayElementById(elementId, value)
{   
    if(value)   
    {  
        document.getElementById(elementId).style.display='block'; 
    }
    else
    {
        document.getElementById(elementId).style.display='none'; 
    }
}

//To use radio button in repeater --> fixe bug of the groupe name
//rbAddress.Attributes.Add("onclick", "CheckRadioButtonInRepeater('repAddress.*rbAddress',this)");  --> repAddress=repeater id and rbAddress = radio button id
function CheckRadioButtonInRepeater(nameregex, current)
{   
   re = new RegExp(nameregex);
   for(i = 0; i < document.forms[0].elements.length; i++)
   {
      elm = document.forms[0].elements[i]
      if (elm.type == 'radio')
      {
         if (re.test(elm.name))
         {
            elm.checked = false;
         }
      }
   }
   current.checked = true;
}