﻿function clearIfDefault(el){
  if (el.val() == el.attr("title"))
    el.val('');
  el.css({"color" : ""})

}
function defaultIfEmpty(el){
  if (el.val() == ''){
    el.val(el.attr("title"));
    el.css({"color" : "#CCC"})
  }
}
function bookmarkthis(title, url) {
    if (window.sidebar) { // firefox
        window.sidebar.addPanel(title, url, "");
    } else if (document.all) { // IE
        window.external.AddFavorite(url, title);
    } else if (window.opera && window.print) { // opera
        var elem = document.createElement('a');
        elem.setAttribute('href', url);
        elem.setAttribute('title', title);
        elem.setAttribute('rel', 'sidebar');
        elem.click();
    }
}

if (typeof (jQuery) != 'undefined') {
    $(document).ready(function () {

        $(".searchBox").live("keypress", function (a) {
            if (a.keyCode == 13) {
                $(".searchButton").click();
                return false;
            }
        });

        $(".cid, .cid2").each(function () {
            $(this).val($(this).attr("title"));
            $(this).css({ "color": "#CCC" })
        });
        $(".cid, .cid2").focus(function () {
            clearIfDefault($(this));
        });
        $(".cid").blur(function () {
            defaultIfEmpty($(this));
        });
    });
}


