//all non jQuery Scripts

//Placeholders fix for non HTML5 browsers (IE SUX!!!!)
function activatePlaceholders() {
	var detect = navigator.userAgent.toLowerCase(); 
	if (detect.indexOf("safari") > 0) return false;
	var inputs = document.getElementsByTagName("input");
	for (var i=0;i<inputs.length;i++) {
	  if (inputs[i].getAttribute("type") == "text") {
	   if (inputs[i].getAttribute("placeholder") && inputs[i].getAttribute("placeholder").length > 0) {
	    inputs[i].value = inputs[i].getAttribute("placeholder");
	    inputs[i].onclick = function() {
	     if (this.value == this.getAttribute("placeholder")) {
	      this.value = "";
	     }
	     return false;
	    }
	    inputs[i].onblur = function() {
	     if (this.value.length < 1) {
	      this.value = this.getAttribute("placeholder");
	     }
	    }
	   }
	  }
	}
}
window.onload=function() {
activatePlaceholders();
}



//Begin jQuery Functions

jQuery(document).ready(function() {


	//Lazyloading the image
	jQuery("img").lazyload({
		threshold	: 200,
		placeholder : "../images/grey.gif",
		effect      : "fadeIn"
	});
	
	
	//rollover move effect
	jQuery(".menu a").mouseover(function(){
		jQuery(this).animate({ 'right' : '-10px' }, 500);
	});
	
	jQuery(".menu a").mouseout(function(){
		jQuery(this).animate({ 'right' : '0px' }, 500);
	});
	
	jQuery(".widget_recent_entries a").mouseover(function(){
		jQuery(this).animate({ 'right' : '-10px' }, 500);
	});
	
	jQuery(".widget_recent_entries a").mouseout(function(){
		jQuery(this).animate({ 'right' : '0px' }, 500);
	});
	
	jQuery("a.button").mouseover(function(){
		jQuery(this).animate({ 'right' : '-10px' }, 500);
	});
	
	jQuery("a.button").mouseout(function(){
		jQuery(this).animate({ 'right' : '0px' }, 500);
	});
	
	jQuery("input.button").mouseover(function(){
		jQuery(this).animate({ 'right' : '-10px' }, 500);
	});
	
	jQuery("input.button").mouseout(function(){
		jQuery(this).animate({ 'right' : '0px' }, 500);
	});
	
	
	//Coda Slider
	jQuery('#coda-slider-1').codaSlider({
		autoSlide: true,
		autoSlideInterval: 6000,
		dynamicArrows: false,
		dynamicTabsPosition: 'bottom',
		dynamicTabsAlign: 'left',
		autoHeight: false
	});
	
	//tesimonials rotator
	jQuery('ul#testimony-rotator').cycle({
		
		fx:	'fade',
		speed:	4000
		
		});
		
	//resizing logos on homepage
	$('.logo img').each(function(){
	    $(this).width($(this).width() * 0.38);
	});
	$('.logo img').each(function(){
	    $(this).height($(this).height() * 0.38);
	});
	
	$('.logo.jd img').each(function(){
	    $(this).width($(this).width() * 0.70);
	});
	$('.logo.jd img').each(function(){
	    $(this).height($(this).height() * 0.70);
	});
	
	

});

//End jQuery Functions
