function my_getbyid(id)
{
	itm = null;
	
	if (document.getElementById)
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	}
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	
	return itm;
}	

//Show/Hide Thing on by default
function ShowHide(IDID,id1)
{
	toggleview(IDID,id1);
}

//Show/Hide Thing off by default
function HideShow(IDID,id1)
{
	toggleview1(IDID,id1);
}

var oldID0;
var oldID1;
var oldID2;

function openOldID(IDID,id1,id2) {
	oldID0 = my_getbyid(IDID);
	oldID1 = my_getbyid(id1);
	oldID2 = my_getbyid(id2);
}

//Show/Hide only one panel
function HideShowUnique(IDID,id1,id2) {
	
	itm0 = my_getbyid(IDID);
	itm1 = my_getbyid(id1);
	itm2 = my_getbyid(id2);

	//if (itm1 != oldID1) {

		if (itm1.style.display == "block") {
			
			var getID = itm0;
			
			if (getID.className == "HideShowDeActive") {
				getID.className = "HideShowActive";
			} else {
				getID.className = "HideShowDeActive";	
			}		
			
			itm1.style.display = "none";
			id1.offsetHeight;
			itm2.style.display = "block";
			itm2.offsetHeight;
			
			if (oldID0) {
				oldID0.className = "HideShowActive";
			}
			if (oldID1) {
				oldID1.style.display = "none";
				oldID1.offsetHeight;
			}
			if (oldID2) {
				oldID2.style.display = "block";
				oldID2.offsetHeight;
			}
			
		} else {
			
			var getID = itm0;
			if (getID.className == "HideShowDeActive") {
				getID.className = "HideShowActive";
			} else {
				getID.className = "HideShowDeActive";	
			}				
			
			itm1.style.display = "block";
			itm1.offsetHeight;
			itm2.style.display = "none";
			itm2.offsetHeight;
			
			if (oldID0 && itm1 != oldID1) {
				oldID0.className = "HideShowActive";
			}
			if (oldID1 && itm1 != oldID1) {
				oldID1.style.display = "none";
				oldID1.offsetHeight;
			}
			if (oldID2 && itm1 != oldID1) {
				oldID2.style.display = "block";
				oldID2.offsetHeight;	
			}
			
			
		}
		
	//}	
		
	oldID1 = itm1;
	oldID2 = itm2;	
	oldID0 = itm0;
	

}

//Show/Hide only one panel
function ShowHideUnique(IDID,id1,id2) {
	
	itm0 = my_getbyid(IDID);
	itm1 = my_getbyid(id1);
	itm2 = my_getbyid(id2);
	
	if ((oldID1)&&(itm1 != oldID1)) {
		
		if (itm1.style.display == "none") {
			
			var getID = itm0;
			
			if (getID.className == "HideShowDeActive") {
				getID.className = "HideShowActive";
			} else {
				getID.className = "HideShowDeActive";	
			}		
			
			itm1.style.display = "block";
			id1.offsetHeight;
			itm2.style.display = "none";
			itm2.offsetHeight;
			
			if (oldID0) {
				oldID0.className = "HideShowActive";				
			}
			oldID1.style.display = "none";
			oldID1.offsetHeight;
			if (oldID2) {
				oldID2.style.display = "block";
				oldID2.offsetHeight;
			}
			
		} else {
			
			var getID = itm0;
			if (getID.className == "HideShowDeActive") {
				getID.className = "HideShowActive";
			} else {
				getID.className = "HideShowDeActive";	
			}				
			
			itm1.style.display = "none";
			itm1.offsetHeight;
			itm2.style.display = "block";
			itm2.offsetHeight;
			
			if (oldID0) {
				oldID0.className = "HideShowActive";
			}
			oldID1.style.display = "none";
			oldID1.offsetHeight;
			if (oldID2) {
				oldID2.style.display = "block";
				oldID2.offsetHeight;
			}
	
		}
		
	}	

	oldID1 = itm1;
	oldID2 = itm2;
	oldID0 = itm0;

}

function toggleview(IDID,id)
{
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )
	{
		if (itm.style.display == "none")
		{
			my_show_div(IDID,itm);
		}
		else
		{
			my_hide_div(IDID,itm);
		}
	}
}

function toggleview1(IDID,id)
{
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )
	{
		if (itm.style.display == "block")
		{
			my_hide_div(IDID,itm);
		}
		else
		{
			my_show_div(IDID,itm);
		}
	}
}

function my_hide_div(IDID,itm)
{
	if ( ! itm ) return;
	var getID = document.getElementById(IDID);
	getID.className = "HideShowActive";
	
	itm.style.display = "none";
	itm.offsetHeight;
}

function my_show_div(IDID,itm)
{
	if ( ! itm ) return;
	var getID = document.getElementById(IDID);
	getID.className = "HideShowDeActive";
	
	itm.style.display = "block";
	itm.offsetHeight;
}
