
function fncChangeGroupA(oSelectGroupA)
{
	var GroupAID = oSelectGroupA.value;
	//alert((GroupAID+'').length);
	if(GroupAID!=null && (GroupAID+'').length>0)
	{
		fncShowSubGroupFilterASelect(GroupAID,0)
	}
	else
	{
		fncHideSubGroupFilterASelect();
	}
}
function fncChangeSubGroupA(oSelectSubGroupA)
{
	var SubGroupAID = oSelectSubGroupA.value;
	//alert((GroupAID+'').length);
	if(SubGroupAID!=null && (SubGroupAID+'').length>0)
	{
		fncShowFilterASelect(SubGroupAID,0)	
	}
	else
	{
		fncHideFilterASelect();
	}
}

function fncHideSubGroupFilterASelect()
{
	var SubGroupFilterASelect = document.getElementById('SelectedSubGroupFilterA');
	if(SubGroupFilterASelect!=null){SubGroupFilterASelect.disabled=true;}
}

function fncShowSubGroupFilterASelect(GroupAID,selectedSubGroupFilterAID)
{
	var SubGroupFilterASelect = document.getElementById('SelectedSubGroupFilterA');
	var bFoundSubGroupFilterAToGroupA = false; 
	var nSelectedIndex = 0;
	if(SubGroupFilterASelect!=null)
	{
		if(arrSubGroupFilterA!=null && arrSubGroupFilterA.length>0)
		{	
			var newCounter = 1;
			
			SubGroupFilterASelect.options.length = 1;
			var oOption;
			for(var i = 0;i<arrSubGroupFilterA.length;i++)
			{
				if(''+arrSubGroupFilterA[i].FilterAGroupID==''+GroupAID)
				{
					
					oOption = new Option();
					oOption.value = arrSubGroupFilterA[i].FilterASubGroupID;
					oOption.text = arrSubGroupFilterA[i].FilterASubGroupTitle;
					SubGroupFilterASelect.options[newCounter] = oOption;
					
					if(selectedSubGroupFilterAID==arrSubGroupFilterA[i].FilterAGroupID) nSelectedIndex = newCounter;
					newCounter = newCounter +1;
					bFoundSubGroupFilterAToGroupA = true;
				}
			}	
			
		}
	}
	//alert(bFoundSubGroupFilterAToGroupA);
	if(bFoundSubGroupFilterAToGroupA)
	{
		SubGroupFilterASelect.selectedIndex = nSelectedIndex;
		SubGroupFilterASelect.disabled=false;
	}
	else 
	{
		SubGroupFilterASelect.selectedIndex=0;
		SubGroupFilterASelect.disabled=true;
	}
	var FilterASelect = document.getElementById('SelectedFilterA');
	FilterASelect.selectedIndex=0;
	FilterASelect.disabled=true;
}


function fncHideFilterASelect()
{
	var FilterASelect = document.getElementById('SelectedFilterA');
	if(FilterASelect!=null){FilterASelect.disabled=true;}

}

function fncShowFilterASelect(GroupAID,selectedFilterAID)
{
	var FilterASelect = document.getElementById('SelectedFilterA');
	var bFoundFilterAToGroupA = false; 
	var nSelectedIndex = 0;
	
	if(FilterASelect!=null)
	{
		
		if(arrFilterA!=null && arrFilterA.length>0)
		{	
			var newCounter = 1;
			
			FilterASelect.options.length = 1;
			var oOption;
			for(var i = 0;i<arrFilterA.length;i++)
			{
				//alert(arrFilterA[i].FilterAGroupID);
				if(''+arrFilterA[i].FilterAGroupID==''+GroupAID)
				{
					
					oOption = new Option();
					oOption.value = arrFilterA[i].FilterAID;
					oOption.text = arrFilterA[i].FilterATitle;
					FilterASelect.options[newCounter] = oOption;
					
					if(selectedFilterAID==arrFilterA[i].FilterAID) nSelectedIndex = newCounter;
					newCounter = newCounter +1;
					bFoundFilterAToGroupA = true;
				}
			}	
			
		}
	}
	//alert(bFoundFilterAToGroupA);
	if(bFoundFilterAToGroupA)
	{
		FilterASelect.selectedIndex = nSelectedIndex;
		FilterASelect.disabled=false;
	}
	else 
	{
		FilterASelect.selectedIndex=0;
		FilterASelect.disabled=true;
	}
}


function replaceClass(row)
{
	if(row!=null)
	{

		var rowOnClass = row.onclass;
		var rowNowClass = row.className;
		if(rowOnClass!=null && rowNowClass!=null)
		{
			var tmpClass = rowNowClass;
			row.className = ''+rowOnClass;
			row.onclass = tmpClass;
		}
	}
}

function showIndex(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=1");
}

function showIndexPhone(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=2");
}

function showIndexMobile(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=3");
}

function showIndexMail(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=4");
}

function showIndexLink(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=5");
}

function showIndexCoupon(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=6");
}

function showIndexContactUs(id)
{
    var xmlDoc = dbsRequest("./ctr.asp?id=" + id + "&type=7");
}
