$(document).ready(function()
{	
	//$(document).pngFix(); 
	 
	var emailriddlerarray=[105,110,102,111,64,109,97,97,116,99,111,100,101,46,110,108];
	var encryptedemail_id28='';  
	for (var i=0; i<emailriddlerarray.length; i++)
	 encryptedemail_id28+=String.fromCharCode(emailriddlerarray[i])
	$('#mail-link').attr('href', 'mailto:'+encryptedemail_id28);	 
	$('#submit-mail').click(function() 
	{	
		var self = this;
		$('#submit-mail').hide();
		$(this).next('div.box-required').hide();
		$(this).siblings('div.loading-box').addClass('loading');		
		$.post("/contact", $('#mail-form').serialize(), function(data)
		{
			if(data != null)
			{
				$(self).siblings('div.loading-box').removeClass('loading');
				$(self).prevUntil('div.messagebox')
					.toggleClass(data.result?'success':'failure')
					.html(data.message)
					.show();
			}	
		}
		, 'json');	
		return false;
	});
	$('#mail-form input, #mail-form textarea').keyup(function (){
		$('div.message-box')
			.removeAttr('class')
			.addClass('message-box')
			.hide();
		$('#submit-mail').show();
		$('#submit-mail').next('div.box-required').show();
	})	
	$('.scroll-page').click(function() {
		var elementClicked = $(this).attr("href");
		var destination = $(elementClicked).offset().top;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
		return false;
	});
	$('#navigation-bar a').tooltip({
		track: true,
	    delay: 0, 
	    showURL: false, 
	    showBody: " - ", 
	    fade: 250
	});
	$('#slide-show').cycle({ 
	    fx:    'scrollHorz',	    
	    speed: 300,
	    timeout: 0, 
	    next:   '#next', 
	    prev:   '#prev'	    
	});
	if($.browser.opera)
	{		
		/* opera overflow hack */
		$('#header .box-2 .inner-box').css('width', ($('#header .box-2 .inner-box').width() - 116) + 'px');
		$('#footer h4.shadow').css('margin-top', '-42px');		
	}

});
function removeLoading() 
{
	$('#domain-form fieldset .response').remove()
	$('#domain-form fieldset .loading-box').remove();	
};

