$(document).ready(function(){

	/*$('.banners').cycle({
		fx:     'scrollRight',
		speed:  2000,
		timeout: 0,
		next:   '#next',
		prev:   '#prev'
	});*/
	
	var current = 1;
	var elements = $(".banners-mask div.banner").size();
	var width = $(".banner").width(); 
	$("#prev").hide();
	if(elements == 1) $("#next").hide();
	
	
	$("#next").click(function(){		
	
		if(current < elements)
		{
			
			$(".banner").animate({"left": "-=" + width + "px"}, "slow");
			current ++;
			if(current == elements) $("#next").hide(); 
			if(current > 1) $("#prev").show(); 
		}
		
	
	});
	
	$("#prev").click(function(){
		if(current > 1)
		{
						
			$(".banner").animate({"left": "+=" + width + "px"}, "slow");
			current--;
			if(current < elements) $("#next").show();
			if(current < 2) $("#prev").hide(); 
		}
	
	}); 
	
	
	$(".contact-top-open").click(function(){
		$("#contact-top-hide").slideDown();
	});
	
	
	var hide = false;
	
	$("#contact-top-hide-close").click(function(){
		$("#contact-top-hide").slideUp();
	});
	
	/*$('.contact-top-open').click(function() {
		
		$('#contact-top-hide').toggle(showOrHide());	
	
	});*/
	
	function showOrHide()
	{
		if (hide) {
			//alert("false");
			hide = false;
			$('#contact-top-hide').slideUp(400);
		}else {
			//alert("true");
			hide = true;
			$('#contact-top-hide').slideDown(400);
		}
	}
	
	
	$('#top-name').click(function() {
		var name = $("#top-name").val()
		if(name == "Name") { $("#top-name").val(''); }	
	});
	
	$('#top-e-mail').click(function() { 
		var name = $("#top-e-mail").val()
		if(name == "E-mail") { $("#top-e-mail").val(''); }	
	});

	$('#top-company').click(function() {
		var name = $("#top-company").val()
		if(name == "Company") { $("#top-company").val(''); }	
	});
	
	$('#top-message').click(function() {
		var name = $("#top-message").val()
		if(name == "Message") { $("#top-message").val(''); }	
	});
	
	$('#top-phone').click(function() {
		var name = $("#top-phone").val()
		if(name == "Phone") { $("#top-phone").val(''); }	
	});
	
	$('#s').click(function() {
		var name = $("#s").val()
		if(name == "Type keyword") { $("#s").val(''); }	
	});
	
	$('#name-1').click(function() {
		var name = $("#name-1").val()
		if(name == "Name") { $("#name-1").val(''); }	
	});
	
	$('#name-2').click(function() {
		var name = $("#name-2").val()
		if(name == "Name") { $("#name-2").val(''); }	
	});
	
	$('#e-mail-1').click(function() {
		var name = $("#e-mail-1").val()
		if(name == "E-mail") { $("#e-mail-1").val(''); }	
	});
	
	$('#e-mail-2').click(function() {
		var name = $("#e-mail-2").val()
		if(name == "E-mail") { $("#e-mail-2").val(''); }	
	});
	
	$('#e-mail-1').mouseover(function() {
		var name = $("#e-mail-1").val()
		if(name == "") { $("#e-mail-1").val('E-mail'); }	
	});
	
	$('#e-mail-2').mouseover(function() {
		var name = $("#e-mail-2").val()
		if(name == "") { $("#e-mail-2").val('E-mail'); }	
	});
	
	$('#name-1').mouseover(function() {
		var name = $("#name-1").val()
		if(name == "") { $("#name-1").val('Name'); }	
	});
	
	$('#name-2').mouseover(function() {
		var name = $("#name-2").val() 
		if(name == "") { $("#name-2").val('Name'); }	
	});
	
	
	
	$('#top-name').mouseover(function() {
		var name = $("#top-name").val()
		if(name == "") { $("#top-name").val('Name'); }	
	});
	
	$('#top-e-mail').mouseover(function() {
		var name = $("#top-e-mail").val()
		if(name == "") { $("#top-e-mail").val('E-mail'); }	
	});

	$('#top-company').mouseover(function() {
		var name = $("#top-company").val()
		if(name == "") { $("#top-company").val('Company'); }	
	});
	
	$('#top-message').mouseover(function() {
		var name = $("#top-message").val()
		if(name == "") { $("#top-message").val('Message'); }	
	});
	
	$('#top-phone').mouseover(function() {
		var name = $("#top-phone").val()
		if(name == "") { $("#top-phone").val('Phone'); }	
	});
	
	$('#s').mouseover(function() {
		var name = $("#s").val()
		if(name == "") { $("#s").val('Type keyword'); }	
	});
	


});
