            function Is ()
            {
			var agt=navigator.userAgent.toLowerCase()
			var ie_start = navigator.appVersion.indexOf("MSIE")
			
			this.created = true;

			this.major = parseInt(navigator.appVersion)
			this.minor = parseFloat(navigator.appVersion)

			if (ie_start != -1) {
			    var version_string = navigator.appVersion.substring(ie_start + 5)
			    this.major = parseInt(version_string)
			    this.minor = parseFloat(version_string)
			}

                this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1)))
                this.nav2 = (this.nav && (this.major == 2))
                this.nav3 = (this.nav && (this.major == 3))
                this.nav4 = (this.nav && (this.major == 4))

                //Netscape 6
                this.nav5 = (this.nav && (this.major == 5))
                this.nav6 = (this.nav && (this.major == 5))
                this.gecko = (this.nav && (this.major >= 5))
                
			 // IE
                this.ie   = (agt.indexOf("msie") != -1)
                this.ie3  = (this.ie && (this.major == 3))
                this.ie4  = (this.ie && (this.major == 4))
                this.ie5  = (this.ie && (this.major == 5))


                this.opera = (agt.indexOf("opera") != -1)

                this.nav4up = this.nav && (this.major >= 4)
                this.ie4up  = this.ie  && (this.major >= 4)
                this.ie5_5up  = this.ie  && (this.minor >= 5.5)
            }

var is = new Is();
var ifr;
var count = 10;
var f_name;

function onClick_href( e, name ) {
  f_name = name;
  if(is.ie5_5up){
    ifr = document.createElement('iframe');
    ifr.id = 'test';
    ifr.style.visibility = 'hidden';
    ifr.width = 1;
    ifr.height = 1;
    ifr.src = 'http://money.yandex.ru/select-wallet.xml';
    document.body.appendChild(ifr);
    wait_ifr();
    return false;
  } else {
    if (confirm('Чтобы заплатить, запустите ваш Интернет.Кошелек и нажмите ОК')) {
      return TstVars();
    }
    else return false;
  }
}

function TstVars() {
  if (f_name.form.elements["SummR"] == undefined) {
    return true
  }
  else {
    t = parseFloat(f_name.form.elements["SummR"].value + "." + f_name.form.elements["SummC"].value)
    if (t > 0) {
      f_name.form.elements["wbp_currencyamount"].value = "643;"+t;
      return true;
    } else alert("Указана неправильная сумма.");
    return false;
  }                       
}

            function wait_ifr()
            {
                i = ifr;
                if(is.ie5_5up){
                    if(ifr.readyState!='complete'){
                        count--;
                        if(count>=0) {
                            setTimeout('wait_ifr()', 80);
                        }
                        else{
                          alert('Ваш кошелек не запущен!');
                                 self.location.reload();
                        }
                        return;
                    }
                }

                if((is.ie5_5up ? ifr.document.body : ifr.contentDocument)) {
                    var str;
                    if(is.ie5_5up){
                        str = ifr.document.getElementsByTagName('body')[0].innerHTML;
                    }
                    else{
                        str = ifr.contentDocument.body.innerHTML;
                    }

                    if(str){
                      if (TstVars()) f_name.form.submit();
                    }
                }
              else{
                    count--;
                    if(count>=0) setTimeout('wait_ifr()', 80);
                }
                return false;
            }

