var xmlHttp;
var id;
var colorwa;
var Adadesh;
var starteshA;

function showColor(warn,adadesh,startesh){
	
	colorwa = warn;
	Adadesh = adadesh;
	starteshA = startesh;
	
	
	//alert("fdfd");
	//if (warn != 1){
		
//var Mas = document.all.NasserO.value;	
//var Email = document.all.EmailFriend.value;
//var catid = document.all.catid.value;
/*
for (var counter = 0; counter < document.all.catid.length; counter++)
	{
	if (document.all.catid[counter].checked)
	var catid = document.all.catid[counter].value;

}


alert(catid);
*/
var str = "r="+(new Date().getTime()) ;

//alert(str);
id = "HmyColorNew";
//var url="AjContactUs.php?ID=" + str + "&Name=" + strname + "&Family=" + strfamily + "&Family=" + strtel + "&Email=" + stremail + "";
if (colorwa == "showPic"){
	var url="Aj_TD_Shop_Pic.php?ID="+Adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "CheckUserPass"){
	var UsernameOk = encodeURI(document.all.Username_L.value);
	var PasswordOk = encodeURI(document.all.Password_L.value);
	//var CokRemindOk = encodeURI(document.all.CokRemind.value);
	//alert(UsernameOk);
	var url="Check.php?Username="+UsernameOk+'&Password='+PasswordOk+'&r='+(new Date().getTime());

}

else if (colorwa == "Delete_ItemBasket"){

	//alert(CokRemindOk);
	var url="Delete_Item_Basket.php?ID="+Adadesh+'&r='+(new Date().getTime());
}
else if (colorwa == "AllProduct"){
	var url="Aj_TD_ShopViewByFolder.php?ID="+adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "AllProductHaraji"){
	var url="Aj_TD_ShopViewByFolderHaraji.php?ID="+adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "viewBySubfolder"){
	//alert(starteshA);
	var url="Aj_TD_ShopViewBySubFolderok.php?IDSUB="+adadesh+'&IDFOL='+starteshA+'&r='+(new Date().getTime());
}
else if (colorwa == "viewBySubfolderHaraji"){
	//alert('sdd');
	var url="a_TD _viewBySubfolderHaraji.php?IDSUB="+adadesh+'&IDFOL='+starteshA+'&r='+(new Date().getTime());
}

else if (colorwa == "Send_Email"){
	//alert('sdd');
	var myNameMahsool = document.all.NameMahsool.value;
	var myID = document.all.id.value;
	var myEmail = document.all.Email.value;
	var myMobile = encodeURI(document.all.Mobile.value);
	var myText = encodeURI(document.all.Re_Tex.value);
	
	var url="a_TD _SendEmail.php?Email="+adadesh+'&Mobile='+starteshA+'&myTex='+myText+'&Id='+myID+'&Namem='+myNameMahsool+'&r='+(new Date().getTime());
}


else if (colorwa == "viewSubFolderSearch"){
	
	var mychoice = document.all.ShakheMah;
    var myshakheh = encodeURI(mychoice.options[mychoice.selectedIndex].value);	
    
  //  if (myshakheh != 'All'){
   
   // alert(myshakheh);
	var url="Aj_TD_viewSubFolderSearch.php?ID="+myshakheh+'&r='+(new Date().getTime());
   // }
}
else if (colorwa == "sendToShoppingok"){
	

	var myEmailok = document.all.Email.value;
	var myNameok = encodeURI(document.all.Name.value);
	var myPriceok = document.all.Price.value;
	var myDetailsok = encodeURI(document.all.Details.value);
	
	var mychoice44 = document.all.Send_Folder;
    var myshakhehFolder = encodeURI(mychoice44.options[mychoice44.selectedIndex].value);	
    if (document.all.Send_SubFolder.value != ''){
    var mychoice55 = document.all.Send_SubFolder;
    var myshakhehSub = encodeURI(mychoice55.options[mychoice55.selectedIndex].value);	
    }
   
	var url="Aj_TD_sendToShoppingok.php?Email="+myEmailok+'&Name='+myNameok+'&Price='+myPriceok+'&Detail='+myDetailsok+'&Folder='+myshakhehFolder+'&Sub='+myshakhehSub+'&r='+(new Date().getTime());
}


else if (colorwa == "ListSubFolders"){
	

	var mychoirce = document.all.Send_Folder;
    var myshakhehak = encodeURI(mychoirce.options[mychoirce.selectedIndex].value);	
   
   
	var url="Aj_TD_sendSubFolders.php?Folder="+myshakhehak+'&r='+(new Date().getTime());
}

else if (colorwa == "ListNo"){
	
	var url="Aj_TD_ListNo.php?Folder="+Adadesh+'&r='+(new Date().getTime());
}



else if (colorwa == "AllFolder"){
	var url="Aj_TD_ShopIndex.php?r="+(new Date().getTime());
}

else if (colorwa == "AllFolderHaraji"){
	var url="Aj_TD_ShopIndexHaraji.php?r="+(new Date().getTime());
}

else if (colorwa == "Jadidha"){
	var url="Aj_TD_ShopNew.php?ID="+adadesh+'&r='+(new Date().getTime());
}
else if (colorwa == "JadidhaHaraji"){
	var url="Aj_TD_ShopNewHaraji.php?ID="+adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "Arzan"){
	var url="Aj_TD_Arzan.php?ID="+adadesh+'&r='+(new Date().getTime());
}
else if (colorwa == "ArzanHaraji"){
	var url="Aj_TD_ArzanHaraji.php?ID="+adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "Geran"){
	var url="Aj_TD_Geran.php?ID="+adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "GeranHaraji"){
	var url="Aj_TD_GeranHaraji.php?ID="+adadesh+'&r='+(new Date().getTime());
}

else if (colorwa == "maxview"){
	var url="Aj_TD_maxview.php?ID="+adadesh+'&r='+(new Date().getTime());
}
else if (colorwa == "maxviewHaraji"){
	var url="Aj_TD_maxviewHaraji.php?ID="+adadesh+'&r='+(new Date().getTime());
}


else if (colorwa == "Comment"){
	var myEmail = document.all.Email.value;	
	var myName = encodeURI(document.all.Name.value);	
	var myTozihat = encodeURI(document.all.Tozihat.value);	
	var myiddl = document.all.iddl.value;
	//var okstart = document.all.start.value;	
	var myStart = "2";
	
	var url="Aj_TD_Comment.php?iddl="+Adadesh+"&Name="+myName+"&Email="+myEmail+"&Tozihat="+myTozihat+"&start="+starteshA+"&myStart="+myStart+'&r='+(new Date().getTime());
}else if (colorwa == "CommentPagination"){
	var myEmail = document.all.Email.value;	
	var myName = encodeURI(document.all.Name.value);	
	var myTozihat = encodeURI(document.all.Tozihat.value);	
	var myiddl = document.all.iddl.value;
	//var okstart = document.all.start.value;	
	var myStart = "2";
	
	var url="aj_CommentPagination.php?iddl="+Adadesh+"&Name="+myName+"&Email="+myEmail+"&Tozihat="+myTozihat+"&start="+starteshA+"&myStart="+myStart+'&r='+(new Date().getTime());

	
	
	
	
	}else if (colorwa == "ViewResultSearch"){
		
	//	 alert("dffd");
	var myNameNs = encodeURI(document.all.NoSearch.value);
	 	
	var mychoiceno = document.all.NoeMahsool;
	//alert("dffd"+mychoiceno.selectedIndex);
	if (mychoiceno.selectedIndex >=  0){
    	var mynoemahsool = encodeURI(mychoiceno.options[mychoiceno.selectedIndex].value);	
	}else{
		var mynoemahsool = '';
	}
    var mychoiceshakhe = document.all.ShakheMah;
    var myshakhes = encodeURI(mychoiceshakhe.options[mychoiceshakhe.selectedIndex].value);	
    
   // alert(myshakhes);
	var url="Aj_TD_ViewResult.php?Noe="+mynoemahsool+'&Names='+myNameNs+'&folder='+myshakhes+'&r='+(new Date().getTime());
	
	
	}else if (colorwa == "ViewResultSearchHaraji"){
		
	//	 alert("dffd");
	var myNameNs = encodeURI(document.all.NoSearch.value);
	 	
	var mychoiceno = document.all.NoeMahsool;
	//alert("dffd"+mychoiceno.selectedIndex);
	if (mychoiceno.selectedIndex >=  0){
    	var mynoemahsool = encodeURI(mychoiceno.options[mychoiceno.selectedIndex].value);	
	}else{
		var mynoemahsool = '';
	}
    var mychoiceshakhe = document.all.ShakheMah;
    var myshakhes = encodeURI(mychoiceshakhe.options[mychoiceshakhe.selectedIndex].value);	
    
   // alert(myshakhes);
	var url="Aj_TD_ViewResultHaraji.php?Noe="+mynoemahsool+'&Names='+myNameNs+'&folder='+myshakhes+'&r='+(new Date().getTime());
	

}else if (colorwa == "help"){
	var url="Aj_TD_Download_help.php?ID="+Adadesh+'&r='+(new Date().getTime());
	
	}else if (colorwa == "SendPRODUCT"){
		var myEmail012 = encodeURI(document.all.Email.value);
		var myName012 = encodeURI(document.all.Name.value);
		var myPrice012 = document.all.Price.value;
		var myDetails012 = encodeURI(document.all.Details.value);
		
		var myPic012 = document.all.Pic.value;
		
		
	//var mychoiceno = document.all.NoeMahsool;
    //var mynoemahsool = mychoiceno.options[mychoiceno.selectedIndex].value;	
    
    //alert(myPic012);
	var url="Aj_TD_SendPRODUCT.php?Email="+myEmail012+'&Name='+myName012+'&Price='+myPrice012+'&Detail='+myDetails012+'&Pic='+myPic012+'&r='+(new Date().getTime());

	
	
}else if (colorwa == "SearchByName"){
	var mySearchName = encodeURI(document.all.Download_Soft_Name.value);
	var mychoice = document.all.Download_Folder;
    var myshakheh = encodeURI(mychoice.options[mychoice.selectedIndex].value);	
	var url="Aj_TD_Search.php?myNameSearch="+mySearchName+"&myshakheh="+myshakheh+'&r='+(new Date().getTime());
}else{
var url="Aj_TD_Download.php?ID="+Adadesh+'&r='+(new Date().getTime());
}
xmlHttp=GetXmlHttpObject(stateChanged);
xmlHttp.open("POST", url , true);
//xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlHttp.setRequestHeader("enctype", "multipart/form-data"); 
xmlHttp.send(str);
}
//********** Methode Get mishe
//xmlHttp.open("GET", url , true);
// xml.http.send(null);
//}

