var ns4 = (document.layers) ? true : false;  // browser sniffer
var ie4 = (document.all) ? true : false;
var ns6 = (document.getElementById&&!document.all) ? true : false;
var op7 = (window.opera) ? true : false;

function popw(loc,nam,wid,hei,othe) {
if (window.screen)
{
x = (screen.availWidth - wid) * 0.5;
y = (screen.availHeight- hei) * 0.5;
}
else
{
x = 50;
y = 50;
}
if (othe=='') {popupw=window.open(loc,nam,'width='+wid+',height='+hei)
 } else {popupw=window.open(loc,nam,'width='+wid+',height='+hei+','+othe)
}
popupw.moveTo(x,y);
l=popupw.focus();
return popupw 
}

function popw2(loc,nam,wid,hei,othe) {
if (window.screen)
{
x = (screen.availWidth - wid) * 0.5;
y = (screen.availHeight- hei) * 0.5;
}
else
{
x = 50;
y = 50;
}
if (!ie4||op7){
if (othe=='') {popupw=window.open(loc,nam,'width='+wid+',height='+hei)
 } else {popupw=window.open(loc,nam,'width='+wid+',height='+hei+','+othe)
}
popupw.moveTo(x,y);
l=popupw.focus();
return popupw
}
if (ie4){
window.showModalDialog(loc, '', 'dialogWidth:' + wid+ 'px;dialogHeight:'  + hei + 'px;edge:Raised; center:Yes; help:No; resizable:No; status:Yes; scroll:yes')
}


}



function ShowIpAddressPopupWindow(ip)
{
    var w=popw('Preloader.htm','IPResolve',500,150,'status=yes')
    w.location.href='Popup.aspx?Element=Top100StatsIpResolve&IpForResolve='+ip
}
         
function ShowGoalPointInfoPopupWindow(goalpointID)
{
    var w=popw('Preloader.htm','GoalPointInfo',500,300,'status=yes,scrollbars=yes')
    w.location.href='Popup.aspx?Element=Top100StatsGoalPointInfo&GoalPointID='+goalpointID
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber = true;
   var Char;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   return IsNumber;
}

function showParamValues(URL,link)
{
    var __name=link.childNodes[0].nodeValue;
    var __url=URL + escape(__name)
    window.location.href=__url
}