$(document).ready(function() {
	
// SLIDESHOWS
$("#slides").cycle({
	timeout: 6000,
	speed: 1500	
});
	
// VALIDATION
$("#contact-form").validate();
	
// FAQ
	$("#faqs p, #faqs ul, #faq ol").hide();
	$("#faqs h3").css('cursor','pointer');
	$("#faqs h3").click(function(){
		$(this).toggleClass('active');
		$(this).nextUntil("h3").slideToggle(200)		
		return false;		
	});	
	$("#faqs h3:first").addClass('active').nextUntil("h3").show();
	
	
	
// EQUAL COL HEIGHT
var max_height = 0;
$("div.same-height").each(function(){
if ($(this).height() > max_height) { max_height = $(this).height(); }
});
$("div.same-height").height(max_height);


// CLICKABLE CONTAINER
$('.container').click(function() {
       var href = $(this).find("a").attr("href");
       if(href) {
           window.location = href;
       }
});
	
// STIPED TABLES
$("table.striped tr:odd").addClass("alt-row");
	
	
// STYLE LINKS
$("a[href$='.pdf']").addClass("pdf");
$("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 
$("a[href^='mailto:']").addClass("email");
$('a').filter(function() {
    return this.hostname && this.hostname !== location.hostname;
}).addClass("external").attr("target", "_blank");


// HTML5 Placeholder //
// Return if native support is available.	
if ("placeholder" in document.createElement("input")) return;
	$(':input[placeholder]').each(function() {
		setupPlaceholder($(this));
	}); 
	$('form').submit(function(e) {
		clearPlaceholdersBeforeSubmit($(this));
	});
function setupPlaceholder(input) {
	var placeholderText = input.attr('placeholder');
	if (input.val() === '') input.val(placeholderText);
	input.bind({
		focus: function(e) {
			if (input.val() === placeholderText) input.val('');
		},
		blur: function(e) {
			if (input.val() === '') input.val(placeholderText); 
		}
	});
}
function clearPlaceholdersBeforeSubmit(form) {
	form.find(':input[placeholder]').each(function() {
		var el = $(this);
		if (el.val() === el.attr('placeholder')) el.val('');
	});
}

});
 
  
