// David Moore
function removeHTMLTags(source){
	if(document.getElementById && document.getElementById(source)){
		var strInputCode = document.getElementById(source).innerHTML;
		var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
		//alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);	
		return (strTagStrippedText);
	}	
}

function dealerDetails() {
	//SET ALL DIVS UNDER THE ANCHORS AS HIDDEN WHEN PAGE LOADS
	$("div.dealerDetails").css({ position: "absolute", top: "0", left: "-9999px"});
	$("div#dealerDetailsWrapper").css({display: "none" });
	
	//FUNCTION FOR SHOWING DEALER DETAILS ON RIGHT OF PAGE
	$("ul.dealers ul li").click(function()
	{
		$(this).blur();
		$("div#dealerDetailsWrapper").css({display: "none" });
		var dealerDetails = $(this).find("div.dealerDetails").html();
		$("div#dealerDetailsWrapper").html(dealerDetails).animate({opacity: 'show', height: 'show' }, "slow");
		return false;			
	});			
}

function faqDetails() {
	//SET ALL DIVS UNDER THE ANCHORS AS HIDDEN WHEN PAGE LOADS
	$("div.faqDetails").css({ display: "none"});
	
	//FUNCTION FOR SHOWING FAQ DETAILS ON RIGHT OF PAGE
	$("ul.faqs li").click(function()
	{
		$(this).blur();
		$("div.faqDetails").animate({opacity: 'hide', height: 'hide' }, "slow");
		var faqDetails = $(this).find("div.faqDetails").animate({opacity: 'show', height: 'show' }, "slow");
		return false;			
	});			
}

function confirmDelete(delUrl, delMsg) {
  if (confirm(delMsg)) {
    document.location = delUrl;
  }
}