﻿/* */
function textCounter(e, field, countfield, maxlimit) 
{ 
    var txtid=document.getElementById(field);
    var lblid=document.getElementById(countfield);
    if (txtid.value.length > maxlimit) // if too long...trim it!
    {			
        txtid.value = txtid.value.substring(0, maxlimit);
    }   
    else 
    {
        lblid.innerText=maxlimit - (txtid.value.length+1) + " characters remaining.";
        lblid.textContent = maxlimit - (txtid.value.length+1) + " characters remaining.";
    }
} 

/* */
function clickButton(e, buttonid)
{ 
  var bt = document.getElementById(buttonid); 
  if (typeof bt == 'object')
  { 
    if(navigator.appName.indexOf("Netscape")>(-1))
    { 
        if (e.keyCode == 13)
        { 
            bt.click(); 
            return false; 
        } 
    } 
    if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
    { 
        if (event.keyCode == 13)
        { 
            bt.click(); 
            return false; 
        }
    } 
  }
}

/* */   
function SetKeyword(obj,id)
{
    if (id==0 && obj.value=='')
    {
        obj.value='Enter a keyword or Item Code';
    }
    else if (id==1 && obj.value=='Enter a keyword or Item Code')
    {
       obj.value='';
    }
}


	 
