var HandOut;

window.addEvent('domready', function(){
	HandOut = new Fx.Slide('hand',{mode: 'horizontal'});
	HandOut.hide();
	HandOut.slideIn.delay(1500, HandOut);
});

// Accordion
function switch_to (o) {
	if (o == "welcome") 
		{accordion.display(0); HandOut.slideIn();}
	else if (o == "products") 
		{HandOut.slideOut(); accordion.display(1); }
	else if (o == "services") 
		{accordion.display(2); HandOut.slideOut(); }
	else if (o == "references") 
		{accordion.display(3); HandOut.slideOut(); }
	else if (o == "donwload") 
		{accordion.display(4); HandOut.slideOut(); }
	else if (o == "contact") 
		{accordion.display(5); HandOut.slideOut(); }
	else if (o == "sitemap") 
		{accordion.display(6); HandOut.slideOut(); }
	else if (o == "legal") 
		{accordion.display(7); HandOut.slideOut(); }
	else if (o == "news1") 
		{accordion.display(8); HandOut.slideOut(); }
	else if (o == "news2") 
		{accordion.display(9); HandOut.slideOut(); }
	else if (o == "searchresults") 
		{accordion.display(10); HandOut.slideOut(); }
	else if (o == "portal") 
		{accordion.display(11); HandOut.slideOut(); }
	else if (o == "action") 
		{accordion.display(12); HandOut.slideOut(); }
	else
		alert(o);
};
Fx.Accordion = Accordion;

function mailpage()
{
  mail_str = "mailto:?subject=Ez az oldal szerintem tetszeni fog..."
  mail_str += "&body=Itt van egy olyan weboldal, amelyik biztosan tetszeni fog."
  mail_str += " %0A%0AKattints erre a linkre: " + location.href + ", szerintem nagyon sok hasznos dolog van itt."; 
  location.href = mail_str;
}

var contactErrorOut;
window.addEvent('domready', function(){
	contactErrorOut = new Fx.Slide('contacterror');
	contactErrorOut.hide();
});

// Contact form ajax-submit
function sendcontactform()  {
	if ($('contactname').value == "" || $('contactemail').value == "") {
		contactErrorOut.slideIn();
	} else {
		//Prevents the default submit event from loading a new page.
		// e.stop(); // We call from Flash, there is no real Event object -- KK
		//Empty the log and show the spinning indicator.
		var contactOut = new Fx.Slide('contactform');
		contactOut.slideOut();

		var log = $('log_res').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		$('contactform').set('send', {
		onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		$('contactform').send();
	}
}

function sendloginform()  {
		//Prevents the default submit event from loading a new page.
		// e.stop(); // We call from Flash, there is no real Event object -- KK
		//Empty the log and show the spinning indicator.
		//loginErrorOut.slideIn();
		//var loginOut = new Fx.Slide('loginform');
		//loginOut.slideOut();

		var log = $('log_res2').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		$('loginform').set('send', {
		onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		$('loginform').send();
	}


/*
window.addEvent('domready', function() {
	$('contactform').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		// e.stop(); // We call from Flash, there is no real Event object -- KK
		//Empty the log and show the spinning indicator.
		var contactOut = new Fx.Slide('contactform');
		contactOut.slideOut();

		var log = $('log_res').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {
		onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		this.send();
	});
});

function sendcontactform() {
	$('contactform').fireEvent('submit');
	return false;
}
*/

