﻿
        $(document).ready(function () {
            try {
                if ($(".sc01") && $("#rightBar")) {
                    setTimeout(setHeights, 500);
                }

                if (!Modernizr.input.placeholder) {
                    $("input,textarea").each(function () {
                        if ($(this).val() == "" && $(this).attr("placeholder") != "") {
                            $(this).val($(this).attr("placeholder"));
                            $(this).focus(function () {
                                if ($(this).val() == $(this).attr("placeholder")) $(this).val("");
                            });
                            $(this).blur(function () {
                                if ($(this).val() == "") $(this).val($(this).attr("placeholder"));
                            });
                        }
                    });
                }
                
            }
            catch (ex) { alert(ex.message); }
        });

        function setHeights() {

            var sc01 = $(".sc01").css("height").replace("px", "");
            var rightBar = $("#rightBar").css("height").replace("px", "");

            if (parseInt(sc01) < parseInt(rightBar)) {
                $("#rightBar").css("border-left", "1px solid #c5c5c5");
                $(".sc01").css("border-right", "none");
            }
        }

        function siteSearch() {
            if ($("#search_keywords")) {
                if ($.trim($("#search_keywords").val()).length != 0) {
                    $("#search_keywords").val($.trim($("#search_keywords").val()));
                    $("#frmSearch").attr("method","get");
                    $("#frmSearch").attr("action","/SiteSearch/");
                    return true;
                } else {
                    alert("Please enter a keyword.");
                }
            }
            return false;
        }
