//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({
		placeholder : "/wp-content/themes/ADC-v1/images/grey.gif",
		effect      : "fadeIn"
	});
	
	
	//Make buttons move
	jQuery("a.slidebtn").mouseover(function(){
		jQuery(this).animate({ 'marginLeft' : '20px' }, 100);
	});
	
	jQuery("a.slidebtn").mouseout(function(){
		jQuery(this).animate({ 'marginLeft' : '0px' }, 100);
	});
	
	jQuery("input.button").mouseover(function(){
		jQuery(this).animate({ 'marginLeft' : '20px' }, 100);
	});
	
	jQuery("input.button").mouseout(function(){
		jQuery(this).animate({ 'marginLeft' : '0px' }, 100);
	});
	
	//Initializing Superfish
//	jQuery(function(){
//		jQuery('ul#menu-main-menu').superfish({
//			autoArrows: false
//		}).find('ul').bgIframe({opacity:false});
//	});

});

//End jQuery Functions
