﻿function OpenPopUpWindow(url) {
    newwindow = window.open('Popup/' + url, 'name', 'height=600,width=500,top=300,left=200');
    if (window.focus) { newwindow.focus() }
}


function switchMenu(obj, image) {

    var el = document.getElementById(obj);
    var imageItem = document.getElementById(image);
    if (el.style.display != "none") {
        el.style.display = 'none';
        imageItem.src = 'Images/expand_tool_arrow.gif';
    }
    else {
        el.style.display = '';
        imageItem.src = 'Images/collapse_tool_arrow.gif';
    }
}


function entsub(evt, ourform, pageUrl, txtValue) {
    var key;
    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = evt.which;     //firefox

    if (key == 13) {
        sendSearchQuery('pn');
        return false;
    }
}

function entsub(evt, ourform, pageUrl) {
    var key;
    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = evt.which;     //firefox

    if (key == 13) {
        window.location = pageUrl;
        return false;
    }
}

function entsub2(evt, ourform, pageUrl) {

    var key;
    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = evt.which;     //firefox

    if (key == 13) {
        window.location = pageUrl + document.getElementById("ctlSubNav_txtSearch").value;
        return false;
    }
}

function sendSearchQuery(strType) {
    var url = "search.html?q=" + document.forms[0].ctlSubNav$txtSearch.value;
    if (strType != "") {
        url += "&type=" + strType;
    }
    window.location = url;
    return false;
}

function switchSearchMenu(obj) {

    var el = document.getElementById(obj);
    if (el.style.display != "none") {
        el.style.display = 'none';
    }
    else {
        el.style.display = '';
    }
}

