    function NewWindow(u,n,w,h,f,p,x,y) {
      var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

      if(x) {
        window.location=x;
      }

      win=window.open(u,n,s);

      if(win.focus) {
        win.focus();
      }

    }

        function getCheckedValue(radioObj) {
          if(!radioObj) {
            return "";
          }
          var radioLength = radioObj.length;
          if(radioLength == undefined) {
            if(radioObj.checked) {
              return radioObj.value;
            } else {
              return "";
            }
          }
          for(var i = 0; i < radioLength; i++) {
            if(radioObj[i].checked) {
              return radioObj[i].value;
            }
          }
          return "";
        }

        function setCheckedValue(radioObj, newValue) {
          if(!radioObj) {
            return;
          }
          var radioLength = radioObj.length;
          if(radioLength == undefined) {
            radioObj.checked = (radioObj.value == newValue.toString());
            return;
          }
          for(var i = 0; i < radioLength; i++) {
            radioObj[i].checked = false;
            if(radioObj[i].value == newValue.toString()) {
              radioObj[i].checked = true;
            }
          }
        }

        //  check for valid numeric strings	

        function IsNumeric(strString) {
          var strValidChars = "0123456789";
          var strChar;
          var blnResult = true;

          if (strString.length == 0) {
            return false;
          }

          //  test strString consists of valid characters listed above

          for (i = 0; i < strString.length && blnResult == true; i++) {

            strChar = strString.charAt(i);

            if (strValidChars.indexOf(strChar) == -1) {
              blnResult = false;
            }

          }

          return blnResult;

        }

        function echeck(str) {
          var at="@";
          var dot=".";
          var lat=str.indexOf(at);
          var lstr=str.length;
          var ldot=str.indexOf(dot);

          if (str.indexOf(at) == -1) {
            return false;
          }

          if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
            return false;
          }

          if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr){
            return false;
          }

          if (str.indexOf(at,(lat+1)) != -1){
            return false;
          }

          if (str.substring(lat-1,lat) == dot || str.substring(lat+1,lat+2) == dot){
            return false;
          }

          if (str.indexOf(dot,(lat+2)) == -1){
            return false;
          }

          if (str.indexOf(" ") != -1) {
            return false;
          }

          return true;
        }

        function validZip(zip) {
          if (zip.match(/^[0-9]{5}$/)) {
            return true;
          }

          zip=zip.toUpperCase();

          if (zip.match(/^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/)) {
            return true;
          }

          if (zip.match(/^[A-Z][0-9][A-Z].[0-9][A-Z][0-9]$/)) {
            return true;
          }

          return false;
        }

        function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
        }

