/*
	site: 		Vanderbil Homes
	author: 	johan de silva
	company:	Phoenix plc
	index:
			1. > BEFORE
			2. EQUAL HEIGHT COLUMNS
			3. SUPERFISH MENU
			4. EXTERNAL SITES / OPEN NEW WINDOW
			5. FANCY BOX 	
			6. DYNAMIC CONTENT
*/

////////////////// BEFORE //////////////////

$(document).ready( function() {
	$("#content h1 span, #content h2 span, #content h3 span, #content h4 span").before("&gt; ");
	$("#development-menu ul li a").before("&gt; ");
});

/////////////// EQUAL HEIGHT COLUMNS  //////////

//$(document).ready(function(){
//	movies to DYNAMIC CONTENT after click
// $("#development-left, .right-col, #development-photos").equalizeCols();
//});


////////////////// SUPERFISH MENU //////////////////

jQuery(function(){
	jQuery('ul.sf-menu').superfish();
});


////////////////// EXTERNAL SITES / OPEN NEW WINDOW //////////////////

$(document).ready( function() {
    $('A[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    }); 
});

////////////////// FANCYBOX //////////////////

$(document).ready(function(){
	// duplicated in behaviours-forum					   
	$(".fancyboxlink").fancybox({
		'frameWidth': 430,
		'frameHeight': 400,		
		'overlayShow':	true,
		'overlayOpacity': 0.7
	});
});

////////////////// DYNAMIC CONTENT //////////////////
/* jQuery Dynamic content and equalizeCols call by Johan */
$(document).ready(function(){
	$('#dynamic div.page').hide(); 
	$('#dynamic div.page:first').show();
	$("#development-left, #dynamic").equalizeCols(); // this calls the function to equalise height of cols
	$('#development-menu ul li:first').addClass('selected');
	$('#development-menu ul li a').click(function(){
		$('#development-menu ul li').removeClass('selected');
		$(this).parent().addClass('selected');
		var currentTab = $(this).attr('href');
		$('#dynamic div.page').hide();
		$(currentTab).show();
		//document.getElementById("development-left").style.display='none';
		//alert(document.getElementById("development-left").style.display);
		$("#development-left, #dynamic").equalizeCols(); // this calls the function to equalise height of cols
		return false;
	});
});

