function Add(pid){
	var str1 = document.getElementById('txtComAuthor').value;
	var str2 = document.getElementById('taComment').value;
	
	if(str1 != '' && str2 != ''){
		document.forms.ComForm.bAdd.disabled=true;
		myForm = 'myPID=' + pid;
		myForm += '&myName=' + str1
		myForm += '&myComment=' + str2
	}else{
		alert('لم تعبأ جميع الحقول!');
		document.forms.ComForm.txtComAuthor.focus();
		return null;
	}

  xmlHttp=GetXmlHttpObject()
  if(xmlHttp==null){
    alert('متصفحك لا يدعم تقنية الأجاكس!');
    return;
  }
  
  xmlHttp.onreadystatechange=stateChanged;
  xmlHttp.open('POST', 'addComAjax.php', true);
  xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charest=UTF-8');
  xmlHttp.send(myForm);

} // Add Comment


function stateChanged(){
    if(xmlHttp.readyState==4){
      document.getElementById('Comment').innerHTML=xmlHttp.responseText;
    }
} // stateChanged Function


function showContent(str){
  if(str.length==0){
    document.getElementById('Comment').innerHTML='';
    return;
  }

xmlHttp=GetXmlHttpObject()
if(xmlHttp==null){
  alert('Your browser does not support AJAX!');
  return;
}
var url=str;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open('GET', url, true);
xmlHttp.send(null);
} // showContent Function


function GetXmlHttpObject(){
  var xmlHttp=null;

  try{ 
      // Firefox, Opera 8.0+, Safari 
      xmlHttp=new XMLHttpRequest();
      }

  catch (e){
    // Internet Explorer
    try{ 
        xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
        }

    catch (e) { xmlHttp=new ActiveXObject('Microsoft.XMLHTTP'); }
  }
  return xmlHttp;
} // GetXmlHttpObject Function
