// функция переключения типа группировки в ГОСТах

function switchSelector(n) {
	for (i=1; i<=2; i++) {
		if (n==i) {
			document.getElementById("selector"+i).className="mainGoodsSelectorOff";
			document.getElementById("topics"+i).style.display="inline";
		} else {
			document.getElementById("selector"+i).className="mainGoodsSelectorOn";
			document.getElementById("topics"+i).style.display="none";
		}
	}
}

// функция переключения типа группировки в ГОСТах

function switchSelector2(n) {
	for (i=1; i<=2; i++) {
		if (n==i) {
			document.getElementById("selector"+i).className="mainGoodsSelectorOff2";
			document.getElementById("topics"+i).style.display="inline";
		} else {
			document.getElementById("selector"+i).className="mainGoodsSelectorOn2";
			document.getElementById("topics"+i).style.display="none";
		}
	}
}

function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function



// функция переключения новостей на главной ТОП 5
function switchSelectorNews(n) {
	for (i=1; i<=2; i++) {
		if (n==i) {
			document.getElementById("selector"+i).className="SelectorNewsOn";
			document.getElementById("topics"+i).style.display="inline";
		} else {
			document.getElementById("selector"+i).className="SelectorNewsOff";
			document.getElementById("topics"+i).style.display="none";
		}
	}
}

// функция показа информации о разделе на главной странице
function switchSelectorIndexInfo(n) {
	for (i=1; i<=25; i++) {
		if (n==i) {
			document.getElementById("topicsInfo"+i).style.display="inline";
		} else {
			document.getElementById("topicsInfo"+i).style.display="none";
		}
	}
}

// функция показа текста Нормы
ii=1;
function switchSelectorNorma(i) {
		if (i==1) {
			document.getElementById("topicsNorma1").style.display="inline";
			ii=2;
		}
		if (i==2) {
			document.getElementById("topicsNorma1").style.display="none";
			ii=1;
		}
}
