jQuery.fn.equalHeight = function () {
    var height        = 0;
    var maxHeight    = 0;

    // Store the tallest element's height
    this.each(function () {
        height        = jQuery(this).outerHeight();
        maxHeight    = (height > maxHeight) ? height : maxHeight;
    });

    // Set element's min-height to tallest element's height
    return this.each(function () {
        var t            = jQuery(this);
        var minHeight    = maxHeight - (t.outerHeight() - t.height());
        var property    = jQuery.browser.msie && jQuery.browser.version < 7 ? 'height' : 'min-height';

        t.css(property, minHeight + 'px');
    });
};

// menu animation effect, it's not perfect, so uncomment only if you're sure ;) don't forgeyt about initMenu(); 4 lines down
 function initMenu() {$('#sidebar ul ul').hide();$('#sidebar ul li a').hover(function() {$(this).next().slideToggle('normal');});}

jQuery(function () {

 initMenu(); 
jQuery('#container > div').equalHeight();
	jQuery("#dropmenu ul").css({display: "none"}); // Opera Fix
		jQuery("#dropmenu li").hover(
		function(){jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268);},function(){
			jQuery(this).find('ul:first').css({visibility: "hidden"});
		});
	elementy = jQuery('#menutop').children().find('li');
	jQuery(elementy).each( function() 
	{
		if( jQuery(this).find('ul').size() !=0 ){
				jQuery(this).contents('a').append(' &rsaquo;');
			}
	});

	elementy2 = jQuery('#sidebar').children().find('li');
		jQuery(elementy2).each( function() 
		{
			if( jQuery(this).find('ul').size() !=0 ){
					jQuery(this).contents('a').prepend('&lsaquo; ');
				}
		});

	jQuery('.slides').cycle({
		fx: 'blindY', timeout: 6000
	});
	jQuery('.slides_texts').cycle({
		fx: 'scrollUp', timeout: 6000
	});
	jQuery(".tweet").tweet({
            username: "seaofclouds", //here change to your nickname
            join_text: "auto",
            avatar_size: 32,
            count: 1,
            auto_join_text_default: "we said,",
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "we replied to",
            auto_join_text_url: "we were checking out",
            loading_text: "loading tweets..."
        });
	var options = { 	
	target:        '#alert',
	beforeSubmit:  showRequest,
	success:       showResponse
}; 
jQuery('#contactForm').ajaxForm(options); 


});

function showRequest(formData, jqForm, options) { 
var queryString = $.param(formData); 
return true; 
} 
function showResponse(responseText, statusText)  {  
} 
jQuery.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};


Cufon.replace('#sidebar ul li a', {textShadow: '#000 1px 1px'});
Cufon.replace('#menutop ul li a');
Cufon.replace('h3')('ul#feat li h3')('div#mid h2')('.post_content h2');
Cufon.replace('#sidebar .widget h2', {textShadow: '#000 1px 1px'});

