﻿// JScript File
function checkKeycode() {
    var searchBox = document.getElementById('ct100_txtSearchText');
    var keycode;
    
    if (window.event) {
        keycode = window.event.keyCode;

        if (keycode == 13) {

            if (searchBox.value != null) {

                CallSearch();
            }
        }
    }
}

function CallSearch() {
    var searchBox = document.getElementById('ct100_txtSearchText');

    
    if (searchBox.value != "") {

        var searchText = searchBox.value;

        var path = "search.aspx?searchtext=" + searchText;// + "&folderid=0&orderby=id&searchfor=all&orderdirection=ascending";

        window.location.href = path;
    } else {
        /*searchBox.focus();
        searchBox.style.backgroundColor = "#C63D33";
        searchBox.style.color = "#FFFFFF";*/
        window.location.href = "search.aspx";
    }
    return true;
}

function clearFormat() {
    /*var searchBox = document.getElementById('ct100_txtSearchText');
    
    searchBox.style.backgroundColor = "#FFFFFF";
    searchBox.style.color = "#000000";*/
    return true;
}

document.onload = checkKeycode;