var xmlHttp 

function vote_now(id)
{
	//	mt='mail_Men'+id;
	//	alert(mt);
		
	//	document.(mt).submit();
	
	//document.(mt).submit();
	if(id==1)
	   document.mail_Men1.submit();
	else if(id==2)   
	   document.mail_Men2.submit();
	else if(id==3)   
	document.mail_Men3.submit();
	
}

function test(){
location='#hom';
}


function mamamam()
{
	if((document.mail_M2.mail_.value.indexOf("@")==-1)||(document.mail_M2.mail_.value.indexOf(".")==-1)){
		document.mail_M2.mail_.value="";
		alert('صيغة الايميل غير صحيحة');
	}else
	{
document.mail_M2.submit();
	}
}



function view_res(idm)
{
/*var popup = window.createPopup()
var popupBody = popup.document.body;
popupBody.style.border = "solid 2px black";
popupBody.style.padding = "5px";
popupBody.innerHTML = "<P>Here is some text in a popup window</P>";
popup.show(200,100, 200, 50, document.body);
*/
var subWindow = window.open("vote_result.php?id="+idm+"&lang=ar","def","HEIGHT=300,WIDTH=600");
}


function findMok()
{
/*	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','Functions.php?id='+sendBy.value+'&action='+id);
    if(id=='1')//for update
	{
		xmlHttp.onreadystatechange = handleViewDet1;
	}
	xmlHttp.send(null);*/
	
//	alert('hello');
	
	document.form1.submit();
	
/*	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','function_Services.php?id='+document.form1.Categ.value);
	xmlHttp.onreadystatechange = handleViewDetails;
	xmlHttp.send(null);
	*/

}

function sendComplaint()
{
	
//	alert('HHHHHHHHH');
	if(document.form1.compl.value.length>300||document.form1.compl.value.length<2)
	{
		alert(' طول الشكوى محدد ب 300 محرف على الأكثر ومحرفين على الأقل');
		document.form1.compl.value='';
		return;
	}
	
	if((document.form1.email.value.indexOf("@")==-1)||(document.form1.email.value.indexOf(".")==-1)){
		document.form1.email.value="";
		alert('صيغة الايميل غير صحيحة');
		return;
	}
	
	if(document.form1.nam.value.length<2)
	{
			alert('يجب إدخال عنوان الشكوى');
		return;
		}
	
	document.form1.submit();
	
	
	
}


function tt()
{
	alert('aaaa');
}

function backToSearch(val)
{
	//alert(document.seart.sear.value);
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions/searchFunctions.php?id='+val+'&seartM='+document.seart.sear.value+'&lang=ar');
	xmlHttp.onreadystatechange = handleSearch;
	xmlHttp.send(null);

}


function doLogin()
{
	if((document.login.usr.value=='')||(document.login.pwd.value=='')){
	alert('يرجى ادخال اسم مستخدم وكلمة مرور!');
	}else{
	document.login.submit();
	}
}

function doLogout()
{
	document.login.submit();
}

function findSTU()
{
	document.form1.submit();
}

function changeCat(sendBy,id,catt)
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions/photoFunction.php?id='+sendBy.value+'&action='+id+'&cat='+catt);
    if(id=='1')//for update
	{
		xmlHttp.onreadystatechange = handleChangeCat;
	}
	xmlHttp.send(null);
}

function handleChangeCat()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewPhoto').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'>wait...</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewPhoto').innerHTML = response;
	}
}


function findRE()
{
	if(document.search.searchT.value.length<2)
	{
		alert('يجب إدخال كلمة البحث');
		return;
	}
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions/searchFunctions.php?id='+document.search.searchT.value+'&lang='+document.search.lang.value);
	xmlHttp.onreadystatechange = handleSearch;
	xmlHttp.send(null);
	document.search.searchT.value='';
	location='#search_body2';
}


function handleSearch()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('search_RES_').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'>wait...</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('search_RES_').innerHTML = response;
	}
}


function doChangeRadio(sendBy,id)
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions/studentFunctions.php?id='+sendBy.value+'&action='+id);
    if(id=='1')//for update
	{
		xmlHttp.onreadystatechange = handleChangeTech_;
	}
	xmlHttp.send(null);
}

function handleChangeTech_()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('subj').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'>wait...</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('subj').innerHTML = response;
	}
}



/*function createRequestObject()
{
	var request_;
	var browser = navigator.appName;

	if(browser == "Microsoft Internet Explorer")
	{
		request_ = new ActiveXObject("Microsoft.XMLHTTP");
	}

	else request_ = new XMLHttpRequest();

	return request_;
}*/

