$(document).ready(function() {
	
	$("div#pic").innerfade({
		speed: "slow",
		timeout: 8000,
		type: "sequence"
	});
	
	$("a:regex(rel, ^colorbox[0-9]+$)").colorbox({transition:"none", width:"75%", height:"75%"});
	
	$("div#pic_btn a").click(function(){	
		$("div#pic div[style*='display: block;'] a").click();
	});
	
	$("input#searchText").keypress(function(event){
		if (event.keyCode == '13') {
			$("form#search_form").submit();
		}
	});
	
	$("input#loginPassword").keypress(function(event){
		if (event.keyCode == '13') {
			checkLogin();
		}
	});
	
	$("div#login_ok a").click(function() { checkLogin() });
	
	$("input#sigininButton").click(function(){ checkLoginSfGuardAuth() });
	
	$("form#changePassword_form input[id=changePwButton]").click(function(){ checkChangePassword() });
	
	$("form#changeEmail_form input[id=changeEmailButton]").click(function(){
		
		if (!$.trim($("form[id=changeEmail_form] input[id=email_new]").val()))
		{	
			$("form[id=changeEmail_form] input[id=email_new]").effect("highlight", { color: "#F30000" }, 500);
			return;
		}
		
		$("form[id=changeEmail_form]").submit();
	});
	
	$("form#schedule_form input[id=uploadScheduleButton]").click(function(){
		
		if (!$.trim($("form[id=schedule_form] input[id=schedule]").val()))
		{	
			$("form[id=schedule_form] input[id=schedule]").effect("highlight", { color: "#F30000" }, 500);
			return;
		}
		
		$("form[id=schedule_form]").submit();
		
	});
	
	$("input#uzenetkuldes_szemelyek").click(function(){
		$("input#uzenetkuldes_cimzettek").val("");
		$("div#csoportok_lista").hide("slow", function(){ $("div#szemelyek_lista").show("slow"); });
	});
	
	$("input#uzenetkuldes_csoportok").click(function(){
		$("input#uzenetkuldes_cimzettek").val("");
		$("div#szemelyek_lista").hide("slow", function(){ $("div#csoportok_lista").show("slow"); });
	});
	
	$("form#uzenet_ertesito_kuldes_form p#csatolmanyok a#add").click(function() { appendFileInput(); });
	$("form#uzenet_ertesito_kuldes_form input#message_submit_btn").click(function() { checkMessage(); });
});

