$("div#pageViwer_brochure_editor_ctl00_pnlComments").css("display", "none");
$("span.randomguestbook-info").css("display", "none");
var l = window.location.href.split(window.location.protocol + "//" + window.location.host)[1];
$(document).ready(function() {
    if (l == "/feedbacks" || l == "/feedbacks/" || l == "/Default.aspx?page=feedbacks") {
        //alert("feedback");
        $(".guestbook-info").each(function() {
            var righthtml = $(this).html();
            righthtml = righthtml.replace(/&nbsp;/g, " ");
            $(this).html(righthtml);
        });
    }
    var html = $("span#pageViwer_brochure_editor_ctl00_CommentText1").html();
    html = html.replace(/&nbsp;/g, " ");

    var count = html.split(" ");
    var tmp = "";
    var total = 0;
    if (count.length > 20) { total = 20; } else { total = count.length; }
    for (var i = 0; i < total; i++) {
        tmp += count[i];
        if ((i + 1) != total) { tmp += " "; }
    }
    html = tmp + " ... read more";

    //html = '<div class="quotehs"><span><a href="/feedbacks/"><img src="/uploads/feedbackopen2.gif" id="start" />'+html+'</a><img src="/uploads/feedbackclose2.gif" /></span><div class="breaker">&nbsp;</div></div>';
    html = '<h1 id="randomheadertxt">Our customers say...</h1><div class="quotehs"><img src="/uploads/christmashamperstart.png" id="start" /><a href="/feedbacks/">' + html + '</a><img src="/uploads/christmashamperend.png" style="float: right!important; margin: 0;" /></div>';
    $("span#pageViwer_brochure_editor_ctl00_CommentText1").replaceWith(html);
    $("div#pageViwer_brochure_editor_ctl00_pnlComments").css("display", "block");
    //alert(html);
    //alert("test");
});

function cleartextfield() {
    var a = "";
    $("input#maintext_search").attr("value", a);
}

// active date picker
$(document).ready(function() {
    if (l == "/Checkout.aspx" || l == "/Default.aspx?page=Checkout") {
        $(".checkout_delivery_date").each(function() {
            $(this).removeAttr("disabled");
        });
    }
});