/*
function viewDetails()//this function is used to  to view completed data about edit company
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','viewFunctions.php?id='+document.selectCategForm.Categ.value);
	xmlHttp.onreadystatechange = handleViewDetails;
	xmlHttp.send(null);
}

function handleViewDetails()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('updateInfo').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('updateInfo').innerHTML = response;
	}
}

function cho()//change the attachments type 
{
	xmlHttp=GetXmlHttpObject();
	var rad_val='';
	for (var i=0; i < document.form1cat.InV.length; i++)
    {
     if (document.form1cat.InV[i].checked)
      {
       rad_val = document.form1cat.InV[i].value;
       }
    }

	if(rad_val=='1')//pdf
	{
	//	alert('ddddddddd');
	xmlHttp.open('get','functions.php?Prod2PDF='+document.form1cat.catPP.value);	
	}
	else if(rad_val=='2')//photo
	{
		xmlHttp.open('get','functions.php?Prod2PHOTO='+document.form1cat.catPP.value);
	}
	else if(rad_val=='3')//traffic
	{
		xmlHttp.open('get','functions.php?Prod2Traffic='+document.form1cat.catPP.value);
	}
	else if(rad_val=='4')//video
	{
		xmlHttp.open('get','functions.php?Prod2Video='+document.form1cat.catPP.value);
	}
	xmlHttp.onreadystatechange = choHandle;
	xmlHttp.send(null);
}
function choHandle()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('Find_Link').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('Find_Link').innerHTML = response;
	}
}

function StartApp()
{
	//"INV1"
	if ((!document.person.INV1[0].checked)&&(!document.person.INV1[1].checked))
	{
	alert("الرجاء الإجابة على جميع الأسئلة");
		  return;	
	}
	
	var ques= new Array(document.person.age,document.person.degree3,document.person.compute3,document.person.degre,document.person.exp3,document.person.knowledge);
	var s=1;
	var i=1;
	for (i=0; i < ques.length; i++)
    {
		//alert(ques[i][1].name);
		s=s+1;
		//alert(s);
	 if ((!ques[i][0].checked)&&(!ques[i][1].checked)&&(!ques[i][2].checked))
      {
		 // var s=i+1;
		  alert("الرجاء الإجابة على السؤال رقم  "+s);
		  return;
       //rad_val = document.form1cat.InV[i].value;
	   //document.form1cat.InV.length
    
	   }
    }
		   document.person.submit();
}

function goToSecond()
{
	var ques= new Array(document.page1.q1,document.page1.q2,document.page1.q3,document.page1.q4,document.page1.q5,document.page1.q6,document.page1.q7,document.page1.q8,document.page1.q9,document.page1.q10,document.page1.q11);
	var s=0;
	for (var i=0; i < ques.length; i++)
    {
		s=s+1;
     if ((!ques[i][0].checked)&&(!ques[i][1].checked)&&(!ques[i][2].checked)&&(!ques[i][3].checked)&&(!ques[i][4].checked))
      {
		  
		  alert("الرجاء الإجابة على السؤال رقم  "+s);
		  return;
       //rad_val = document.form1cat.InV[i].value;
	   //document.form1cat.InV.length
       } 
    }
	document.page1.submit();
}

function goToThird()
{
	var ques= new Array(document.page2.q1,document.page2.q2,document.page2.q3,document.page2.q4,document.page2.q5,document.page2.q6,document.page2.q7,document.page2.q8,document.page2.q9,document.page2.q10);
	var s=0;
	for (var i=0; i < ques.length; i++)
    {
		s=s+1;
     if ((!ques[i][0].checked)&&(!ques[i][1].checked)&&(!ques[i][2].checked)&&(!ques[i][3].checked)&&(!ques[i][4].checked))
      {
		  alert("الرجاء الإجابة على السؤال رقم  "+s);
		  return;
       //rad_val = document.form1cat.InV[i].value;
	   //document.form1cat.InV.length
       }
    }
	   document.page2.submit();
}

function confirmAns()
{
	var ques= new Array(document.page3.q1,document.page3.q2,document.page3.q3,document.page3.q4,document.page3.q5,document.page3.q6,document.page3.q7,document.page3.q8,document.page3.q9,document.page3.q10,document.page3.q11);
	var s=0;
	for (var i=0; i < ques.length; i++)
    {
		s=s+1;
     if ((!ques[i][0].checked)&&(!ques[i][1].checked)&&(!ques[i][2].checked)&&(!ques[i][3].checked)&&(!ques[i][4].checked))
      {
		  alert("الرجاء الإجابة على السؤال رقم  "+s);
		  return;
       //rad_val = document.form1cat.InV[i].value;
	   //document.form1cat.InV.length
       } 
    }
	document.page3.submit();
}
/*
function checkPWD()
{
   if(document.changePWD.newpwd.value=='')
	{
	alert('you cannot enter empty password');
	}
	else if(document.changePWD.newpwd.value.length <4)
	{
	alert('you cannot enter password less than 5 charcter');
	}
	else if(document.changePWD.newpwd.value!=document.changePWD.newpwd2.value)
	{
		alert('enter the password twice');
	}
	else
	{
    	document.changePWD.submit();
	}
}

function plus()//this function is used to  increase company order in insert company
{
	document.form1.ord.value++;
}

function Menus22()// this function i s used to decrease order in insert company
{
	document.form1.ord.value--;
}


function plusEdit()// this is used to increase and company order in modify mode
{
	document.form12.ordEdit.value++;
}

function Menus22Edit()// this is used to increase and company order in modify mode
{
	document.form12.ordEdit.value--;
}
//*******       HERE IS PLUS AND MINUS OF PAGE ORDER                  *****/
/*
function plusPageOrder()//this function is used to  increase page order in insert page
{
	document.form1.ord.value++;
}

function Menus22PageOrder()// this function i s used to decrease order in insert page
{
	document.form1.ord.value--;
}


function plusPageOrderEdit()//this function is used to  increase page order in update page
{
	document.updatePage.ord.value++;
}

function Menus22PageOrderEdit()// this function i s used to decrease order in update page
{
	document.updatePage.ord.value--;
}

function handlePageOrderEdit()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('Page_Order_Update').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('Page_Order_Update').innerHTML = response;
	}
}


function AddCategory()//this is a validation for add category
{
	 if(document.form1.catNam.value=='')
	{
	alert('you cannot enter empty category Name');
	}
	else
	{
		document.form1.submit();
	}
}
function DelCate()//deleet company
{
	answer=confirm('are you sure you want to delete this category and all contained products videos,photos and PDF files ..?!')
	 if(answer!=0)
	{
	  document.delete2.submit();
	}
}

function validAddPage()//add page
{
	if(document.form1.pageName.value=='')
	{
	alert('you cannot enter empty Page Name');
	}
	else
	{
		document.form1.submit();
	}
}
function delProo()//delete page
{
	answer=confirm('are you sure you want to delete this product and all it s attachments ?!')
	 if(answer!=0)
	{
	  document.deletPro.submit();
	}
}

function viewNewsDetail()//this when u choose category all the news related with this category is filled in the bottom list
{
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','NewsData.php?newsID='+document.selectNewsForm.Newses.value);
	xmlHttp.onreadystatechange = handleViewNewsDetails;
	xmlHttp.send(null);
	}
	function handleViewNewsDetails()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('updateInfo').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('updateInfo').innerHTML = response;
	}
		}
		
		
		function removeNewsPhoto()//remove photo from the Product
{
    xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?prodPhotoId='+document.updateNews.compad.value);
	document.updateNews.compad.value=-1;
	xmlHttp.onreadystatechange = handleRemoveNewsPhoto;
	xmlHttp.send(null);

	}
	function handleRemoveNewsPhoto()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('NewsLogo').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('NewsLogo').innerHTML = response;
	}
		}
		
		
		function removeNewsPhotoProd()//remove photo from the Product
{
    xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?prodPhotoIdProd='+document.updateProd.compad.value);
	document.updateProd.compad.value=-1;
	xmlHttp.onreadystatechange = handleRemoveNewsPhoto;
	xmlHttp.send(null);

	}
	function handleRemoveNewsPhoto()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('NewsLogo').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('NewsLogo').innerHTML = response;
	}
		}
		
		
		
		
		
		function viewProd2Del()//fill the menue to choose the news u want 2 delete
		{
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?catdel5='+document.selectNewsFormDelete.News2Del.value);
	xmlHttp.onreadystatechange = handleViewNews2Del;
	xmlHttp.send(null);
	}
	function handleViewNews2Del()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('news2Del').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
		document.getElementById('viewDetails2Del33').innerHTML = "";
		
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('news2Del').innerHTML = response;
	}
		}
		
		
		
		function viewNewsDetail2Del()//this when u choose  news details to delete it
{
	//alert('mama');
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','NewsData.php?newsID2del='+document.selectNewsForm2Del.Newses2Del.value);
	xmlHttp.onreadystatechange = handleViewNewsDetailsThenDel;
	xmlHttp.send(null);
	}
	function handleViewNewsDetailsThenDel()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2Del33').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2Del33').innerHTML = response;
	}
		}
	function viewNews2()//this when u choose category it's info is viewed
   {
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?catIDCat='+document.selectCatForm2.cat2.value);
	xmlHttp.onreadystatechange = handleViewNews2;
	xmlHttp.send(null);
	}
	function handleViewNews2()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('updateInfo2').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('updateInfo2').innerHTML = response;
	}
		}

		
	function viewNews2DelCat()//fill the menue to choose the news_cat u want 2 delete
		{
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?catID2Del2='+document.selectNewsCat2Del.News2DelCat.value);
	xmlHttp.onreadystatechange = handleViewCat2Del;
	xmlHttp.send(null);
	}
	function handleViewCat2Del()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2DelCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2DelCat').innerHTML = response;
	}
		}
		
		function AddCatNews()//add new category news
		{
			if((document.formNewsCat2add.NewsCat1.value=='')||(document.formNewsCat2add.NewsCat1.value.length<1))
			{
				alert('you have to enter value in category name');
			}
			else
			{
			document.formNewsCat2add.submit();
			}
		}
		function saveNew()
		{
			if(document.updateNews.compad==-1 && document.updateNews.uploaded_file=='' )
			{
				alert('you cannot remove company logo or country flag');
				}
				else if(document.updateNews.compadFlag==-1 && document.updateNews.uploaded_file_Flag=='' )
				{
				alert('you cannot remove company logo or country flag');
					}
					else
					{
					document.updateNews.submit();
					}
			
		}
		function saveProd()
		{
			if(document.updateProd.ProdName!='')
			{
				document.updateProd.submit();
			}
		}
		function saveCatNews()
		{
			if((document.formTCat.NewsCat1.value=='')||(document.formTCat.NewsCat1.value.length<1))
				{
					alert('you have to enter val to the category name');
				}
				else
				{
			document.formTCat.submit();
				}
			}
			function AddPartner()
			{
				if((document.form1cat.partner_Name.value==''))
				{
					alert('you have to enter news name at least');
					}
					else
					{
				document.form1cat.submit();
					}
			}
			function AddNew()
			{
				/*if((document.form1cat.newsName.value=='')||(document.form1cat.newsName.value.length<1))
				{
					alert('you have to enter news name at least');
					}
					else
					{*/
	//			document.form1cat.submit();
				//	}
		/*		}
				function DelCat()
			{
				answer=confirm('all the news inside this news category will be deleted , are you sure u want to continue ?!')
	 if(answer!=0)
	{
			document.form1cat.submit();
	}
				}
				function plusNewOrd()//for add order to news cat
				{
					document.formNewsCat2add.addCatOrd.value++;
				}
				function MenusNewOrd()//for menus order to news cat
				{
					document.formNewsCat2add.addCatOrd.value--;
				}
				function plusNewOrdU()//for add order to news cat
				{
					document.formTCat.OrdCatNews.value++;
				}
					function menNewOrdU()//for add order to news cat
				{
					document.formTCat.OrdCatNews.value--;
				}
				function plusNewOr()
				{
					document.form1cat.newsOrd.value++;
					}
					function MenusNewOr()
				{
					document.form1cat.newsOrd.value--;
					}
					function plusNewOrderEdit()//increase order to news in edit mode
					{
						document.updateNews.OrdValLabel.value++;
						}
					function Menus22NewOrderEdit()//decrease order to news in edit mode
					{
						document.updateNews.OrdValLabel.value--;
						}
						function plusProdOrderEdit()//increase order to news in edit mode
					{
						document.updateProd.OrdValLabel.value++;
						}
					function Menus22ProdOrderEdit()//decrease order to news in edit mode
					{
						document.updateProd.OrdValLabel.value--;
						}
						
function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
if (unicode<48||unicode>57) //if not a number
return false //disable key press
}
}


*/

