function SearchInReturnedResults()
{
    var word = document.mainform.soegvidere_orig_term.value + " " + document.mainform.soegvidere_term.value;
    word = escape(word);
    location.href='/toolsmenu/search.aspx?q='+word+'&amp;sortorder=asc';
    if(document.all)
    {
        event.keyCode=0;
        event.cancelBubble=true;
    }
    return false;
}

function Search()
{
    var word = document.mainform.SearchKeyword.value;
    word = encodeURI(word); // escape(word);
    //location.href='/toolsmenu/search.aspx?page=1&search='+word+'';
    location.href='http://www.vejenkom.dk/toolsmenu/search.aspx?sw='+word+'';
 
    return false;
}


function selectValue(id)
{
    var f= eval("document.all."+id);
    f.focus();
    f.select();
}

function GotoLink()
{
    if(document.mainform.exlinks.value != "")
    {
        location.href = document.mainform.exlinks.value;
    }
}



function checkEnter(e,caller) //e is event object passed from function invocation
{

	var characterCode //literal character code will be stored in this variable

	if(e && e.which ||e.which == 0)
	{ //if which property of event object is supported (NN4)
	
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else
	{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}

	if(characterCode == 13)//if generated character code is equal to ascii 13 (if enter key)
	{ 
	    if(document.all){
		    e.returnValue=false;
            e.cancel = true;
        }
        else{
         e.preventDefault();
        }
        var obj = document.getElementById(caller);
        if(obj){        
            
            if(obj.click){
		        obj.click();
		    }
		}
		return false
	}
	else
	{
		return true
	}
		
}
function lavmail(ini)
        { location.href="mailto:" + ini+ "@" + "vejenkom.dk"; }

// funktion der tilpasser kasser på forsiden
$(document).ready(function() {
    var boxes = $('#threebox .boxcontent');
    var max = 0;
    boxes.each(function() {
        max = Math.max($(this).height());
    });
    boxes.each(function() {
        $(this).css('height', max);
    });
});
