﻿function SearchProd()
{
    var key = document.getElementById("txtKey").value;
    var cid = document.getElementById("ddlType").value;
    var isUrlWrite = document.getElementById("hdisUrlWrite").value;
   
    if(isUrlWrite == 1)
    {
        window.location.href = "/s/"+encodeURI(key)+"-"+cid+"/";
    }
    else
    {
        window.location.href = "/Search.aspx?key="+encodeURI(key)+"&cid="+cid+"";
    }
}

function SearchProd2()
{
    var key = document.getElementById("txtKey2").value;
    var isUrlWrite = document.getElementById("hdisUrlWrite").value;
    if(isUrlWrite == 1)
    {
        window.location.href = "/s/"+encodeURI(key)+"-0/";
    }
    else
    {
        window.location.href = "/Search.aspx?key="+encodeURI(key)+"";
    }
}

function KeyDown()
{
    if (event.keyCode == 13)
    {
       SearchProd();
       return false;
    }
}
