jQuery(document).ready(function($){
	var timer = 0;

	$("a[rel^='prettyPhoto']").prettyPhoto({showTitle: true, theme: 'light_rounded'});

	$(".icon-fade-feat").bind("mouseenter",function(){
		timer = setTimeout(function(){
			$(".icon-fade").not(".icon-fade-feat").animate({
				opacity: 0.4
			}, 200);
		}, 200);
	}).bind("mouseleave",function(){
		clearTimeout(timer);
		$(".icon-fade").not(".icon-fade-feat").animate({
			opacity: 1
		}, 200);
	});

	$(".icon-fade-buy").bind("mouseenter",function(){
		timer = setTimeout(function(){
			$(".icon-fade").not(".icon-fade-buy").animate({
				opacity: 0.4
			}, 200);
		}, 200);
	}).bind("mouseleave",function(){
		clearTimeout(timer);
		$(".icon-fade").not(".icon-fade-buy").animate({
			opacity: 1
		}, 200);
	});

	$(".icon-fade-stop").bind("mouseenter",function(){
		timer = setTimeout(function(){
			$(".icon-fade").not(".icon-fade-stop").animate({
				opacity: 0.4
			}, 200);
		}, 200);
	}).bind("mouseleave",function(){
		clearTimeout(timer);
		$(".icon-fade").not(".icon-fade-stop").animate({
			opacity: 1
		}, 200);
	});


	empty_str = "";
	default_str = "Your Domain Name";
	error_message = "Please Enter Your Domain"

	$("#domainsearch_input").click(function(){
		$(this).removeClass("hostway-buy-error");
		if (jQuery.trim($(this).attr("value")) == default_str || jQuery.trim($(this).attr("value")) == error_message)
			$(this).attr("value",empty_str);
	});

	$("#domainsearch_input").blur(function(){
		if (jQuery.trim($(this).attr("value")) == empty_str)
			$(this).attr("value",default_str);
	});

	$("#hostway-buy-home").submit(function(event){
		input_box_value = jQuery.trim($("#domainsearch_input").attr("value"));
		empty_str = "";
		default_str = "Your Domain Name";
		error_message = "Please Enter Your Domain"
		
		if (input_box_value == empty_str || input_box_value == default_str || input_box_value == error_message)	{
			$("#domainsearch_input").addClass("hostway-buy-error");
			$("#domainsearch_input").attr("value",error_message);
			event.preventDefault();
		}
	});

})