 
if (!UT) var UT = {};
UT.JSONRequest = function(url, id, onload, onerror) {

    this.url = url;
    this.onload = onload;
    this.onerror = onerror ? onerror: this.defaultError;
     
    this.init(url, id);
  
};
UT.JSONRequest.prototype = {
    init: function(url, id) {

        this.script = document.createElement("script");
        this.script.setAttribute("type", "text/javascript");
        this.script.setAttribute("src", url);
  
        var request = this;
        if (id) {
            this.script.setAttribute("id", id);
            if (document.getElementById(id)) {
                request.onload.call(request);
            }
            document.getElementsByTagName("head")[0].appendChild(this.script);
        } else {
            document.getElementsByTagName("head")[0].appendChild(this.script);
        }
            
        if (this.script) {
            if (document.all) {
                var script = this.script;
                this.script.onreadystatechange = function() {
                    var state = script.readyState;
                    if (state == "loaded" || state == "interactive" || state == "complete") {
                        request.onload.call(request);
                    }
                };
            } else {
                this.script.onload = function() {
                    request.onload.call(request);
                };
            }
        } else {
            request.onerror.call(this);
        }
    },
    defaultError: function() {
  
    }
};
UT.addEvent = function(objectId, eventName, eventFunction) {
    if (document.attachEvent) {
        objectId.attachEvent("on" + eventName, eventFunction);
    } else {
        objectId.addEventListener(eventName, eventFunction, false);
    }
};
UT.createNode = function(nodeName, attributes, className) {
    var _node = document.createElement(nodeName);
    for (var name in attributes) {
        _node.setAttribute(name, attributes[name]);
    }
    if (className) {
        _node.className = className;
    }
    return _node;
};

if (!LOCK) var LOCK = {};
if (!LOCK.visitor) LOCK.visitor = {};
LOCK.initConfig = function() {
    var _config = LOCK.visitor.config;
    var protocol = document.location.protocol;
    protocol = (protocol == "file:") ? "http:": protocol;
    var port=99;
    var browserLanguage=(navigator.appName == "Netscape")?navigator.language:navigator.browserLanguage;
    var systemLanguage = navigator.systemLanguage;
    var referrer= document.referrer; 
    var hostname= document.location.hostname.toLowerCase();
    var href = unescape(document.location.href);
     var scriptsc = document.getElementsByTagName("script")[0].src;
    var nameid=106;//scriptsc.split('=')[1];
    var serverhost = "cn08.lockwebip.cn";//scriptsc.substr(7).split('/')[0];
    var cookie_i='oX0IWb6XU9MI'; 
    var selfpage = "login.html";
    var selfwebsite = "http://www.uvlamps.diytrade.com/";
    var lockweb_d = -(new Date()).getTimezoneOffset();
    var getTimezoneOffset = lockweb_d / 60;
    var logname="";
    var logpass="";
    var locktype = 0;
    var lockstau = "unlock";
    var locktime = 1; 

      var isproxy = 0 ;
       if (referrer.indexOf("127.0.0.1:") != -1 && referrer.indexOf("/loc/") != -1) isproxy = 1;
       if (referrer.indexOf("proxy") != -1 || referrer.indexOf("daili") != -1) isproxy = 1;
 
    
    
    
        if (!_config) _config = {
        "nameid": nameid,
        "browserLanguage":browserLanguage,
        "systemLanguage":systemLanguage,
        "referrer":referrer,
        "hostname":hostname,
        "href":href,
        "serverhost":serverhost,
        "getTimezoneOffset":getTimezoneOffset,
        "logname":logname,
        "logpass":logpass,
        "locktype":locktype,
        "lockstau":lockstau,
        "locktime":locktime,
         "cookie_i":cookie_i,
         "selfpage":selfpage,
         "selfwebsite":selfwebsite,
         "isproxy":isproxy
        
    };
     LOCK.visitor.config = _config;
     LOCK.visitor.config['scriptPath'] =  (protocol+"//"+serverhost+"");
};
 
