
// Funktion til at afgøre hvilken 
function categorySelector(strPagename) {
	var iCatId = document.selectorForm.frmSelectCat.options[document.selectorForm.frmSelectCat.selectedIndex].value;
	
	if (iCatId == "") return 0;
	
	//locNow = document.location.href;
	
	
	
	locCall = strPagename + "?iCatId=" + iCatId;
	document.location.href = locCall;
	//alert(locCall);
}


function subCatSelector(smode, strPagename) {
	
	// If dummy-option selected: just return, do nothing
    if(smode != "area")
    {
        var strVal = document.selectorForm.frmSelectSubCategory.options[document.selectorForm.frmSelectSubCategory.selectedIndex].value;
    	if (strVal=="")  return;
    }	
	
	// Når der skiftes valg i subcategory selectbox'en:
	if (smode == "subcat") {
		subCatId = document.selectorForm.frmSelectSubCategory.options[document.selectorForm.frmSelectSubCategory.selectedIndex].value;
		AreaId = 0; // document.selectorForm.frmSelectArea.options[0].value;
	}
	

	// Vi er nødt til at have et specielt script (dette) til forsiden, da der her ikke findes en Lande-selectbox...
	// Så derfor sætter vi bare AreaId til "all":
	if (smode == "subcatfrontpage") {
		subCatId = document.selectorForm.frmSelectSubCategory.options[document.selectorForm.frmSelectSubCategory.selectedIndex].value;
		AreaId = "0"; // Zero means All
	}
	
	if (smode=="area") {
		subCatId = document.selectorForm.frmSelectSubCategory.options[document.selectorForm.frmSelectSubCategory.selectedIndex].value;
		AreaId = document.selectorForm.frmSelectArea.options[document.selectorForm.frmSelectArea.selectedIndex].value;
	}
	
	AreaSelect = "&iAreaId=" + AreaId;

	if (subCatId == "") {
		var iCatId = document.selectorForm.frmSelectCat.options[document.selectorForm.frmSelectCat.selectedIndex].value;
		locCall = strPagename + '?iCatId=' + iCatId + AreaSelect;
	}
	else {
		locCall = strPagename + '?iSubcatId=' + subCatId + AreaSelect;
	}

	document.location.href = locCall;
}


function areaSelector() {
	var iAreaId = document.selectorForm.frmSelectArea.options[document.selectorForm.frmSelectArea.selectedIndex].value;
	//alert(iAreaId);
	
	var locCall = "subcatinfo.asp?iAreaId=" + iAreaId
	
	document.location.href = locCall;
}




// Funktion til at åbne billeder i vindue for sig selv:
function openpic(id)
{
	jwindow = "picture1.htm?"+id;
	if (id == "null") { alert("Der er ingen billeder"); return;}
	doit = window.open(jwindow,'Picture','width=620,height=460,scrollbars=yes,status=yes,toolbar=no,title=no,menubar=yes,resizable=yes');
}

// Funktion til at åbne tast selv vindue:
function opentastselv(strUrl,strTitle)
{
	doit = window.open(strUrl,strTitle,'width=520,height=560,scrollbars=yes,status=yes,toolbar=no,title=no,menubar=yes,resizable=yes');
}

// Funktion til at åbne adminvinduet:
function openadmin(strUrl,strTitle)
{
	doit = window.open(strUrl,strTitle,'width=720,height=460,scrollbars=yes,status=yes,toolbar=yes,title=no,menubar=yes,resizable=yes');
}

// Funktion til at åbne landkort med koordinater på:
function openmap(strKrakURL)
{
	//var jwindow = "map1.asp?iProjectId=" + id;
	//alert(strKrakURL);
	doit = window.open(strKrakURL,'map','scrollbars=yes,status=no,toolbar=no,title=no,menubar=yes');
}

// FormSubmit-funktion:

function submitForm(element)
{
element.submit();
}


// Funktion til at åben landkort med koordinater på:
function techmessage()
{
doit = window.open('techmessage.htm','map','width=620,height=400,scrollbars=yes,status=no,toolbar=no,title=no,menubar=yes');
}
