function auth_check(methods) {
    auth.check(indexMain, function () { window.location = "login.html";}, methods );
}

function indexMain() {
    mk_showPage();
    if (auth.indexCss && document.getElementById("stylesheet")) {
        document.getElementById("stylesheet").href = auth.indexCss;
    }        
    loadComponents();
    renderComponent("authInfoComp", auth);
    controlRegister.loadControls();
    loadSettings(function (setts) {
        controlRegister.populateControls(setts);      
    });
    document.search.query.focus();    
}

function formSubmit() {
	var catFilterQueryParam = "";
	if (document.search.category_filter) {
		catFilterQueryParam = 
			"&categoryfilter=" + encodeURIComponent(document.search.category_filter.value);
	}
    if (document.search.query.value) {       
      document.location = "search.html?" + 
        "query=" + encodeURIComponent(document.search.query.value) +
        catFilterQueryParam +
        "&sort=" + "&perpage=" + "&torusquery=";
    }
}

function saveUserSelections() {
	var setts = {};    
	controlRegister.populateArray(setts);
	saveSettings(setts);	
}

