/**************************************************************
* expand or collapse the tree
**************************************************************/
function show(subCategory, path){
	var thesub;
	var theimage;
	var imageid;
	thesub = document.getElementById(subCategory);
	imageid = "img_"+subCategory;
	theimage = document.getElementById(imageid);
	if(thesub.style.display == 'block'){
		//collapse...
		thesub.style.display = 'none';
		theimage.src = 'images/c.gif';
		theimage.title='Expand';
	}else{
		thesub.style.display = 'block';
		theimage.src = 'images/e.gif';
		theimage.title='Collapse';
	}
}

/**************************************************************
* confirm delete operation
**************************************************************/

function ConfirmDelete(ParentID,Num)
{
	var C = confirm("هل انت متأكد من حذف القائمه ؟؟");
	if(C)
	{
		window.location="Tree.aspx?Delete="+ParentID+"&MenuNum="+Num;
	}
}

/**************************************************************
* add new sub to parentID
**************************************************************/

function AddSubMenu(ParentID,Num)
{
if(ParentID!=0)
	window.location="AddEditMenu.aspx?ParentID="+ParentID+"&MenuNum="+Num;
	else
	window.location="AddEditMenu.aspx?MenuNum="+Num;
}

/**************************************************************
* Edit MainID
**************************************************************/

function EditMenu(MainID,ID2)
{
	window.location="AddEditMenu.aspx?ID="+MainID+"&MenuNum="+ID2;
}

/**************************************************************
* Edit Ads
**************************************************************/

function Ads(MainID,Num)
{
	window.location="MenuAds.aspx?MenuID="+MainID+"&MenuNum="+Num;
}

/**************************************************************
* Edit Order
**************************************************************/

function Order(MainID,Num)
{
	window.location="MenusOrder.aspx?MenuID="+MainID+"&MenuNum="+Num;
}


/**************************************************************
* Add Related
**************************************************************/

function Related(MainID,Num)
{
	window.location="Related.aspx?MenuID="+MainID+"&MenuNum="+Num;
}