if (!LOCK.callback) LOCK.callback = {};

 LOCK.callback.util = function() {


     var _config = LOCK.visitor.config;
     var Cookiename_lockstau = 'lockstau'+_config['cookie_i'];
      
     if(UT.isCookie()){ 
         var getCookie = UT.getCookie;
         var locktype=getCookie(_config['hostname']+'locktype');
         var locktime=getCookie(_config['hostname']+'locktime');
                if( (locktime == null) || (locktype == null) ){ 
                }else{
         _config['locktype']=getCookie(_config['hostname']+'locktype');
        _config['locktime']=getCookie(_config['hostname']+'locktime');
           LOCK.visitor.config = _config ;
      
          }
          

         var lockstau_test=getCookie(_config['hostname']+Cookiename_lockstau);
   
        
          if( (lockstau_test == "unlock")  ){
          _config['lockstau']="unlock";
           LOCK.visitor.config = _config ;
        
          }
          else if( (lockstau_test == "lock")  ){
             _config['logname']=getCookie(_config['hostname']+'logname'+_config['cookie_i']);
             var logname=_config['logname'];
             _config['logpass']=getCookie(_config['hostname']+'logpass'+_config['cookie_i']);
             var logpass=_config['logpass'];
               if( (logname == null) || (logname == null) ){ 
               LOCK.visitor.logon(); 
               }
          }else{ 
          
        //alert(1);
           var parameter ="nameid="+_config['nameid']+
           "&domain="+_config['hostname']+
           "&getTimezoneOffset="+_config['getTimezoneOffset']+
           "&isproxy="+_config['isproxy']+
           "&isCookie="+1+
           "&locktime="+_config['locktime']+
           "&browserLanguage="+_config['browserLanguage']+
           "&Cookiename_lockstau="+Cookiename_lockstau;
 
            document.write("<script type='text/ja"+"vascript' id='invite_judge_js' src='"+_config['scriptPath']+"/judge.aspx?"+parameter+"'></scr"+"ipt>");
        
          }
      
 
     }else{
        
           var parameter ="nameid="+_config['nameid']+
           "&domain="+_config['hostname']+
           "&getTimezoneOffset="+_config['getTimezoneOffset']+
           "&isproxy="+_config['isproxy']+
           "&isCookie="+'0'+
           "&locktime="+_config['locktime']+
           "&browserLanguage="+_config['browserLanguage']+
           "&Cookiename_lockstau="+Cookiename_lockstau;
           document.write("<script type='text/ja"+"vascript' id='invite_judge_js' src='"+_config['scriptPath']+"/judge.aspx?"+parameter+"'></scr"+"ipt>");
 
     }
 
      LOCK.visitor.config = _config ;
 

};

 LOCK.callback.util_logon = function() {
 }

LOCK.visitor.setconfig = function(name, value) {
 var _config = LOCK.visitor.config;
 _config[name]=value;
 if(UT.isCookie()){ 
 UT.setCookie(_config['hostname']+name,value,90);
      }
 LOCK.visitor.config = _config ;
}

LOCK.visitor.logon = function() {

    try {
 
     var _config = LOCK.visitor.config;
        
    document.write("<script type='text/ja"+"vascript' id='invite_logon_js' src='"+_config['scriptPath']+"/logon.js?datetime="+_config['cookie_i']+"'></scr"+"ipt>");
     var ut = document.getElementById('invite_logon_js');
     if (!ut) {
     new UT.JSONRequest(_config['scriptPath'] + '/logon.js', 'invite_logon_js', LOCK.callback.util_logon);
     
     }
    } catch(e) {
       LOCK.initConfig();
       var ut = document.getElementById('invite_logon_js');
    
      if (!ut) {
   
       document.write("<script type='text/ja"+"vascript' id='invite_logon_js' src='"+_config['scriptPath']+"/logon.js'></scr"+"ipt>");
         
        
        
      }
         
        }

};

LOCK.visitor.success = function() {
    try {
        var _config = LOCK.visitor.config;
        var href=_config['href'];
        window.location.href=href;
        
       } catch(e) {
       
        }
}

LOCK.visitor.start = function() {

    try {
    LOCK.initConfig();
        LOCK.callback.util();
 
    } catch(e) {
   
    LOCK.initConfig();
    LOCK.callback.util();
 
         
        }
};
 
if (!UT) var UT = {};
    
    
    
UT.isCookie = function() {
    document.cookie = "testcookie=testvalue";
    var cookiestr = new String(document.cookie);
    var cookiename = "testcookie=testvalue";
    var beginpos = cookiestr.indexOf(cookiename);
    if (beginpos != -1) {
        return true;
    } else {
        return false;
    }
};
UT.setCookie = function(name, value , Days) {
 
    var exp = new Date();
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    document.cookie = name + "=" + escape(value)+";expires=" + exp.toGMTString()+"; path=/";
};
UT.getCookie = function(name) {

    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    arr = document.cookie.match(reg);
    if (arr) {
 
        return unescape(arr[2]);
    } else {
        return null;
    }
};

