function fader_click(e)
{
	$('#faded_bord .pagination li a[rel="'+e+'"]').click();
}

$(document).ready(function()
{

	$('#slides').slides({
		generatePagination: false,
		play: 5000,
		pause: 2500,
		effect: 'slide'
	});
	
	$('#slides-bottom').slides({
		generatePagination: false,
		effect: 'slide'
	});
	
	// Sets the feature containers to the same height
	var MaxHeight = 0;
	$('d#box-virtualization').each(function(){
		if ($(this).height() > MaxHeight)
			{ MaxHeight = $(this).height(); }
	});
	
	$('#box-virtualization').height(MaxHeight);

/* inputs clearing 
----------------------------------*/	
	var $inputs = [];

	$(":input").each(function(){
		$inputs[$(this).attr('id')]=$(this).val();
	});

	$(':input').live('focusin', function(){  
		if($(this).val() == $inputs[$(this).attr('id')]){
			$(this).val('');
		}
		else
		{
			//$(this).select();
		}
	});

	$(':input').live('focusout', function(){  
		if($(this).val() == ''){
			$(this).val($inputs[$(this).attr('id')]);
		}
	});

	$("#lastTweet p.desc").tweet({
		username: "VM6software",
		count: 1,
		loading_text: "loading tweets..."
	});
	
	$('#faded2 .pagination li a').bind('click', function() {
		var e = $(this).attr("rel");
		setTimeout('fader_click('+e+')', 250);
		$("#faded2").faded({autoplay:false});

	});
	
	$("#faded2").faded({
		autopagination:true,
		autoplay: 8000,
		autorestart:false
	});
	
	$("#faded_bord").faded({
		autopagination:true,
		autorestart:false
	});
	
	var height = $('#main_content').height();
	if(height==0){ height = $('#main_content section').height(); }
	$('aside').height(height);
	
	var sidebar_height = $('aside').height();
	var main_content_sidebar_height = sidebar_height - 100;
	
	$('#main-content-sidebar').height(main_content_sidebar_height);
	
	/*$('input[name=checkbox-1[]]').attr('checked', true);*/

	
/* inputs clearing 
----------------------------------*/	
	$('.email').each(function() {
      var $email = $(this);
      var address = $email.text()
         .replace(/\s*\[at\]\s*/, '@')
         .replace(/\s*\[dot\]\s*/g, '.');
      $email.html('<a href="mailto:' + address + '">'
         + address +'</a>');
   });
	
	
	$('#wp-submit').attr('value', '');
	$(':submit').attr('value', '');
	
	

});

