﻿function FocusSearch(target, text)
{
    if(target.value == text)
    {
        target.value = '';
        target.style.color = '#000000';
    }
}
function BlurSearch(target, text)
{
    if(target.value == '')
    {
        target.value = text;
        target.style.color = '#888888';
    }
}
function clickButton(e, buttonid){
    var evt = e ? e : window.event;
    var bt = document.getElementById(buttonid);

    if (bt){
      if (evt.keyCode == 13){
            bt.click();
            return false;
      }
    }
}


function getCookie(name) {
    var start, end;
    if (document.cookie.length > 0) {
        start = document.cookie.indexOf(name + "=");
        if (start != -1) {
            start = start + name.length+1;
            end = document.cookie.indexOf(";", start);
            if (end == -1) end = document.cookie.length; {
                return unescape(document.cookie.substring(start, end));
            }
        }
    }
    return "";
}

function setCookie(name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = name+ "=" + escape(value)+
    ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString());
}
