$("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];
if (l.substring(1,8) != "Invoice") {
	$(document).ready(function() {
		if (l == "/feedback" || l == "/feedback/" || l == "/Default.aspx?page=feedback") {
		
			$(".guestbook-info").each(function() {
				var righthtml = $(this).html();
				righthtml = righthtml.replace(/&nbsp;/g," ");
				$(this).html(righthtml);
			});
		}
		var html = $("span#pageViwer_additional_content1_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">What our customers say...</h1><div class="quotehs"><img src="/uploads/scottishgiftstart.png" id="start" /><a href="/feedback/">'+html+'</a><img src="/uploads/scottishgiftend.png" style="float: right!important; margin: 0;" /></div>';
		$("span#pageViwer_additional_content1_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(i){
			$(this).removeAttr("disabled");
		});
	}
});
