function browseIt(){
        this.ver = navigator.appVersion.toLowerCase();
        this.verNum = parseInt(this.ver);
        this.agent = navigator.userAgent.toLowerCase();
        this.dom = (document.getElementById ? 1 : 0);
        this.opera = (this.agent.indexOf("opera") > -1 && this.dom ? 1 : 0);
        this.opera7 = (this.opera && this.verNum >= 7);
        this.ie = (this.ver.indexOf("msie") > -1 && this.dom && !this.opera ? 1 : 0);
        this.ieVer = 0;
        if (this.ie) {
                var pos = this.ver.indexOf("msie");
                if (pos != -1)
                        this.ieVer = parseInt(this.ver.substr(pos + 5));
        }
        this.ie6 = (this.ie && this.ieVer >= 6);
        this.macOS = (this.agent.indexOf("mac") > -1);
        this.mac = (this.macOS && this.verNum >= 7 ? 1 : 0);
        this.moz = (this.agent.indexOf("gecko") > -1);
        this.ns6 = (this.dom && this.agent.indexOf("netscape") > -1 && this.verNum >= 5 ? 1 : 0);
        this.ff = (this.agent.indexOf("firefox") > -1);
        this.b = (this.ie || this.ns6 || this.opera7 || this.mac || this.moz || this.dom);
        return this;
}
var b = new browseIt();
var px = window.opera ? "" : "px";

function showregform(act,where){
        document.location.href = "#top";
        var l = document.getElementById(where);
        var m = document.getElementById('onregform');
        l.css = l ? l.style : null;
        if (!l){
                return true;
        }
        var lW = 400;
        var sW = 1700;
        l.style.width = lW + px;
        l.style.left = (sW - lW)/3 + px;
        l.style.top = document.body.scrollTop +200;
        if (act) {
                l.style.display = 'none';
                m.style.display = 'none';

                toggleDisplay('SELECT', 'visible');
                toggleDisplay('OBJECT', 'visible');
                toggleDisplay('EMBED', 'visible');
                toggleDisplay('IFRAME', 'visible');
        } else {

                if(b.ns6 && !b.opera){
                        return true;
                }

                toggleDisplay('SELECT', 'hidden');
                toggleDisplay('OBJECT', 'hidden');
                toggleDisplay('EMBED', 'hidden');
                toggleDisplay('IFRAME', 'hidden');

                m.style.display = 'inline';
                if (b.opera)
                        m.style.background = 'none';
                var bHeight = document.body.scrollHeight;
                m.style.height = bHeight + 'px';
                l.style.display = 'block';
        }
        return false;
}
function toggleDisplay(tag, value, cont)
{
        if (!cont)
                cont = document;
        var sel = document.getElementsByTagName(tag);
        for (var i = 0; i < sel.length; i++)
                sel[i].style.visibility = value;
}

var strE;





   var request = false;
   try {
     request = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         request = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         request = false;
       }
     }
   }

   if (!request)
     alert("Error initializing XMLHttpRequest!");


   function enter(logins,passlg) {
   //alert(logins);
     //var startl = document.getElementById("regform").value;
     var url = "ajax/enter.php?logins=" + encodeURIComponent(logins) + "&passlg=" + encodeURIComponent(passlg) ;
     request.open("GET", url, true);
     request.onreadystatechange = updatelogin;
     request.send(null);

   }



  function updatelogin() {
     if (request.readyState == 4) {
       if (request.status == 200) {
         var response = request.responseText.split("|");

         document.getElementById("regform").innerHTML = response[0];
       } else
         alert("status is " + request.status);
     }
   }

function code(id){
        if(this.document.getElementById('code'+id).style.display=='none')
        {
        this.document.getElementById('code'+id).style.display='block';
        }
        else
        {
        this.document.getElementById('code'+id).style.display='none';
        }
}