//*************************************************added after for UET
//*************************************************added after for UET
//*************************************************added after for UET
//*************************************************added after for UET

/*
function viewCat2()//view second category to insert new product
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat2='+document.form1cat.cat2Insert.value);
	xmlHttp.onreadystatechange = viewCat2Handle;
	xmlHttp.send(null);
}
function viewCat2Handle()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('secondCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('secondCat').innerHTML = response;
	}
}

function viewCat3()//view Third category to insert new product
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat3='+document.form1cat.cat2Insert33.value);
	xmlHttp.onreadystatechange = viewCat3Handle;
	xmlHttp.send(null);
}
function viewCat3Handle()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCat').innerHTML = response;
	}
}

function viewCat3Updat()//view third category to update new product or view data
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat3Update='+document.selectCatFormUpdat.caUpdate.value);
	xmlHttp.onreadystatechange = viewCat3UpdatHandle;
	xmlHttp.send(null);
}
function viewCat3UpdatHandle()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCat3Update').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCat3Update').innerHTML = response;
	}
}

function viewCat()//here view third category in the update product
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat4='+document.selectCatFormUpdat.Cat3Upda.value);
	xmlHttp.onreadystatechange = handleViewCat
	xmlHttp.send(null);
}

function handleViewCat()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('lastLevelCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('lastLevelCat').innerHTML = response;
	}
}

function viewProd()//finally view products
{
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','ProductData.php?prodID='+document.selectCatFormUpdat.Prod.value);
	xmlHttp.onreadystatechange = handlViewProd
	xmlHttp.send(null);
}
function handlViewProd()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('ProdView').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('ProdView').innerHTML = response;
	}
}
function viewCatDel()//view third category or products
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?Cat3_ID='+document.selectCatFormDel5.caDel5.value);
	xmlHttp.onreadystatechange = handleViewCatDel;
	xmlHttp.send(null);
}
function handleViewCatDel()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCatDel').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCatDel').innerHTML = response;
	}
}
function viewCat2Del7()//here view the products for the third level in category
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?Cat3Last_ID='+document.selectCatFormDel5.Cat3d.value);
	xmlHttp.onreadystatechange = viewCat2Del7handle;
	xmlHttp.send(null);
}
function viewCat2Del7handle()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('lastL').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('lastL').innerHTML = response;
	}
}
function viewProd2Del7()//finally view all detailes about product tpo delete them
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','ProductData.php?prodID2del='+document.selectCatFormDel5.Prod2Del.value);
	xmlHttp.onreadystatechange = viewProd2Del7Hand;
	xmlHttp.send(null);
}
function viewProd2Del7Hand()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2Del33').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2Del33').innerHTML = response;
	}
}



function previewTopView()//prieviw photo for the top view insert
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?topViewID='+document.form1cat.TopViewSelect.value);
	xmlHttp.onreadystatechange = previewTopViewHandle;
	xmlHttp.send(null);	
}
function previewTopViewHandle()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewPhoto').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewPhoto').innerHTML = response;
	}
}
function previewTopViewUpdate()//prieviw photo for the top view Update
{
   
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?topViewID='+document.updateProd.TopViewSelect.value);
	xmlHttp.onreadystatechange = previewTopViewUpdateHandle;
	xmlHttp.send(null);	
}
function previewTopViewUpdateHandle()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('prevew').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('prevew').innerHTML = response;
	}
}
function updateInfo2Par()
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?topViewID='+document.form1cat.TopViewSelect.value);
	xmlHttp.onreadystatechange = previewTopViewUpdateHandle;
	xmlHttp.send(null);	
}
function handleUpdatPar()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('prevew').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('prevew').innerHTML = response;
	}
}

function viewPart()// for view partners detailes
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','PartnerData.php?parID='+document.selectPartForm2.Partners.value);
	xmlHttp.onreadystatechange = viewPartHandle;
	xmlHttp.send(null);	
}
function viewPartHandle()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('updateInfo2Par').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('updateInfo2Par').innerHTML = response;
	}
}

function removeFlagPhoto()//remove flag from the update partner  
{
		xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?FlagID='+document.updateNews.compadFlag.value);
	document.updateNews.compadFlag.value=-1;
	xmlHttp.onreadystatechange = HandlremoveFlagPhoto;
	xmlHttp.send(null);
}
function HandlremoveFlagPhoto()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('Flag').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('Flag').innerHTML = response;
	}
}

function viewPartner2Del()// view partners to delete
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','PartnerData.php?PartnerIDdel='+document.selectPartner2Del.part2Del.value);
	xmlHttp.onreadystatechange = viewPartner2DelHandl;
	xmlHttp.send(null);
}
function viewPartner2DelHandl()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2Del').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2Del').innerHTML = response;
	}
}
function topVi()//update top view
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?topVID='+document.TopV.TopVDes.value);
	xmlHttp.onreadystatechange = topViHandle;
	xmlHttp.send(null);
}
function topViHandle()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('topViewPhoto').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('topViewPhoto').innerHTML = response;
	}

}

function removeTpView()//remove photo for the top view
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?topVR='+document.TopV22.compad.value);
	document.TopV22.compad.value=-1;
	xmlHttp.onreadystatechange = HandleremoveTpView;
	xmlHttp.send(null);

}
function HandleremoveTpView()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('TopVLogo').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('TopVLogo').innerHTML = response;
	}
}

function viewTopView()//view detailes to delete top view
{
    xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?topID='+document.selectTopView.TopView2Del.value);
	xmlHttp.onreadystatechange = viewTopViewHandler;
	xmlHttp.send(null);
	
}
function viewTopViewHandler()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewTo').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewTo').innerHTML = response;
	}
}

function viewCat2444()//view second category to insert to Attachment
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat2444='+document.form1cat.cat2Insert.value);
	xmlHttp.onreadystatechange = viewCat2Handle444;
	xmlHttp.send(null);
}
function viewCat2Handle444()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('secondCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('secondCat').innerHTML = response;
	}
}
function viewCat3444()//view Third category to insert to Attachment
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat3444='+document.form1cat.cat2Insert33.value);
	xmlHttp.onreadystatechange = viewCat3Handle444;
	xmlHttp.send(null);
	document.getElementById('Conten').className='Show2';/////view the form to input
}
function viewCat3Handle444()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCat').innerHTML = response;
	}
}
function ViewLastProduct()//view Products in the Attachment last category
{
		xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?catMS='+document.form1cat.cat2In4.value);
	xmlHttp.onreadystatechange = ViewLastProductHandle;
	xmlHttp.send(null);
	document.getElementById('Conten').className='Show2';/////view the form to input
}
function ViewLastProductHandle()
{
				if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCatMS').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCatMS').innerHTML = response;
	}

}
*/
///*******************************ATTachments****************//
///*******************************ATTachments****************//
///*******************************ATTachments****************//
///*******************************ATTachments****************//
/*function viewNewsAtt()//this when u choose category all the news related with this category is filled in the bottom list for attachments
{
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?catIDAtt='+document.selectCatForm.cat.value);
	xmlHttp.onreadystatechange = handleViewNewsAtt;
	xmlHttp.send(null);
	}
	function handleViewNewsAtt()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('news_by_cat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
			document.getElementById('updateInfo').innerHTML = "" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('news_by_cat').innerHTML = response;
	}
		}


function viewCat3UpdatAtt()//view third category to update new product or view data
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat3UpdateAtt='+document.selectCatFormUpdat.caUpdate.value);
	xmlHttp.onreadystatechange = viewCat3UpdatHandleAtt;
	xmlHttp.send(null);
	document.getElementById('ProdView').className='Hiden2';
}
function viewCat3UpdatHandleAtt()
{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCat3Update').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCat3Update').innerHTML = response;
	}
}
function viewCatAtt()//here view third category in the update product
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?cat4Att='+document.selectCatFormUpdat.Cat3Upda.value);
	xmlHttp.onreadystatechange = handleViewCatAtt
	xmlHttp.send(null);
}

function handleViewCatAtt()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('lastLevelCat').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('lastLevelCat').innerHTML = response;
	}
}
function viewProdAtt()//finally view products
{
	document.AttType2.attType[0].checked=true;
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','Attachment.php?viewProdAtt='+document.selectCatFormUpdat.Prod.value);
	xmlHttp.onreadystatechange = handlViewProdAtt
	xmlHttp.send(null);
	document.getElementById('ProdView').className='Show2';/////view the form to input
}
function handlViewProdAtt()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('AttDet').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('AttDet').innerHTML = response;
	}
}
*/
/*****************************************************************************************/
/*
function cho2()//change the attachments type 
{
	xmlHttp=GetXmlHttpObject();
	var rad_val='';
	for (var i=0; i < document.AttType2.attType.length; i++)
    {
     if (document.AttType2.attType[i].checked)
      {
       rad_val = document.AttType2.attType[i].value;
       }
    }

	if(rad_val=='1')//pdf
	{
	xmlHttp.open('get','Attachment.php?Prod2PDF='+document.selectCatFormUpdat.Prod.value);	
	}
	else if(rad_val=='2')//photo
	{
		xmlHttp.open('get','Attachment.php?Prod2PHOTO='+document.selectCatFormUpdat.Prod.value);
	}
	else if(rad_val=='3')//traffic
	{
		xmlHttp.open('get','Attachment.php?Prod2Traffic='+document.selectCatFormUpdat.Prod.value);
	}
	else if(rad_val=='4')//video
	{
		xmlHttp.open('get','Attachment.php?Prod2Video='+document.selectCatFormUpdat.Prod.value);
	}
	xmlHttp.onreadystatechange = choHandle2;
	xmlHttp.send(null);
}
function choHandle2()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('AttDet').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('AttDet').innerHTML = response;
	}
}



function viewProd2DelAtt()//here to delete Attachment
		{
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?catdel5Att='+document.selectNewsFormDelete.News2Del.value);
	xmlHttp.onreadystatechange = handleViewNews2DelAtt;
	xmlHttp.send(null);
	}
	function handleViewNews2DelAtt()
	{
			if(xmlHttp.readyState == 1)
	{
		document.getElementById('news2Del').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
		document.getElementById('viewDetails2Del33').innerHTML = "";
		
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('news2Del').innerHTML = response;
	}
		}
		function viewCatDelAtt()//view third category or products
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?Cat3_IDAtt='+document.selectCatFormDel5.caDel5.value);
	xmlHttp.onreadystatechange = handleViewCatDelAtt;
	xmlHttp.send(null);
}
function handleViewCatDelAtt()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('thirdCatDel').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('thirdCatDel').innerHTML = response;
	}
}

function viewCat2Del7Att()//here view the products for the third level in category
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','functions.php?Cat3Last_IDAtt='+document.selectCatFormDel5.Cat3d.value);
	xmlHttp.onreadystatechange = viewCat2Del7handleAtt;
	xmlHttp.send(null);
}
function viewCat2Del7handleAtt()
{
		if(xmlHttp.readyState == 1)
	{
		document.getElementById('lastL').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('lastL').innerHTML = response;
	}
}
function viewProd2Del7Att()//finally view all detailes about product tpo delete them
{
	document.AttDel.attType[0].checked=true;
	xmlHttp=GetXmlHttpObject();
	//xmlHttp.open('get','ProductData.php?prodID2del='+document.selectCatFormDel5.Prod2Del.value);
	xmlHttp.open('get','Attachment.php?prodIDdelAttPDF='+document.selectCatFormDel5.Prod2Del.value);
	xmlHttp.onreadystatechange = viewProd2Del7HandAtt;
	xmlHttp.send(null);
	document.getElementById('ProdView234Del').className='Show2';/////view the form to input
}
function viewProd2Del7HandAtt()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2Del33').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2Del33').innerHTML = response;
	}
}



function cho2del()//change the attachments type 
{
	xmlHttp=GetXmlHttpObject();
	var rad_val='';
	for (var i=0; i < document.AttDel.attType.length; i++)
    {
     if (document.AttDel.attType[i].checked)
      {
       rad_val = document.AttDel.attType[i].value;
       }
    }

	if(rad_val=='1')//pdf
	{
	xmlHttp.open('get','Attachment.php?prodIDdelAttPDF='+document.selectCatFormDel5.Prod2Del.value);	
	}
	else if(rad_val=='2')//photo
	{
		xmlHttp.open('get','Attachment.php?Prod2PHOTODel='+document.selectCatFormDel5.Prod2Del.value);
	}
	else if(rad_val=='3')//traffic
	{
		xmlHttp.open('get','Attachment.php?Prod2TrafficDel='+document.selectCatFormDel5.Prod2Del.value);
	}
	else if(rad_val=='4')//video
	{
		xmlHttp.open('get','Attachment.php?Prod2VideoDel='+document.selectCatFormDel5.Prod2Del.value);
	}
	xmlHttp.onreadystatechange = choHandle2del;
	xmlHttp.send(null);
}
function choHandle2del()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2Del33').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}
    	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2Del33').innerHTML = response;
	}
}



/***Change pass word ***//***Change pass word ***//***Change pass word ***//***Change pass word ***/
/*function changePWD()//this function is used to  to view completed data about Delete Page
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','pageData.php?pageid='+document.selectPageFormDelete.Page2Del.value);
	xmlHttp.onreadystatechange = handleChangePWD;
	xmlHttp.send(null);
}

function handleChangePWD()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewChangePwd').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewChangePwd').innerHTML = response;
	}
}
*/

