$(document).ready(function() {
	// Exsisto-logo Over
	$(".project_gallery").noContext();
	$("#panelContent").noContext();

	
	
	$('.exsisto').hover(function() {
		$(this).attr("src", "/images/exsisto-logo-over.gif");
	}, function() {
		$(this).attr("src", "/images/exsisto-logo.gif");
	});
	// Home page images
	$("#hp .menu-title").fadeTo(1, 0);
	$("#hp .img-cat").hover(function() {
		$(this).find(".img-over").fadeTo(100, 0);
		$(this).find(".img-over").next().next().fadeTo(200, 0.7);
	}, function() {
		$(this).find(".img-over").fadeTo(100, 1);
		$(this).find(".img-over").next().next().fadeTo(100, 0);
	});
	
	$("#pad1 .ll").append("<span class='pad1-bg'></span>");
	$("#pad1 .pad1-bg").fadeTo(1, 0.7);
	// Scroller overs
	$("#scroller li").hover(function() {
		$(this).prepend("<div class='li-over'></div>");
	}, function() {
		$(this).children(".li-over").remove();
	});
	$('#panelContent #pad1 .left.ll a').each(function () {
		$(this).attr('target', '_blank');
	});
});

function validateForm() {
	border_style = '1px solid red';
	is_ok = true;
	name_field= $("#contacts_name");
	mail_field = $("#contacts_email");
	message_field = $("#contacts_message");
	if (name_field.val() === "") {
		name_field.css('border', border_style);
		is_ok = false;
	}
	else {
		name_field.css('border', 0);
	}
	if (mail_field.val().length < 3) {
		mail_field.css('border', border_style);
		is_ok = false;
	}
	else {
		mail_field.css('border', 0);
	}
	if (message_field.val() === "") {
		message_field.css('border', border_style);
		is_ok = false;
	}
	else {
		message_field.css('border', 0);
	}
	if (is_ok) {
		$("#issubmitted").val("1");
		return true;
	}
	return false;
}

function enlarge(hash) {
	$(".visible").fadeOut(500, function(){
		$(".visible").removeClass("visible").addClass("hidden");
		$("#"+hash).fadeIn(500).removeClass("hidden").addClass("visible");
	});
	return false;
}
