main =
{
	index:0,
	sloganindex:0,

	li_firstblock_clicked: function(event)
	{
		if($('#li_firstblock').hasClass("de"))
		{
			window.location = 'http://www.vinotekasoft.com/de/vinoteka';
		}
		else if($('#li_firstblock').hasClass("fr"))
		{
			window.location = 'http://www.vinotekasoft.com/fr/vinoteka';
		}
		else
		{
			window.location = 'http://www.vinotekasoft.com/vinoteka';
		}
	},

	li_secondblock_clicked: function(event)
	{
		if($('#li_secondblock').hasClass("de"))
		{
			window.location = 'http://www.vinotekasoft.com/de/buy';
		}
		else if($('#li_secondblock').hasClass("fr"))
		{
			window.location = 'http://www.vinotekasoft.com/fr/buy';
		}
		else
		{
			window.location = 'http://www.vinotekasoft.com/buy';
		}
	},

	li_thirdblock_clicked: function(event)
	{
		if($('#li_thirdblock').hasClass("de"))
		{
			window.location = 'http://www.vinotekasoft.com/de/about';
		}
		else if($('#li_thirdblock').hasClass("fr"))
		{
			window.location = 'http://www.vinotekasoft.com/fr/about';
		}
		else
		{
			window.location = 'http://www.vinotekasoft.com/about';
		}
	},

	releasenote_over: function(event)
	{
    	$('#releasenote').addClass("over");
	},

	releasenote_exit: function(event)
	{
    	$('#releasenote').removeClass("over");
	},

	purchase_over: function(event)
	{
    	$('#purchase').addClass("over");
	},

	purchase_exit: function(event)
	{
    	$('#purchase').removeClass("over");
	},

	download_panel_over: function(event)
	{
		//console.log("download_panel_over");
	},

	download_panel_exit: function(event)
	{
		//console.log("download_panel_exit");

	    //$('#download_panel').fadeOut("fast");
	},
	
	download_over: function(event)
	{	
	   	var position = $('#download').position();
    	$('#download_panel').css("left",position.left-35);
   		$('#download_panel').css("top",position.top+30);
    	$('#download_panel').fadeIn("slow");
   		$('#download').addClass("over");
	},

	download_exit: function(event)
	{
   		$('#download').removeClass("over");
    	$('#download_panel').fadeOut("fast");
	},

	chooselang_clicked: function(event)
	{
		$('#chooselang').toggleClass('on');
	   	var position = $('#chooselang').position();
    		$('#menulang').css("left",position.left);
   		$('#menulang').css("top",position.top+24);

	    	if($('#chooselang').hasClass("on"))
		{
   			$('#menulang').fadeIn("fast");
		}
		else
		{
   			$('#menulang').hide();
		}
	},
	
	start_anim: function()
	{
		main.index = 1;
		var timer = setInterval(function() 
        {
        	if(main.index > 6)
            {
            	main.index = 0;
            }
            
			$("#animation").fadeOut("slow", function() {
		
			if(main.index==0)
			{
				$("#animation").attr("src","/images/referencewindowreflect.png");
			}
			else if(main.index==1)
			{
				$("#animation").attr("src","/images/tastingwindowreflect.png");			
			}
			else if(main.index==2)
			{
				$("#animation").attr("src","/images/pairingwindowreflect.png");			
			}
			else if(main.index==3)
			{
				$("#animation").attr("src","/images/cellarwindowreflect.png");			
			}
			else if(main.index==4)
			{
				$("#animation").attr("src","/images/bottlewindowreflect.png");			
			}
			else if(main.index==5)
			{
				$("#animation").attr("src","/images/rackwindowreflect.png");			
			}
			else if(main.index==6)
			{
				$("#animation").attr("src","/images/rack2windowreflect.png");			
			}
			
			$("#animation").fadeIn("slow");
			main.index = main.index+1;
			});
			

        }, 10000);
		
	},

	start_slogan_anim: function()
	{
		main.sloganindex = 1;
		var timer = setInterval(function() 
        {
        	if(main.sloganindex > 7)
            {
            	main.sloganindex = 0;
            }
            
			$("#slogantext").fadeOut("slow", function() {
		
			if(main.sloganindex==0)
			{
				$("#slogantext").html("Vinoteka reinvents your cellar... to better discover the wine world.");
			}
			else if(main.sloganindex==1)
			{
				$("#slogantext").html("Visually, the eyeCandy is great! I love the graphics, and the reports. - Jos&eacute; Garcia");
			}
			else if(main.sloganindex==2)
			{
				$("#slogantext").html("First of all I want to mention that I am absolutely thrilled by your wine cellar management software you’ve created. - Werner de Bijl");
			}
			else if(main.sloganindex==3)
			{
				$("#slogantext").html("I think your product is really great! - Eric Dube");
			}
			else if(main.sloganindex==4)
			{
				$("#slogantext").html("The mac community has been without a good cellar management tool for a long time and I am thrilled about yours. It is beautiful! Thank you! - Sarah Banko");
			}
			else if(main.sloganindex==5)
			{
				$("#slogantext").html("I ran the demo and was rather impressed by the program. - Jan Decoster");
			}
			else if(main.sloganindex==6)
			{
				$("#slogantext").html("L'ensemble est tr&egrave;s complet et le fonctionnement du logiciel s'av&egrave;re ludique. Un excellent choix pour qui veut g&egrave;rer sa cave sur son Mac. - Mac4ever");
			}
			else if(main.sloganindex==7)
			{
				$("#slogantext").html("It is a useful and beautiful application for your Mac, that you should get even if you do not drink wine (if so, then you will start drinking by discovering) - Aweezon.com");
			}
			
			$("#slogantext").fadeIn("slow");
			main.sloganindex = main.sloganindex+1;
			});
			

        }, 6000);
		
	},

};