$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('margin-top', mh);
	});
};


$(document).ready(function() {
	$('#navigation li')	.last().addClass('pr0');
	$("#tweet").tweet({
            username: "design_agency",
            join_text: "auto",
            avatar_size: 32,
            count: 1,
            auto_join_text_default: "", 
            auto_join_text_ed: "",
            auto_join_text_ing: "",
            auto_join_text_reply: "",
            auto_join_text_url: "",
            loading_text: "loading tweets..."
  });
	
	$('.links-list-holder .footer-list').last().addClass('mr0');
	$('.foot-btm-nav li').first().addClass('first-fbn');
	$('.foot-btm-nav li').last().addClass('last-fbn');
	$('.works-row').each(function(){
		$(this).find('.box').last().addClass('mr0');
	});
	
	$('#home-slider').innerfade({ speed: 2000, timeout: 4000, type: 'sequence', containerheight: '380px'}); 
	
	$(".choose-file").filestyle({ 
     image: "img/elem/choose-file.png",
     imageheight : 20,
     imagewidth : 80,
     width : 170
 });
	
	
	
});

window.onload= function(){
	$('.home-clients img').vAlign();
	$('.file.choose-file').attr('value', 'No file selection');
	$('.file.choose-file').css('height', '20px');
	$('.file.choose-file').css('lineHeight', '21px');
}

function formrule(field)
{
        if (field.defaultValue == field.value) field.value = "";
}
function formrule2(field) {
  if (field.value == "") {
    field.value = field.defaultValue;
  }
}
