function showReply(ls_type, ls_id) {
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	}else{// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            if(ls_type == 0) {
                var divname = "re_list_"+ls_id;
                var ext = "<a href=\"javascript:void(0);\" onclick=\"document.getElementById('"+divname+"').innerHTML='';\">-收起回复</a>";
            }
            if(ls_type == 2) {
                var divname = "re_form_"+ls_id;
                var ext = "";
            }
            document.getElementById(divname).innerHTML = xmlhttp.responseText+ext;
        }
    }
    var url = "/run/reply/" + ls_type + "/" + ls_id;
    xmlhttp.open("GET",url,true);
    xmlhttp.send();
}

function submitReply(form){
    if(window.XMLHttpRequest){
        xmlhttp=new XMLHttpRequest();
    }else{
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            window.location.reload(false);
        }
    }
    
    var url = form.action + "?content=" + form.content.value;
    xmlhttp.open("POST",url,true);
    xmlhttp.send();
}

function showContact(url, divname) {
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }else{// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById(divname).innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send();
}

function switchDisplay(divname) {
    if (document.getElementById(divname).style.display != "block")
        document.getElementById(divname).style.display = "block";
    else
        document.getElementById(divname).style.display = "none";
}


