function ajax_do(thisurl){
document.getElementById("alert_box").style.display='';
    var xmlhttp=false;

 /*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } 
catch (E) 
{ xmlhttp = false; }
}
@end @*/

    if(!xmlhttp) { xmlhttp=new XMLHttpRequest(); }
    xmlhttp.open('GET',thisurl, true);
    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState==4) { 
        document.getElementById('mybody').innerHTML = xmlhttp.responseText; 
document.getElementById("alert_box").style.display='none';		
 }
    }
    xmlhttp.send(null);
}
 
 function find(){
 find_word = encodeURIComponent(document.getElementById("search").value);
  ajax_do('search.php?q='+find_word);
 }
 
 
 function openWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
  }

function ajax_do_comment(thisurl){
document.getElementById("alert_box").style.display='';
    var xmlhttp=false;

 /*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } 
catch (E) 
{ xmlhttp = false; }
}
@end @*/

    if(!xmlhttp) { xmlhttp=new XMLHttpRequest(); }
    xmlhttp.open('GET',thisurl, true);
    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState==4) { 
        document.getElementById("body_com").value=" "
        document.getElementById('alert').innerHTML = "&#1606;&#1592;&#1585; &#1588;&#1605;&#1575; &#1576;&#1575; &#1605;&#1608;&#1601;&#1602;&#1610;&#1578; &#1579;&#1576;&#1578; &#1588;&#1583;."; 

document.getElementById("alert_box").style.display='none';		
 }
    }
    xmlhttp.send(null);
}

function find_comment(){
 find_name = encodeURIComponent(document.getElementById("name").value);
 find_email = encodeURIComponent(document.getElementById("email").value);
 find_body = encodeURIComponent(document.getElementById("body_com").value);
 find_arid = encodeURIComponent(document.getElementById("ar_id").value); 
 ajax_do_comment('add_comment.php?name='+find_name+'&email='+find_email+'&body='+find_body+'&id_ar='+find_arid);
 }
 
 function find_comment_index(){
 find_name = encodeURIComponent(document.getElementById("name").value);
 find_email = encodeURIComponent(document.getElementById("email").value);
 find_body = encodeURIComponent(document.getElementById("body_com").value);
  ajax_do_comment('add_comment_index.php?name='+find_name+'&email='+find_email+'&body='+find_body);
 }