/*
function deleteCompany()//this function is used to Delete company
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','adminFunc.php?id2Del='+ document.selectCompFormDelete.company2Del.value+'&edit=delete');
	xmlHttp.onreadystatechange = handleDel;
	xmlHttp.send(null);
}

function handleDel()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('viewDetails2Del').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('viewDetails2Del').innerHTML = response;
	}
}
/*
function uploadSave()
{
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open('get','upload.php');
	xmlHttp.onreadystatechange = handleUploadSave;
	xmlHttp.send(null);
}

function handleUploadSave()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('MainDiv').innerHTML = "<div style=\"text-align:center; valign=middle;\"><img src='images/wait1.gif'> wait;</div>" ;
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('MainDiv').innerHTML = response;
	}
}
/*
function HideAdv()
{
		xmlHttp.open('get','Admin/ViewAdv.php?id='+document.Artic.Article.value+'&dot=2');//dot==2 hide
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}
	
	function ShowAdv()
{
	xmlHttp.open('get','Admin/ViewAdv.php?id='+document.Artic.Article.value+'&dot=3');//dot==3 show
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}



function getActivityInfo()
{
	xmlHttp.open('get','Admin/ViewActivity.php?id='+document.Artic.Article.value);
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}

function deleteActiv()
{
	xmlHttp.open('get','Admin/ViewActivity.php?id='+document.Artic.Article.value+'&dot=1');//dot==1 delete
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
	
}

function HideActiv()
{
		xmlHttp.open('get','Admin/ViewActivity.php?id='+document.Artic.Article.value+'&dot=2');//dot==2 hide
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}
	
	function ShowActiv()
{
	xmlHttp.open('get','Admin/ViewActivity.php?id='+document.Artic.Article.value+'&dot=3');//dot==3 show
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}


function getBranchInfo()
{
	xmlHttp.open('get','Admin/ViewBranch.php?id='+document.Artic.Article.value);
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}
function deleteBranch()
{
	xmlHttp.open('get','Admin/ViewBranch.php?id='+document.Artic.Article.value+'&dot=1');//dot==1 delete
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
	
}

function selectDev()//view details of device
{
	xmlHttp.open('get','functions/DevicDetails.php?id='+document.priceOrder.device.value);
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
}
/*
function changeCompany()
{
	xmlHttp.open('get','functions/ViewCompany.php?id='+document.priceOrder.company.value);
	xmlHttp.onreadystatechange = handleCompanyDetails;
	xmlHttp.send(null);	
}



function handleCompanyDetails()
{
	if(xmlHttp.readyState == 1)
	{
		document.getElementById('cat').innerHTML = 'loading ..';
	}

	else if(xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;
		document.getElementById('cat').innerHTML = response;
	}
}
*/
/*
function getSearchRes()
{
	xmlHttp.open('get','functions/Search.php?serch4='+document.search2.serch4.value+'&cat='+document.search2.cat.value+'&comp='+document.search2.comp.value);
	xmlHttp.onreadystatechange = handleGetArticle;
	xmlHttp.send(null);	
	}
	
	function validAddCompany()
	{
		if((document.frm.company_name.value=='')||(document.frm.national.value=='')||(document.frm.link.value=='')||(document.frm.photo.value=='')||(document.frm.download_arab.value=='')||(document.frm.download_eng.value==''))
		{
		   alert('please inter full data!!');
		}
		else
		{
			frm.submit();
		}
	}
	
	function checkAddProduct()
	{
		if((document.frmCat.cat_name.value=='')||(document.frmCat.cat_name_eng.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			frmCat.submit();
		}
	}
	
	
	function checkAddDevice()
	{
		if((document.deviceAdd.devName.value=='')||(document.deviceAdd.company.value=='-1')||(document.deviceAdd.category.value=='-1')||(document.deviceAdd.photo.value=='')||(document.deviceAdd.second_cat_eng.value=='')||(document.deviceAdd.download_arab.value=='')||(document.deviceAdd.download_eng.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			deviceAdd.submit();
		}
	}
	
	
	function checkAddArticle()
	{
		if((document.Artic.title.value=='')||(document.Artic.photo.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			Artic.submit();
		}
	}
	
	function checkAddAdv()
	{
		if((document.frmCat.devName.value=='')||(document.frmCat.link.value=='')||(document.frmCat.photo.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			frmCat.submit();
		}
	}
	
	
	function checkAddBranch()
	{
		if((document.addBranch.branchName.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			addBranch.submit();
		}
	}
	
	
	
	function checkAddActivity()
	{
		if((document.frmCat.activName.value=='')||(document.frmCat.link.value=='')||(document.frmCat.photo.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			frmCat.submit();
		}
	}
	
	
	function checkOrderPrice()
	{
		if((document.priceOrder.device.value=='-1')||(document.priceOrder.mobil.value=='')||(document.priceOrder.address.value=='')||(document.priceOrder.name.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			priceOrder.submit();
		}
	}
	
	
	function checkRepairForm()
	{
		if((document.priceOrder.device.value=='-1')||(document.priceOrder.owned.value=='')||(document.priceOrder.person.value=='')||(document.priceOrder.mobil22.value=='')||(document.priceOrder.tim.value=='')||(document.priceOrder.address.value==''))
		{
			alert('fill accepted data');
		}
		else
		{
			priceOrder.submit();
		}
	}
	function checkDevDel()
	{
		if(document.priceOrder.device.value=='-1')
		{
			;
			}
			else
			{
				priceOrder.submit();
				}
		}
		*/
	/*	function savePDF()
		{
		    	document.pdfSav.submit();
		}
		function AddTopView()
		{
			document.form1cat.submit();
		}
		function saveTopView()
		{
			document.TopV22.submit();
		}
		function delTop()
		{
			answer=confirm('are you sure you want to delete this Top view ..?!');
	 if(answer!=0)
	{
			document.delete2.submit();
		}
		}
		function savePartnerData()
		{
			document.updateNews.submit();
		}
		function delPartner()
		{
				answer=confirm('are you sure you want to delete this Partner ..?!');
	 if(answer!=0)
	{
			document.delete2.submit();
		}
		}
		
		function SavePage()
		{
			document.page.submit();
			}
			*/
