﻿function openTipEnVenPopup(pUrl, pTitle) {
    var winl = (screen.width - 400) / 2;
    var wint = (screen.height - 300) / 2;
    var settings = "width=450,height=300" + ",top=" + wint + ",left=" + winl;
    window.open(pUrl, '', settings);

}

function Search() {
    var word = document.getElementById("search").value;
    word = encodeURI(word);
    location.href = "http://soeg.thisted.dk/search.aspx?pckid=1326285113&aid=273508&pt=6018936&sw=" + word; 
    if (document.all) {
        event.keyCode = 0;
        event.cancelBubble = true;
    }
    return false;
}

function categorySearch(searchStr, category, resultPage, page) {
    var category = category.replace("&", "");
    category = encodeURIComponent(category);
    location.href = resultPage + '?q=' + searchStr + '&sorttype=meta&sortkey=' + category + '&group=1&l=' + page + '&results=100000';
}

function showCategorySearch(searchStr, categoryName, id, resultPage, page) {
    var searchStr = encodeURIComponent(searchStr);
    var id = id.replace("&", "");
    id = encodeURIComponent(id);
    location.href = resultPage + '?q=' + searchStr + '&mc=' + categoryName + '=' + id + '&l=' + page + '&results=10';
}

function pageSearch(searchStr, page, resultPage) {
    var searchStr = encodeURIComponent(searchStr);
    location.href = resultPage + '?q=' + searchStr + '&sortorder=asc&l=' + page + '&results=10';
}


function selectValue(id) {
    var f = eval("document.all." + id);
    f.focus();
    f.select();
}


function SearchInReturnedResults() {
    var word = document.mainform.soegvidere_orig_term.value + " " + document.mainform.soegvidere_term.value;
    word = encodeURI(word);
    location.href = '/toolsmenu/search.aspx?q=' + word + '&amp;sortorder=asc';
    if (document.all) {
        event.keyCode = 0;
        event.cancelBubble = true;
    }
    return false;
}
