var windowClass = {
	version : "1.0",
	showLogo : function () {
		$("#logo").show('blind',{},1000);
	},
	showMenu : function () {
		$("#menu").show('blind',{},1000);
	},
	showTanil : function () {
		$("#tanil").show('drop',{},1000);
	},
	showMakina : function () {
		$("#makina").show('bounce',{},1000);
	},
	playShow : function () {
		windowClass.showLogo();
		windowClass.showTanil();
		windowClass.showMakina();
		windowClass.showMenu();
	},
	hideElements : function () {
		$("#logo").hide();		
	},
	easySlider : function () {
		$("#slider").easySlider({
			prevText:'Geri',
			nextText:'Ileri',
			speed:500,
			auto: true,
			continuous: true,
			pause:2000,
			controlsShow: false
		});
	},
	showIntro : function () {
		$("#introArea").show('puff',{},500);	
		setTimeout(function () {$("#introArea").hide('blind',{},500) },4000);
	},
	havaDurumuVeKurlar : function () {
		$.post("havavekurlar.php",
		   function(data){$("#weatherArea").html(data)});
	},
	subMenu : function () {
		if($("#productMenuSub").is(":visible") == false) {
			$("#productMenuSub").show('blind',{},500);	
		}else {
			$("#productMenuSub").hide('blind',{},500);	
		}
	}
}
var ebulten = {
	version : 1.0,
	add : function () {
		$.post("_ebulten.php", { name: $("#nameBox").val(), email: $("#emailBox").val() },
		   function(data){
			   	if(data == "ok") {
			 		$("#alertBox").html($("#okAlert").html());
					$("#alertBox").css('color','green');
				}else {
			 		$("#alertBox").html($("#errorAlert").html());
					$("#alertBox").css('color','red');
				}
			 	$("#alertBox").show();
				setTimeout(function () {$("#alertBox").hide() },2000);
		   }
		);
		$("#logo").html();	
			
	}
}
$(function() {
	windowClass.hideElements();
	$("#productMenu").click(function() { windowClass.subMenu()});
	$("#emailAddButton").click(function() {ebulten.add()});
});
$(document).ready(function(){		
	windowClass.playShow();
	windowClass.easySlider();
	windowClass.havaDurumuVeKurlar();
	$("#navigation").treeview({
		persist: "location",
		collapsed: true,
		unique: true
	});
	
	$('.slideshow').cycle({
		fx: 'fade'
	});

});