$(document).ready(function() {
	
	//Outbound Links
	$('a[href^="http://"]').addClass('external').attr("target", "_blank");
	$('a[href^="https://"]').addClass('external').attr("target", "_blank");
	
	// Slideshow
	$('#slideshow').coinslider({ width: 339, height:219, navigation: false, effect:"straight", delay: 5000, links:false });
	$('#slideshow2').coinslider({ width: 339, height:219, navigation: false, effect:"straight", delay: 15000, links:false });

	// Tabs
	$(".tab-content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab-content:first").show(); //Show first tab content
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab-content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

//Cufon
if(navigator.appVersion.indexOf("MSIE 5.5") == -1) {
	Cufon.replace('#nav ul li a ', { fontFamily: 'Dax', hover:true });
	Cufon.replace('.event-date', { fontFamily: 'Dax', hover:true });
	Cufon.replace('h2', { fontFamily: 'Dax', hover:true });
	Cufon.replace('h3', { fontFamily: 'Dax', hover:true });
	Cufon.replace('h5', { fontFamily: 'Dax', hover:true });
	Cufon.replace('.title_grey', { fontFamily: 'Dax', hover:true });
	Cufon.replace('.title_red', { fontFamily: 'Dax', hover:true });
	Cufon.replace('.title_blue', { fontFamily: 'Dax', hover:true });
}

// Form
function clearText(srcObj){
if(srcObj.title == srcObj.value) srcObj.value = "";
}

function writeText(srcObj){
if(srcObj.value == "") srcObj.value = srcObj.title;
}

function safeOnChange() {
}
