$(document).ready(function() {
	equalHeight($(".item p"));
	$(".home_widgets .widget:first").css("margin-left", "0");
	$(".footernav  li:last").css("border-right", "0");
	$(".navigation .alignleft:empty").hide();
	$(".navigation .alignright:empty").hide();
	$(".comment-nav .alignright:empty").hide();
	$(".comment-nav .alignleft:empty").hide();
	$(".navigation:empty").hide();
	$(".comment-nav:empty").hide();
	$('ul.sf-menu').superfish();
	var select=$('a[href$=".bmp"],a[href$=".gif"],a[href$=".jpg"],a[href$=".jpeg"],a[href$=".png"],a[href$=".BMP"],a[href$=".GIF"],a[href$=".JPG"],a[href$=".JPEG"],a[href$=".PNG"]');select.attr('rel','fancybox');select.fancybox({'overlayOpacity':'0.7','overlayColor':'#fff','autoScale':false,'centerOnScroll':false,'showCloseButton':true});
});

DD_roundies.addRule('.container, .qbutton a, blockquote,.comment-reply-link', '10px', true);
DD_roundies.addRule('#sidebarsearch div, .navigation a, .comment-nav a', '20px', true);
DD_roundies.addRule('.wp-caption,.portfnav a', '5px', true);
DD_roundies.addRule('.commentlist li', '10px', true);
Cufon.replace('#pagenav a', {
	textShadow: '1px 1px #ffffff',
		hover: {
		color: '-linear-gradient(#464d4f, #046b9b)'
	}

});

Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('h5');

function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
(function(){$.fn.bgscroll=$.fn.bgScroll=function(options){if(!this.length)return this;if(!options)options={};if(!window.scrollElements)window.scrollElements={};for(var i=0;i<this.length;i++){var allowedChars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';var randomId='';for(var l=0;l<5;l++)randomId+=allowedChars.charAt(Math.floor(Math.random()*allowedChars.length));this[i].current=0;this[i].scrollSpeed=options.scrollSpeed?options.scrollSpeed:70;this[i].direction=options.direction?options.direction:'h';window.scrollElements[randomId]=this[i];eval('window[randomId]=function(){var axis=0;var e=window.scrollElements.'+randomId+';e.current += 1;if (e.direction == "h") axis = e.current + "px 0";else if (e.direction == "v") axis = "0 " + e.current + "px";else if (e.direction == "d") axis = e.current + "px " + e.current + "px";$( e ).css("background-position", axis);}');setInterval('window.'+randomId+'()',options.scrollSpeed?options.scrollSpeed:70);}
return this;}})(jQuery);
(function($){$.fn.s3Slider=function(vars){var element=this;var timeOut=(vars.timeOut!=undefined)?vars.timeOut:4000;var current=null;var timeOutFn=null;var faderStat=true;var mOver=false;var items=$("#"+element[0].id+"Content ."+element[0].id+"Image");var itemsSpan=$("#"+element[0].id+"Content ."+element[0].id+"Image .bottom");items.each(function(i){$(items[i]).mouseover(function(){mOver=true;});$(items[i]).mouseout(function(){mOver=false;fadeElement(true);});});var fadeElement=function(isMouseOut){var thisTimeOut=(isMouseOut)?(timeOut/2):timeOut;thisTimeOut=(faderStat)?10:thisTimeOut;if(items.length>0){timeOutFn=setTimeout(makeSlider,thisTimeOut);}else{console.log("Poof..");}}
var makeSlider=function(){current=(current!=null)?current:items[(items.length-1)];var currNo=jQuery.inArray(current,items)+1
currNo=(currNo==items.length)?0:(currNo-1);var newMargin=$(element).width()*currNo;if(faderStat==true){if(!mOver){$(items[currNo]).fadeIn((timeOut/6),function(){if($(itemsSpan[currNo]).css('bottom')==0){$(itemsSpan[currNo]).slideUp((timeOut/6),function(){faderStat=false;current=items[currNo];if(!mOver){fadeElement(false);}});}else{$(itemsSpan[currNo]).slideDown((timeOut/6),function(){faderStat=false;current=items[currNo];if(!mOver){fadeElement(false);}});}});}}else{if(!mOver){if($(itemsSpan[currNo]).css('bottom')==0){$(itemsSpan[currNo]).slideDown((timeOut/6),function(){$(items[currNo]).fadeOut((timeOut/6),function(){faderStat=true;current=items[(currNo+1)];if(!mOver){fadeElement(false);}});});}else{$(itemsSpan[currNo]).slideUp((timeOut/6),function(){$(items[currNo]).fadeOut((timeOut/6),function(){faderStat=true;current=items[(currNo+1)];if(!mOver){fadeElement(false);}});});}}}}
makeSlider();};})(jQuery);
