﻿// JScript File
var t;
var g_uid = "";
var g_security = "";

function startSearch(uid, security) {
                                          
    if(t != null) {
        window.clearTimeout(t);
    }
    g_uid = uid;
    g_security = security
    
    t = window.setTimeout('DoSearch()', 600);
    
}


function DoSearch() {
    var d = new Date();
    setFocus('SearchString');
    xmlhttpPost('/licensing/GetExistingKeys.aspx?page=&pagesize=' + document.getElementById('ResultCount').value + '&LoggedInUser='+ g_uid + '&Security=' + g_security + '&dt=' +  d.getTime() + '&search='+document.getElementById('SearchString').value,'ExistingKeys');
    document.getElementById('SearchString').focus();
}

function endsWith(str, s){
	var reg = new RegExp (s + "$");
	return reg.test(str);
}