Cufon.replace('#sitenav ul li a span.l span.r span', { fontFamily: 'Agency FB', fontSize:'20px' });
//Cufon.replace('.post .posttitle, .postbox .posttitle, .page-title, #reply-title, #comments-title, .trackbacks-pingbacks h3, .post .entry-title, .widget .widget_heading h3', { fontFamily: 'Agency FB', fontSize:'26px', hover:true });


jQuery (document).ready(function (){
	
	window.setTimeout(function(){
		jQuery ("#content .post:last").css("margin-bottom", "0px");
		if (isSingle!=1){		
			var cHeight = jQuery ("#content").height();		
			var sHeight = jQuery ("#sidebar").height();
			var lHeight = jQuery ("#sidebar .widget:last").height();
			var bHeight = jQuery ("#sidebar .widget:last .widget_wrap_inside").height();
			var hHeight = jQuery ("#sidebar .widget:last .widget_heading").height();
			var rHeight = cHeight - (sHeight-(lHeight-hHeight)) + 12;
			var pHeight = 0;
			jQuery ("#sidebar .widget:last .widget_wrap_inside").height(rHeight-25);
			
			var s2Height = jQuery ("#leftbar").height();
			var totalfeatured = jQuery ("#leftbar .featured").length;
			if (totalfeatured==0){
				jQuery ("#leftbar").height(cHeight);
			}else{
				jQuery ("#leftbar").height(cHeight-500);
			}
			jQuery ("#sidebar").height(cHeight);
		}
	}, 8000);
	
	window.setTimeout(function(){
		var tColHeight = jQuery ("#tCol").height();		
		jQuery ("#tCol .tCol1").height(tColHeight);
		jQuery ("#tCol .tCol2").height(tColHeight);
		jQuery ("#tCol .tCol3").height(tColHeight);
	}, 8000);
	
	jQuery('.widget').each (function (){ 
		jQuery(this).find("li").hover(function() {
			jQuery(this).addClass("over");
		}, function (){ 
			jQuery(this).removeClass("over");
		});
	});
	
	
	jQuery("ul#topNav li").hover (function (){
		var gIDs = jQuery(this).attr('id');
		if (gIDs){
			jQuery(this).find('h3 a.linkT').addClass(gIDs + "_li_hover");
			jQuery("#breadcrumb").addClass(gIDs + "_breadcrumb");
			jQuery("#subnav").addClass(gIDs + "_subnav");
			jQuery(this).find('.slideList .topNavs').addClass(gIDs + "_subnav");
		}
    },function (){
		var gIDs = jQuery(this).attr('id');
		if (gIDs){
			jQuery(this).find('h3 .linkT').removeClass(gIDs + "_li_hover");
			jQuery("#breadcrumb").removeClass(gIDs + "_breadcrumb");
			jQuery("#subnav").removeClass(gIDs + "_subnav");
			jQuery(this).find('.slideList .topNavs').removeClass(gIDs + "_subnav");
		}
    });
	
	
	jQuery('.post').each (function (){ 
		jQuery (this).find(".more-link").attr ("fast", .5); 
	});
	
	var tabContainers = jQuery('div#widget_ajax div.tabContent > div');
	tabContainers.hide().filter(':first').show();
	jQuery('div#widget_ajax ul.tabs li').click(function () {
		tabContainers.hide();
		tabContainers.filter("#tab_" + jQuery (this).attr("id")).show();
		jQuery('div#widget_ajax ul.tabs li').removeClass('selected');
		jQuery(this).addClass('selected');
		return false;
	}).filter(':first').click();
	
	jQuery(".round_pane .round_Inside .round_Inside2").corner("round 5px").parent().css('padding', '1px').corner("round 6px")
	
	/*jQuery ("#content").corner("7px");
	jQuery ("#featuredArea").corner("bl br 7px keep 1px");
	jQuery ("#feedBox").corner("tr 7px cc:#5DA3DF")
	jQuery ("#sponsors .ad:odd").css ("margin-right", "0px");
	jQuery ('#otherPost').equalHeights();*/

})
jQuery (function ($){
	var tabContainers2 = jQuery('.widget_tabber > ul');
	tabContainers2.hide().filter(':first').show();
	jQuery('.widget_tabber > ol li').click(function () {
		tabContainers2.hide();
		tabContainers2.filter("#tab_" + $(this).attr('id')).show();
		$('.widget_tabber > ol li').removeClass('active');
		$(this).addClass('active');
		return false;
	}).filter(':first').click();
})


