$(document).ready(function(){
						   
	/* ----------------------------------*/
	/* ---------->>> Cufon <<<-----------*/
	/* ----------------------------------*/
	// Textreplacement - http://wiki.github.com/sorccu/cufon/usage
	Cufon.replace('#content h1', { fontFamily: 'whitney medium' });
	Cufon.replace('#Programcontent h1', { fontFamily: 'whitney medium' });
	Cufon.replace('#content h2', { fontFamily: 'whitney medium' });
	Cufon.replace('#Programcontent h2', { fontFamily: 'whitney medium' });
	Cufon.replace('#countryMod h2', { fontFamily: 'whitney medium' });

	if($("div").hasClass(".articleMod")) {
		Cufon.replace('#content h3 span.title', { fontFamily: 'whitney medium' });
		Cufon.replace('#content h3 span.date', { fontFamily: 'whitney light' });
	} else {
		Cufon.replace('#content h3', { fontFamily: 'whitney medium' });	
	}
	
	Cufon.replace('#content h4', { fontFamily: 'whitney medium' });
	
	Cufon.replace('#overviewMod h2', { fontFamily: 'whitney medium' });
	Cufon.replace('#overviewMod p', { fontFamily: 'whitney medium' });
	
	Cufon.replace('#content .packagesCat th', { fontFamily: 'whitney medium' });
	Cufon.replace('#content .packagesCat td.desc1', { fontFamily: 'whitney medium' });

	Cufon.replace('.packagesCat #content th', { fontFamily: 'whitney medium' });
	Cufon.replace('.packagesCat #content td.desc', { fontFamily: 'whitney medium' });
	
	/*Cufon.replace('.program1Cat #Programcontent td', { fontFamily: 'whitney medium' });
	Cufon.replace('.program2Cat #Programcontent td', { fontFamily: 'whitney medium' });*/
	
	Cufon.replace('#relatedContent h1', { fontFamily: 'whitney medium' });
	Cufon.replace('#relatedContent .navMod a', {
		fontFamily: 'whitney medium',
		hover: true
	});
	
	Cufon.replace('#relatedProgramContent h1', { fontFamily: 'whitney medium' });
	Cufon.replace('#relatedProgramContent .navMod a', {
		fontFamily: 'whitney medium',
		hover: true
	})
	
	Cufon.replace('#footer dt', { fontFamily: 'whitney medium' });
	
	/* -----------------------------------*/
	/* ---------->>> PNGFIX <<<-----------*/
	/* -----------------------------------*/
	
	
	/* ----------------------------------------*/
	/* ---------->>> Toggleboxes <<<-----------*/
	/* ----------------------------------------*/
	
	// Set toggle animation
	$(".delegateRegistrationCat #content h2").click(toggleView);
	
	// Set div wrapper for estate ABC
	$(".estateABCCat h3").each(function(){
		$(this).nextUntil("h3").wrapAll("<div></div>");
	});
});

/**
 * Toggle View
 */
function toggleView() {
 //$(this).next().animate({height: 'toggle'}, "500", "easeOut");
 $(this).next().toggle();
 //$(this).toggleClass("expand");
}

function toggledisplay(group, numberOfChildren) {
	for (i=0; i<numberOfChildren; i++) {
		row = document.getElementById(group+"_"+i);
		if (row.style.display == "none") {
			row.style.display = "";
		} else {
			row.style.display = "none";
		}
	}
}

function toggledisplayprint(group, numberOfChildren) {
	for (i=0; i<numberOfChildren; i++) {
		row = document.getElementById(group+"_"+i);
		if (row.style.display == "none") {
			row.style.display = "";
		} else {
			return true;
		}
	}
}


/**
 * Next until
 * http://john.jquery.com/jquery/test/nextuntil.html
 */
$.fn.nextUntil = function(expr) {
 var match = [];

 // We need to figure out which elements to push onto the array
 this.each(function(){
 // Traverse through the sibling nodes
 for( var i = this.nextSibling; i; i = i.nextSibling ) {
 // Make sure that we're only dealing with elements
 if ( i.nodeType != 1 ) continue;

 // If we find a match then we need to stop
 if ( jQuery.filter( expr, [i] ).r.length ) break;

 // Otherwise, add it on to the stack
 match.push( i );
 }
 });

 return this.pushStack( match, arguments );
};




