var popupDivs = new Array('category','affiliationType','productType','productSpec','quickSearch');

function showSearchDiv() {
	var args = {
			width: 600, 
			height: 400, 
			zindex: 20
	};
	showDiv('largeSearchDiv', args);
	tab('category');
	return false;
}

function closeAllTabs() {
	for (var i = 0; i < popupDivs.length; i++) {
		document.getElementById(popupDivs[i]+'TopTab').className='topSearchTab';
		document.getElementById(popupDivs[i]+'BottomTab').className='bottomSearchTab';
		closeDiv(popupDivs[i]);
	}
	return false;
}

function clearSearchCriteria() {
	var elements = document.getElementsByTagName('input');
	if (elements != null) {
		for (var i = 0; i < elements.length; i++) {
			if (elements[i].className == 'headerSearch')
				elements[i].checked = false;
		}
	}
	for (var i = 0; i < affiliationArr.length; i++)
		document.getElementById('affiliation'+affiliationArr[i]).style.display='none';
	return false;
}

function displayCheckedAffiliations() {
	var elems = document.getElementsByName('affiliationTypeId');
	for (var i = 0; i < elems.length; i++)
		updateAffiliation(elems[i].value);
	return false;
}

function updateAffiliation(affiliationType) {
	if (document.getElementById('affiliationTypeId'+affiliationType).checked)
		document.getElementById('affiliation'+affiliationType).style.display='inline';
	else document.getElementById('affiliation'+affiliationType).style.display='none';
	return false;
}

function tab(id) {
	closeAllTabs();
	document.getElementById(id).style.visibility = "visible";
	document.getElementById(id).style.display = "block";
	document.getElementById(id+'TopTab').className='activeTab';
	document.getElementById(id+'BottomTab').className='activeBottomTab';
	return false;
}

