var allPageTags = new Array(); //Create an array 
function doSomethingWithClasses(theClass) { 
	var allPageTags=document.getElementsByTagName("*"); //Populate the array with all the page tags
	for (var i=0; i<allPageTags.length; i++) { //Cycle through the tags using a for loop 
		if (allPageTags[i].className==theClass) { //Pick out the tags with our class name 
		allPageTags[i].style.display='none'; //Manipulate this in whatever way you want 
		}
	}
}
  
function showRadio(Class,id) { //radio, Class=class Div & id=id Div=this.value
  doSomethingWithClasses(Class); 
  var obj = document.getElementById(id); 
  if (obj.style.display != 'block') { obj.style.display = 'block'; } 
                               else { obj.style.display = 'none'; } 
}

function showCheckbox(divToShow,id) {//checkbox, divToShow=this & id=id Div=this.value
	if (document.getElementById) {
		if (divToShow.checked == true) {
		document.getElementById(id).style.display = "inline";
		}else{
		document.getElementById(id).style.display = "none";
		}
	}
}

function showMenu(obj,id){//Drop Down Box, obj=this & id=id Div=this.value
var curSel=obj.options[obj.selectedIndex].value
if(curSel==id){
document.getElementById(id).style.display="block";
}else{
document.getElementById(id).style.display="none";
}
}



























////////////////////////////////////////
function ShowHide2(divToShow,divName) {
if (document.getElementById) {
	if (divToShow.checked == true) {
	document.getElementById(divName).style.display = "inline";
	}else{
	document.getElementById(divName).style.display = "none";
		}
	}
}

function ShowHide(divToShow,divName) {
if (document.getElementById) {
	if (divToShow.checked == true) {
	document.getElementById(divName).style.display = "inline";
	}else{
	document.getElementById(divName).style.display = "none";
		}
	}
}

//إظهار وإخفاء محتوى من خلال اختيار قائمة
function Show(Class,ids) { 
  doSomethingWithClasses(Class); 
  var obj = document.getElementById(ids); 
  if (obj.style.display != 'block') { obj.style.display = 'block'; } 
                               else { obj.style.display = 'none'; } 
} 

//إظهار وإخفاء محتوى من خلال اختيار قائمة
function showH(id) { 
  var obj = document.getElementById(id); 
  if (obj.style.display != 'block') { obj.style.display = 'block	'; } 
                               else { obj.style.display = 'none'; } 
} 

var lastDiv = "";
function showDiv(divName) {
	// hide last div
	if (lastDiv) {
		document.getElementById(lastDiv).style.display = "none";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divName && document.getElementById(divName)) {
		document.getElementById(divName).style.display = "block";
		lastDiv = divName;
	}
}

var lastDivID = "";
var lastDivClass = "";
function showDivTest(divClass,divID) {
	// hide last div
	if (lastDiv && lastDivClass==divClass) {
		document.getElementById(lastDiv).style.display = "none";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divClass && divID && document.getElementById(divID)) {
		document.getElementById(divID).style.display = "block";
		lastDivID = divID;
		lastDivClass = divClass;
	}
}
////////////////////////////////////////



























//آخر تجربة 17-3-2010 //Drop Down Box, obj=this.name & id=id Div=this.value
var allPageTags2 = new Array(); //Create an array 
function allClass(theClass) { 
	var allPageTags2=document.getElementsByTagName("*"); //Populate the array with all the page tags
	for (var i=0; i<allPageTags2.length; i++) { //Cycle through the tags using a for loop 
		if (allPageTags2[i].className==theClass) { //Pick out the tags with our class name 
		allPageTags2[i].style.display='none'; //Manipulate this in whatever way you want 
		}
	}
}

var lastID = "";
var lastClass = "";
function sh(theClass,id) {//Drop Down Box, obj=this.name & id=id Div=this.value //onchange="sh(this.name,\'id div Show & Hide\')"
	//alert("theClass="+theClass+" ,id="+id+" ,lastClass="+lastClass+" ,lastId="+lastID);//show error
	allClass(theClass);
	// hide last div
	if (lastID!=id && lastClass==theClass) {
		document.getElementById(lastID).style.display = "none";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (theClass && id && document.getElementById(id)) {
		document.getElementById(id).style.display = "block";
		lastID = id;
		lastClass = theClass;
	}
}
