// JavaScript Document	var xmlHttp=null;
var xmlHttp=null;
	function create(){
	if(window.ActiveXObject){
	xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
	}else{
	xmlHttp=new XMLHttpRequest();
	}
	return xmlHttp;
	}
	/////////////////////////////////////////////////////////////////////////////////////////////
function send_question(today_date){
	create();//alert("hi");
	var today_date=today_date;
//alert(today_date);
var doc_subject=encodeURIComponent(document.getElementById("doc_subject").value);
		var doc_text=encodeURIComponent(document.getElementById("doc_text").value);
	var doc_sender=encodeURIComponent(document.getElementById("doc_sender").value);
if(doc_text=='')
{alert('متن سوال را وارد نمایید');
}else if(doc_sender=='')
{alert('اذرس ایمیل خود  را وارد نمایید');}
else{

		document.getElementById("send_question").innerHTML = '<img src="admin/img/ajax-loader.gif"  />';
	xmlHttp.open('GET','component/com_tamas/send_question2.php?doc_subject='+doc_subject+'&doc_text='+doc_text+'&doc_sender='+doc_sender+'&today_date='+today_date,true);
	xmlHttp.onreadystatechange=update4;
	xmlHttp.send(null);
	}}
	function update4(){
	if(xmlHttp.readyState==4){
	if(xmlHttp.status==200 ||xmlHttp.status==304)
	{
	document.getElementById("send_question").innerHTML=xmlHttp.responseText;
	 //setInterval("edit_group(group_id)",10000);
	}else{
	alert('error');
	}}}
	
///////////////////////////////////////////////////////////////////////////////////////
	function search_member(){
	create();//alert("hi");
	var search_text =encodeURIComponent( document.getElementById("search_text").value);//alert(search_text);
	document.getElementById("content").innerHTML = '<img src="admin/img/ajax-loader(3).gif"  />';
	xmlHttp.open('GET','index_center.php?search_text='+search_text,true);
	xmlHttp.onreadystatechange=u101;
	xmlHttp.send(null);
	}
	function u101(){
	if(xmlHttp.readyState==4){
	if(xmlHttp.status==200 ||xmlHttp.status==304)
	{
	document.getElementById("content").innerHTML=xmlHttp.responseText;
	
	//alert(xmlHttp.responseText);
	}else{
	alert('error');
	}}}
	/////////////////////////////////////////////////////////////////////////////////////////////

function show_detail_article(article_id,pg,lmt,gaid)
		{
		create();//alert(article_id);
		var article_id=article_id;var pg=pg;var lmt=lmt;var gaid=gaid;
		document.getElementById("article").innerHTML = '<img src="admin/img/ajax-loader(4).gif"  />';

		xmlHttp.open('GET','component/com_article/show_detail_article.php?article_id='+article_id+'&pg='+pg+'&lmt='+lmt+'&gaid='+gaid,true);
		
		xmlHttp.onreadystatechange=amn;	
		
		xmlHttp.send(null);
		}
		function amn()
		{
		if(xmlHttp.readyState==4)
		{
		if(xmlHttp.status==200 ||xmlHttp.status==304)
		{		
		//alert("hi");
		document.getElementById("article").innerHTML=xmlHttp.responseText;
		//alert(xmlHttp.responseText);
		}
		else
		{
		alert('error');
		}}}
		/////////////////////////////////////////////////////////////////////////////////////
function show_detail_news(news_id,pa,lm,gnid)
		{
		create()//;alert("hi");
		var news_id=news_id;var pa=pa;var lm=lm;var gnid=gnid;
		document.getElementById("news").innerHTML = '<img src="admin/img/ajax-loader(4).gif"  />';

		xmlHttp.open('GET','component/com_news/show_detail_news.php?news_id='+news_id+'&pa='+pa+'&lm='+lm+'&gnid='+gnid,true);
		
		xmlHttp.onreadystatechange=amn5;	
		
		xmlHttp.send(null);
		}
		function amn5()
		{
		if(xmlHttp.readyState==4)
		{
		if(xmlHttp.status==200 ||xmlHttp.status==304)
		{		
		//alert("hi");
		document.getElementById("news").innerHTML=xmlHttp.responseText;
		//alert(xmlHttp.responseText);
		}
		else
		{
		alert('error');
		}}}
	/////////////////////////////////////////////////////////////////////////////////////////////
	function show_properties(group_id){
	create();
	var group_id=group_id;//alert(product_id);alert(group_id);
document.getElementById("content").innerHTML = '<img src="images/ajax-loader(3).gif"  />';
	xmlHttp.open('GET','component/com_product/only_product_group.php?group_id='+group_id,true);//alert("hi");
	xmlHttp.onreadystatechange=uqqs;
	xmlHttp.send(null);
	}
	function uqqs(){
	if(xmlHttp.readyState==4){
	if(xmlHttp.status==200 ||xmlHttp.status==304)
	{
	document.getElementById("content").innerHTML=xmlHttp.responseText;
	}else{
	alert('error');
	}}}

