var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

function getURLParameter(sName) 
{
  var sURL = window.document.URL.toString();
  if (sURL.indexOf("?") > 0){
    var arrParams = sURL.split("?");
    var arrURLParams = arrParams[1].split("&");
    var i = 0;
    for (i=0;i<arrURLParams.length;i++) {
      var sParam = arrURLParams[i].split("=");
      if (sName == sParam[0]) return unescape(sParam[1]);
    }
    return null;
  } else {
    return null;
  }
}

function openWin(szURL, iWidth , iHeight )
{
  if (iHeight > screen.availHeight-34) iHeight = screen.availHeight-34;
  if (iWidth > screen.availWidth) iWidth = screen.availWidth;

  iLeft = ((screen.availWidth)/2) - (iWidth / 2);
  if (iLeft < 0) iLeft = 0;
  iTop = ((screen.availHeight-34)/2) - (iHeight / 2);
  if (iTop < 0) iTop = 0;

  if (!isIE) {
 	 window.open(szURL ,"",
                     "width="+ iWidth + 
                     ",height=" + iHeight + 
                     ",status=no,menubar=no," +
                     "toolbar=no,scrollbars=no,resizable=yes,ScreenX=" + iLeft + ",ScreenY=" + iTop);
  } else {
 	 window.open(szURL ,"",
                     "width="+ iWidth + 
                     ",height=" + iHeight + 
                     ",status=no,menubar=no," +
                     "toolbar=no,scrollbars=no,resizable=yes,top=" + iTop + ",left=" + iLeft );
  }
}
