﻿var searchResultPathDK = "/da/søgeresultat";
var searchResultPathUK = "/en/searchresult";

function SearchResult() 
{
    this.LastQuery = "";
}

SearchResult.prototype.Search = function(query,isEnglish) {   

    var isEnglishBool = new String(isEnglish); 
        
    if(isEnglishBool.match('true'))  
        window.location = searchResultPathUK + '?query=' + encodeURI(query.strip());
    else
        window.location = searchResultPathDK + '?query=' + encodeURI(query.strip());
}

SearchResult.prototype.ShowAll = function(query, section, isEnglish) {

    var isEnglishBool = new String(isEnglish);

    if(isEnglishBool.match('true'))
        window.location = searchResultPathUK + '?query=' + encodeURI(query.strip()) + "&section=" + encodeURI(section.strip()) + "&showall=true";
    else
        window.location = searchResultPathDK + '?query=' + encodeURI(query.strip()) + "&section=" + encodeURI(section.strip()) + "&showall=true";
}    
var searchResult = new SearchResult();
