/*********************************************************************************************/
// This is only area you need to make changes in this file to set it for your needs

var script_address = "add_mail.php"; // address of php script which handles adding the entered mail adresses to database

//  To set the countdown timer's target change the values of below variables
var day     = 28;         //  target day
var month   = 8;          //  target month
var year    = 2010;       //  target year
var hour    = 20;         //  target hour
var minutes = 30;         //  target minutes 
var seconds = 30;         //  target seconds
/**********************************************************************************************/

$(document).ready(function(){
	
	$("#mail_address").focus( function(){ 
		if( ( $(this).val() == "Enter your email to subscribe" ) || ( $(this).val() == "Mail is not valid!" ) || ( $(this).val() == "Database Error" ) ){	$(this).val(""); }  } );
	
	$('li').mouseover(function(){ $(this).animate( { marginTop: '+=5px' },300); });
	$('li').mouseout(function()	{ $(this).animate( { marginTop: '-=5px' },300);	});
	
	$('#submit_link').click(function()
	{ 
		email = $("#mail_address").val();
		if(!check_mail(email)){	$("#mail_address").val("Mail is not valid!"); }
		else
		{
			$("#mail_address").val("Processing...");
			$.ajax({ type: 'POST', url: script_address, data: 'email=' + email, success: function(ajaxCevap){ $("#mail_address").val( ajaxCevap ); } });
		}
	});
	
	$(function () {
		var austDay = new Date();
		austDay = new Date(year, month - 1, day, hour, minutes, seconds );
		$('#count_down').countdown({until: austDay});
	});
});

var email = " ";
var toggle_value = "open_about";
var koordinat_x;
var koordinat_y;

function check_mail( email ){ return (email.indexOf(".") > 2) && (email.indexOf("@") > 0); }

function toggle_about()
{
	if( toggle_value == "open_about" )
	{
		$("div#email").fadeOut("fast");
		$("div#count_down").fadeOut("fast");
		$("div#logo").animate( { height: '0px' },50 );
		$("div#about").fadeIn("fast");
		toggle_value = "close_about";
	}
	else
	{
		$("div#email").fadeIn("fast");
		$("div#count_down").fadeIn("fast");
		$("div#logo").animate( { height: '55px' },50 );
		$("div#about").fadeOut("fast");
		toggle_value = "open_about";
	}
}
