$(document).ready(function() {
	
	$("#contactForm").slideLock({

        // style these options with css to fit your application
	labelText: "Slide to Unlock - proves you're a human!",
	noteText: "",
	lockText: "Locked",
	unlockText: "Unlocked",
	iconURL: "wp-content/themes/drfunk/images/lock.png",
	inputID: "sliderInput",
	onCSS: "#fff",
	offCSS: "#5e84a2",
	inputValue: 7,
	saltValue: 9,
	checkValue: 16,
	js_check: "js_check",
	submitID: "#submit",
	debug: false

    });

	if($('.fb').exists()){
		$(".fb").fancybox({});
	}
	
	
	if($('.images img').length > 1){	
	
    	$('.images').cycle({
			fx:     'fade',
		    speed:  'slow',
		    pager:  '.controls',
		    timeout: 4000,
		    pagerAnchorBuilder: function(idx, slide) { 
		        // return selector string for existing anchor 
		        return '<li><a href="#">' + idx + '</a></li>'; 
		    } 
	
		});
		
		
		
	}
	if($('.images img').length < 2){
			$('.controls').hide();
		}
	if($('.services').exists()){
			$('.services li' ).accordion({ collapsible: true,  active: false });
			
		}
		if($('#the-faqs li').exists()){
			$('#the-faqs li' ).accordion({ collapsible: true,  active: false });
			
		}
		
});

$.fn.exists = function(){return $(this).length>0}
