﻿// example: $("#content").find(".twoCol > .col").equalHeight();
// For resize, include http://github.com/cowboy/jquery-resize/raw/v1.1/jquery.ba-resize.min.js
jQuery.fn.equalHeight = function(s){ var n = 0;
	this.data("eqHgtSelector", this)
	.each(function(){ var h = jQuery(this).height(); if( h > n ) n = h })
	.css( jQuery.browser.version<7.0&&jQuery.browser.msie?"height":"minHeight", n );
	!s && this.resize(function(){ jQuery(this).data("eqHgtSelector").equalHeight(true) })
}

$(function(){
	
	$("#pageWrap").dcCreate({
		imgPrefix: "/images/theme/pagewrap-fade-",
		fileType: ".png",
		expand: "0 18",
		radius: 0,
		position: "ouside",
		resize: "img",
		exclude: "top-left,top,top-right,bottom-left,bottom,bottom-right"
	}).find(">.dcItem:not(.dcleft,.dcright)").css("display","none");
	
	if( $.browser.msie ){
		DD_roundies.addRule(".sidebar #sidebarRight", "8px 8px 0 0");
		
		$("#navWrap").append('<span class="top-left"><img src="/images/theme/navwrap-top-left.png" border="0" /></span><span class="top-right"><img src="/images/theme/navwrap-top-right.png" border="0" /></span>');
	}
	
	$("body.sidebar #mainContent, body.sidebar #sidebarRight").equalHeight();
	
	// Add Class for h1+h2
	$("#content").find("h1:has(+h2), h2:has(+h3), h3:has(+h4)").addClass("hasHeading");
	
})
