var myAjax = ajax();
function ajax() {
        var ajax = null;
        if (window.XMLHttpRequest) {
                try {
                        ajax = new XMLHttpRequest();
                }
                catch(e) {}
        }
        else if (window.ActiveXObject) {
                try {
                        ajax = new ActiveXObject("Msxm12.XMLHTTP");
                }
                catch (e){
                        try{
                                ajax = new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        catch (e) {}
                }
        }
        return ajax;
}
function request(str) {
	//Don't forget to modify the path according to your theme
		document.getElementById('tag_update').innerHTML = "<ul><li><i><font color=#aaaaaa>Wait Loading...</font></i> </li></ul>";
        myAjax.open("POST", "wp-content/themes/khaslog1/gettags.php");
        myAjax.onreadystatechange = result;
        myAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        myAjax.send("search="+str);
}

function name(str) {
	//Don't forget to modify the path according to your theme
		document.getElementById('tag_update').innerHTML = "<ul><li><i><font color=#aaaaaa>Wait Loading...</font></i> </li></ul>";
        myAjax.open("POST", "wp-content/themes/khaslog1/name.php");
        myAjax.onreadystatechange = result;
        myAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        myAjax.send("name="+str);
}
function description(str) {
	//Don't forget to modify the path according to your theme
		document.getElementById('tag_update').innerHTML = "<ul><li><i><font color=#aaaaaa>Wait Loading...</font></i> </li></ul>";
        myAjax.open("POST", "wp-content/themes/khaslog1/description.php");
        myAjax.onreadystatechange = result;
        myAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        myAjax.send("description="+str);
}
function result() {
        if (myAjax.readyState == 4) {
                var liste = myAjax.responseText;
                var cible = document.getElementById('tag_update').innerHTML = liste;
                document.getElementById('tag_update').style.display = "block";
        }
}
function selected(choice){
        var cible = document.getElementById('s');
        cible.value = choice;
        document.getElementById('tag_update').style.display = "none";
}

function close_tag(){
		document.getElementById('tag_update').style.display = "none";
}