function stateChanged() 
{ 
if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
{	
	if (colorwa == "CheckUserPass"){
		document.getElementById('Natije').innerHTML="<p align='center'><img src='ajax-loader2.gif'></p>";
	}
	
	if (colorwa == "Delete_ItemBasket"){
			document.getElementById('TableBaskete').innerHTML="<p align='center'><img src='ajax-loader2.gif'></p>";
	}
	if (colorwa == "DetailDl"){
		document.getElementById('DetailDl').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "DetailD2"){
		document.getElementById('DetailD2').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "DetailD3"){
		document.getElementById('DetailD3').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "DetailD4"){
		document.getElementById('DetailD4').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "ViewByFolder"){
		document.getElementById('MAINTD').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "ViewByArchive"){
	document.getElementById('MAINTD').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	}
	if (colorwa == "SearchByName"){
		document.getElementById('MAINTD').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	 if (colorwa == "Jadidha"){
	 		document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	 }
	 if (colorwa == "JadidhaHaraji"){
	 		document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	 }
	else if (colorwa == "Arzan"){
		  document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	}
	else if (colorwa == "ArzanHaraji"){
		  document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	}
	else if (colorwa == "maxview"){
		  document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	}
	else if (colorwa == "maxviewHaraji"){
		  document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	}
	
	else if (colorwa == "viewBySubfolder"){
				  document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	}
	if (colorwa == "viewBySubfolderHaraji"){
				  document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";	
	
	}
	if (colorwa == "myUpdateNumbers"){
		var Esm = "DComment"+starteshA;
		var Esm2="DCommentt"+starteshA;
	document.getElementById(Esm).innerHTML="<img src='../ajax-loader2.gif'>";
	document.getElementById(Esm2).innerHTML="<img src='../ajax-loader2.gif'>";	
	}
	if (colorwa == "Comment"){
		document.getElementById('CommentMess').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
		document.getElementById('CommentView').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "showPic"){
	document.getElementById('MainTBLDETAIL').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
}
if (colorwa == "AllProduct"){
		document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "AllProductHaraji"){
		document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "ViewResultSearch"){
				document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "ViewResultSearchHaraji"){
				document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	if (colorwa == "AllFolder"){
			document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	
	}
	if (colorwa == "AllFolderHaraji"){
			document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	
	}
	if (colorwa == "Geran"){
			document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	
	}
	if (colorwa == "GeranHaraji"){
			document.getElementById('TableMain').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	
	}
	
	if (colorwa == "ListSubFolders"){
			document.getElementById('SubFoDIV').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	
	}
	if (colorwa == "sendToShoppingok"){
					document.getElementById('Send_Product').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	
	if (colorwa == "viewSubFolderSearch"){
					document.getElementById('noemahsoolDIV').innerHTML="<p align='right'><img src='../ajax-loader2.gif'></p>";
	}
	 if (colorwa == "Send_Email"){
	 	document.getElementById('Send_Email').innerHTML="<p align='center'><img src='../ajax-loader2.gif'></p>";
	 }
	 	if (colorwa == "soorati"){
	var url="CheckUsername.php&r="+(new Date().getTime());
}
if (colorwa == "ghermez"){
	var url="CheckUsername.php&r="+(new Date().getTime());
}
if (colorwa == "abi"){
	var url="CheckUsername.php&r="+(new Date().getTime());
}
if (colorwa == "khakestari"){
		var url="CheckUsername.php&r="+(new Date().getTime());
	}
	if (colorwa == "sabz"){
		var url="CheckUsername.php&r="+(new Date().getTime());
	}

	if (colorwa == "viewSubFolderSearch"){
		document.getElementById('noemahsoolDIV').innerHTML="<p align='center'><img src='../ajax-loader2.gif'></p>";
	}
	
	if (colorwa == "ListNo"){
		document.getElementById('NOShow').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
	}
	//document.all.search0.disabled= true;
//document.getElementById(id).innerHTML="Please Wait ..." ;
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
	
	if (colorwa == "ListNo"){
		document.getElementById('NOShow').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "CheckUserPass"){
		//alert(xmlHttp.responseText);
		if (xmlHttp.responseText == "NOWrong"){
			alert("نام کاربري يا کلمه عبور وارد شده صحيح نمي باشد");
			document.getElementById('Natije').innerHTML="";
		}
		if (xmlHttp.responseText == "YESCorrect"){
			//document.getElementById('Natije').innerHTML="<p align='right'><img src='../ajax-loader2.gif'><font face='tahoma' size='2'>لطفا كمي صبر نماييد </font></p>";
			displayMessage3('includes/send_toShopping.php?Rd='+(new Date().getTime()));//return false
			//document.forms["FriendForm"].submit( );
		}
		
	}
	
	if (colorwa == "Delete_ItemBasket"){
			document.getElementById('TableBaskete').innerHTML=xmlHttp.responseText ;
	}
	
	 if (colorwa == "Send_Email"){
	 	document.getElementById('Send_Email').innerHTML=xmlHttp.responseText ;
	 	document.all.B1.disabled= true;
	 }
	 
	//document.all.search0.disabled= false;
	if (colorwa == "sendToShoppingok"){
		document.getElementById('Send_Product').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "soorati"){
	document.getElementById("myTD").style.backgroundImage = "url('../images/back_tram/line_soorati.jpg')";
	document.body.style.backgroundColor = "#FFEAEA";
	}
	if (colorwa == "ghermez"){
	document.getElementById("myTD").style.backgroundImage = "url('../images/back_tram/line_banafsh.jpg')";
	document.body.style.backgroundColor = "#FFDDFF";
	}
	if (colorwa == "abi"){
	document.getElementById("myTD").style.backgroundImage = "url('../images/back_tram/line_blue.jpg')";
	document.body.style.backgroundColor = "#EBEBF5";
	}
	
	if (colorwa == "khakestari"){
		document.getElementById("myTD").style.backgroundImage = "url('../images/back_tram/line_khakestari.jpg')";
	document.body.style.backgroundColor = "#F2F2F2";
	}
	if (colorwa == "sabz"){
		document.getElementById("myTD").style.backgroundImage = "url('../images/back_tram/line_sabz.jpg')";
	document.body.style.backgroundColor = "#EAFFEA";
	}
	
	
	if (colorwa == "DetailDl1"){
	document.getElementById('DetailDl1').innerHTML=xmlHttp.responseText ;
	//document.getElementById('DetailLast').style.visibility="hidden" ;
	//document.getElementById('DetailLast').style.position= "absolute";
	//document.getElementById("ShoppingLast").style.position = "relative";
	//document.getElementById("ShoppingLast").style.visibility = "visible";
	
	}
	if (colorwa == "viewSubFolderSearch"){
		document.getElementById('noemahsoolDIV').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "Jadidha"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "JadidhaHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "AllFolder"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "AllFolderHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "AllProduct"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "AllProductHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "SendPRODUCT"){
		document.getElementById('Send_Product').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "ViewResultSearch"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "ViewResultSearchHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "maxview"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "maxviewHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "Arzan"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "ArzanHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "Geran"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "GeranHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "viewBySubfolder"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "viewBySubfolderHaraji"){
		document.getElementById('TableMain').innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "ListSubFolders"){
		document.getElementById('SubFoDIV').innerHTML=xmlHttp.responseText ;
		
		var myshakhes = encodeURI(document.all.Send_Folder.options[document.all.Send_Folder.selectedIndex].value);
		showColor('ListNo',myshakhes);
	}
	if (colorwa == "showPic"){
		//document.getElementByTagName('select').style.visibility="hidden";
		//document.getElementById('D2').style.visibility="hidden";
		//closeMessage();
		//document.getElementById('MainTBLDETAIL').style.visibility="visible";
	document.getElementById('MainTBLDETAIL').innerHTML=xmlHttp.responseText ;
}

	if (colorwa == "DetailDl2"){
	document.getElementById('DetailDl2').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "DetailDl3"){
	document.getElementById('DetailDl3').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "DetailDl4"){
	document.getElementById('DetailDl4').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "myUpdateNumbers"){
		var Esm = "DComment"+starteshA;
		var Esm2="DCommentt"+starteshA;
		//alert(Esm);
		document.getElementById(Esm).innerHTML=xmlHttp.responseText ;
		document.getElementById(Esm2).innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "ViewByFolder"){
		document.getElementById('MAINTD').style.visibility= "visible";
		document.getElementById('MAINTD').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "ViewByArchive"){
		document.getElementById('MAINTD').style.visibility= "visible";
		document.getElementById('MAINTD').innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "SearchByName"){
		document.getElementById('MAINTD').style.visibility= "visible";
		document.getElementById('MAINTD').innerHTML=xmlHttp.responseText ;
	}
	if (colorwa == "help"){
		document.getElementById('JAVASCRI').innerHTML=xmlHttp.responseText ;
	}
	
	if (colorwa == "Comment"){
		document.all.B1.disabled= true;
		
		Myresponse = xmlHttp.responseText ;
		//alert(response)
update = Myresponse.split('<UserazMatnJodaShod>');
//document.getElementById(id).innerHTML = update [0];

		document.getElementById('CommentMess').innerHTML=update [0];
		document.getElementById('CommentView').innerHTML=update [1];
	}
	if (colorwa == "CommentPagination"){
		document.getElementById('CommentView').innerHTML=xmlHttp.responseText;
	}
	
}
} 

function GetXmlHttpObject(handler){ 

var objXmlHttp=null;
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") ;
return ;
}

if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP";
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP";
} 
try
{
objXmlHttp=new ActiveXObject(strName);
objXmlHttp.onreadystatechange=handler ;
return objXmlHttp;
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled");
return;
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest();
objXmlHttp.onload=handler;
objXmlHttp.onerror=handler;
return objXmlHttp;
}
}
