﻿function productnosearch() {
{
        if(document.frmquicksearch.kw.value == 'Enter item no / term') {
            alert('Please enter a search term');
            return;
        }

        if(document.frmquicksearch.kw.value == '') {
            alert('Please enter a search term');
            return;
        }

        window.location="http://www.hotline.co.uk/search.aspx?kw=" + document.frmquicksearch.kw.value.toLowerCase();
}
}


function clear_textbox()
{
if (document.frmquicksearch.kw.value == "Enter item no / term")
document.frmquicksearch.kw.value = "";
} 


function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   
   window.location="http://www.hotline.co.uk/search.aspx?kw=" + document.frmquicksearch.kw.value.toLowerCase();
   
   return false;
   }

else
   
   return true;
}

function selectpcat_onchange() {
    {
    if (Left(document.frmsearchcat.selectpcat.value,2) != "--")

    window.location= "http://www.hotline.co.uk/" + document.frmsearchcat.selectpcat.value;
    }
}

function Left(str, n)
{
   if (n <= 0)
         return "";
   else if (n > String(str).length)
         return str;
   else
         return String(str).substring(0,n);
}