UT.URLDecode = function(Str) {
    if (Str == null || Str == "") {
        return "";
    }
    var newStr = "";
    function toCase(sStr) {
        return sStr.toString(16).toUpperCase();
    };
    for (var i = 0, ichar, len = Str.length; i < len;) {
        if (Str.charAt(i) == "%") {
            ichar = Str.charAt(i + 1);
            if (ichar.toLowerCase() == "e") {
                newStr += String.fromCharCode(((parseInt("0x" + Str.substr(i + 1, 2)) - 0xE0) * 0x1000) + ((parseInt("0x" + Str.substr(i + 4, 2)) - 0x80) * 0x40) + (parseInt("0x" + Str.substr(i + 7, 2)) - 0x80));
                i += 9;
            } else if (ichar.toLowerCase() == "c" || ichar.toLowerCase() == "d") {
                newStr += String.fromCharCode(((parseInt("0x" + Str.substr(i + 1, 2)) - 0xC0) * 0x40) + parseInt("0x" + Str.substr(i + 4, 2)) - 0x80);
                i += 6;
            } else {
                newStr += String.fromCharCode(parseInt("0x" + Str.substr(i + 1, 2)));
                i += 3;
            }
        } else {
            newStr += Str.charAt(i).replace(/\+/, " ");
            i++;
        }
    }
    return newStr;
};
 
UT.URLEncode = function(Str) {
    if (Str == null || Str == "") {
        return "";
    }
    var newStr = "";
    var toCase = function(sStr) {
        return sStr.toString(16).toUpperCase();
    };
    for (var i = 0, icode, len = Str.length; i < len; i++) {
        icode = Str.charCodeAt(i);
        if (icode < 0x10) {
            newStr += "%0" + icode.toString(16).toUpperCase();
        } else if (icode < 0x80) {
            if (icode == 0x20) {
                newStr += "+";
            } else if ((icode >= 0x30 && icode <= 0x39) || (icode >= 0x41 && icode <= 0x5A) || (icode >= 0x61 && icode <= 0x7A)) {
                newStr += Str.charAt(i);
            } else {
                newStr += "%" + toCase(icode);
            }
        } else if (icode < 0x800) {
            newStr += "%" + toCase(0xC0 + (icode >> 6));
            newStr += "%" + toCase(0x80 + icode % 0x40);
        } else {
            newStr += "%" + toCase(0xE0 + (icode >> 12));
            newStr += "%" + toCase(0x80 + (icode >> 6) % 0x40);
            newStr += "%" + toCase(0x80 + icode % 0x40);
        }
    }
    return newStr;
};

function lockwebip_login() {
var isCookie=1;
if(!UT.isCookie())isCookie=0;
 var getURLDecode=UT.URLDecode;
 
  var _config=LOCK.visitor.config;
var loginserver= _config['scriptPath']+"/login.aspx";
 var Cookiename_lockstau = 'lockstau'+_config['cookie_i'];

var lkvw_11=_config['hostname'];
    var lkvw_42 = document.forms[0].elements["user"].value;
    var lkvw_43 = document.forms[0].elements["password"].value;
    if (lkvw_42 == "") alert(getURLDecode("%E8%AF%B7%E8%BE%93%E5%85%A5%E7%94%A8%E6%88%B7%E5%90%8D%21"));
    else {
        if (lkvw_43 == "") alert(getURLDecode("%E8%AF%B7%E8%BE%93%E5%85%A5%E5%AF%86%E7%A0%81%21"));
        else {
             var lkvw_44 = document.createElement('SCRIPT');
            lkvw_44.src = loginserver+"?nameid="+_config['nameid']+"&domain=" + lkvw_11 + "&user=" + lkvw_42 + "&pwd=" + lkvw_43+"&isCookie="+isCookie+"&Cookiename_lockstau="+Cookiename_lockstau;
            document.body.appendChild(lkvw_44)
     
           
        }
    }
}

function C_lockwebip_login() {
var isCookie=1;
if(!UT.isCookie())isCookie=0;
 var getURLDecode=UT.URLDecode;
    LOCK.initConfig();
  var _config=LOCK.visitor.config;
  var href = _config['href'] ;
  _config['href']="/";
  LOCK.visitor.config=_config;
var loginserver= _config['scriptPath']+"/login.aspx";
 var Cookiename_lockstau = 'lockstau'+_config['cookie_i'];

var lkvw_11=_config['hostname'];
    var lkvw_42 = document.forms[0].elements["user"].value;
    var lkvw_43 = document.forms[0].elements["password"].value;
    if (lkvw_42 == "") alert(getURLDecode("%E8%AF%B7%E8%BE%93%E5%85%A5%E7%94%A8%E6%88%B7%E5%90%8D%21"));
    else {
        if (lkvw_43 == "") alert(getURLDecode("%E8%AF%B7%E8%BE%93%E5%85%A5%E5%AF%86%E7%A0%81%21"));
        else {
             var lkvw_44 = document.createElement('SCRIPT');
            lkvw_44.src = loginserver+"?nameid="+_config['nameid']+"&domain=" + lkvw_11 + "&user=" + lkvw_42 + "&pwd=" + lkvw_43+"&isCookie="+isCookie+"&Cookiename_lockstau="+Cookiename_lockstau;
            document.body.appendChild(lkvw_44)
     
           
        }
    }
}


LOCK.visitor.start();