(function(b){b.fn.ticker=function(q){var e=b.extend({},b.fn.ticker.defaults,q),m="#"+b(this).attr("id"),n=b(this).attr("tagName");return this.each(function(){function h(c){var d=0,f;for(f in c)c.hasOwnProperty(f)&&d++;return d}function i(c){if(e.debugMode)window.console&&window.console.log?window.console.log(c):alert(c)}function r(){if(a.contentLoaded==false)if(e.ajaxFeed)e.feedType=="xml"?b.ajax({url:e.feedUrl,cache:false,dataType:e.feedType,async:true,success:function(c){for(var d=count=0;d<c.childNodes.length;d++)if(c.childNodes[d].nodeName==
"rss")xmlContent=c.childNodes[d];for(c=0;c<xmlContent.childNodes.length;c++)if(xmlContent.childNodes[c].nodeName=="channel")xmlChannel=xmlContent.childNodes[c];for(c=0;c<xmlChannel.childNodes.length;c++)if(xmlChannel.childNodes[c].nodeName=="item"){xmlItems=xmlChannel.childNodes[c];var f;d=false;for(var g=0;g<xmlItems.childNodes.length;g++){if(xmlItems.childNodes[g].nodeName=="title")f=xmlItems.childNodes[g].lastChild.nodeValue;else if(xmlItems.childNodes[g].nodeName=="link")d=xmlItems.childNodes[g].lastChild.nodeValue;
if(f!==false&&f!=""&&d!==false){a.newsArr["item-"+count]={type:e.titleText,content:'<a href="'+d+'">'+f+"</a>"};count++;d=f=false}}}if(h(a.newsArr<1)){i("Couldn't find any content from the XML feed for the ticker to use!");return false}j();a.contentLoaded=true}}):i("Code Me!");else if(e.htmlFeed)if(b(m+" LI").length>0){b(m+" LI").each(function(c){a.newsArr["item-"+c]={type:e.titleText,content:b(this).html()}});j()}else{i("Couldn't find HTML any content for the ticker to use!");return false}else{i("The ticker is set to not use any types of content! Check the settings for the ticker.");
return false}}function j(){a.contentLoaded=true;b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);if(a.position==h(a.newsArr)-1)a.position=0;else a.position++;distance=b(a.dom.contentID).width();time=distance/e.speed;b(a.dom.wrapperID).find(a.dom.titleID).fadeIn().end().find(a.dom.titleElem).fadeIn("slow",s)}function s(){if(a.play){var c=b(a.dom.titleElem).width()+20;b(a.dom.revealID).css("left",c+"px");if(e.displayType=="fade")b(a.dom.revealID).hide(0,
function(){b(a.dom.contentID).css("left",c+"px").delay(20).fadeIn("slow",k)});else e.displayType!="scroll"&&b(a.dom.revealElem).show(0,function(){b(a.dom.contentID).css("left",c+"px").show();b(a.dom.revealID).css("margin-left","0px").delay(20).animate({marginLeft:distance+"px"},time,"linear",k)})}else return false}function k(){if(a.play){b(a.dom.contentID).delay(e.pauseOnItems).fadeOut("slow");e.displayType=="fade"?b(a.dom.contentID).fadeOut(e.fadeOutSpeed,function(){b(a.dom.wrapperID).find(a.dom.revealElem+
","+a.dom.contentID).hide().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).show().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).removeAttr("style");j()}):b(a.dom.revealID).hide(0,function(){b(a.dom.tickerID).delay(e.pauseOnItems).fadeOut(e.fadeOutSpeed,function(){b(a.dom.wrapperID).find(a.dom.titleElem+","+a.dom.revealElem+","+a.dom.contentID).hide().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).show().end().find(a.dom.tickerID+","+a.dom.revealID+
","+a.dom.titleID).removeAttr("style");j()})})}else b(a.dom.revealElem).hide()}function l(){a.play=false;b(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID+","+a.dom.titleElem+","+a.dom.revealElem+","+a.dom.contentID).stop(true,true);b(a.dom.revealID+","+a.dom.revealElem).hide();b(a.dom.wrapperID).find(a.dom.titleID+","+a.dom.titleElem).show().end().find(a.dom.contentID).show()}function o(){a.play=true;a.paused=false;k()}function p(c){l();switch(c){case "prev":if(a.position==0)a.position=h(a.newsArr)-
2;else if(a.position==1)a.position=h(a.newsArr)-1;else a.position-=2;b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);break;case "next":b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content)}if(a.position==h(a.newsArr)-1)a.position=0;else a.position++}var a={position:0,time:0,distance:0,newsArr:{},play:true,paused:false,contentLoaded:false,dom:{contentID:"#ticker-content",
titleID:"#ticker-title",titleElem:"#ticker-title SPAN",tickerID:"#ticker",wrapperID:"#ticker-wrapper",revealID:"#ticker-swipe",revealElem:"#ticker-swipe SPAN",controlsID:"#ticker-controls",prevID:"#prev",nextID:"#next",playPauseID:"#play-pause"}};if(n!="UL"&&e.htmlFeed===true){i("Cannot use <"+n.toLowerCase()+"> type of element for this plugin - must of type <ul>");return false}(function(){b(a.dom.wrapperID).append('<div id="'+a.dom.tickerID.replace("#","")+'"><div id="'+a.dom.titleID.replace("#",
"")+'"><span style="display: none;"><!-- --\></span></div><p id="'+a.dom.contentID.replace("#","")+'"></p><div id="'+a.dom.revealID.replace("#","")+'"><span style="display: none;"><!-- --\></span></div></div>');b(a.dom.wrapperID).removeClass("no-js").addClass("has-js");b(a.dom.tickerElem+","+a.dom.titleElem+","+a.dom.contentID).hide();if(e.controls){b(a.dom.controlsID).live("click mouseover mousedown mouseout mouseup",function(c){var d=c.target.id;if(c.type=="click")switch(d){case a.dom.prevID.replace("#",
""):a.paused=true;b(a.dom.playPauseID).addClass("paused");p(d);break;case a.dom.nextID.replace("#",""):a.paused=true;b(a.dom.playPauseID).addClass("paused");p(d);break;case a.dom.playPauseID.replace("#",""):if(a.play==true){a.paused=true;b(a.dom.playPauseID).addClass("paused");l()}else{a.paused=false;b(a.dom.playPauseID).removeClass("paused");o()}}else if(c.type=="mouseover"&&b("#"+d).hasClass("controls"))b("#"+d).addClass("over");else if(c.type=="mousedown"&&b("#"+d).hasClass("controls"))b("#"+d).addClass("down");
else if(c.type=="mouseup"&&b("#"+d).hasClass("controls"))b("#"+d).removeClass("down");else c.type=="mouseout"&&b("#"+d).hasClass("controls")&&b("#"+d).removeClass("over")});b(a.dom.wrapperID).append('<ul id="'+a.dom.controlsID.replace("#","")+'"><li id="'+a.dom.playPauseID.replace("#","")+'" class="controls"></li><li id="'+a.dom.prevID.replace("#","")+'" class="controls"></li><li id="'+a.dom.nextID.replace("#","")+'" class="controls"></li></ul>')}e.displayType!="fade"&&b(a.dom.contentID).mouseover(function(){a.paused==
false&&l()}).mouseout(function(){a.paused==false&&o()});r()})()})};b.fn.ticker.defaults={speed:0.1,ajaxFeed:false,feedUrl:"",feedType:"xml",displayType:"reveal",htmlFeed:true,debugMode:true,controls:true,titleText:"Latest",pauseOnItems:3E3,fadeInSpeed:300,fadeOutSpeed:300}})(jQuery);

jQuery(function ($) {
	$('#js-news').ticker({
		speed: 0.10,
		fadeInSpeed: 600,
		titleText: 'LATEST from DirWell.com Official Blog: '
	});
});
