/////////////////////////////////////////////////
//		Busca no Blog
/////////////////////////////////////////////////
function busca(){
	var frm = document.search_form.s;		
	
	if(frm.value == '' || frm.value == 'Procurar por...'){
		alert('Digite algo para realizar uma Busca.');
		frm.focus();
		return false;
	}else{
		return true;			
	}		
}
function busca_focus(){
	var frm = document.search_form.s;
	if(frm.value == 'Procurar por...'){
		frm.value = '';
	}
}
function busca_blur(){
	var frm = document.search_form.s;
	
	if(frm.value == '' || frm.value == 'Procurar por...'){
		frm.value = 'Procurar por...';		
	}	
}
/////////////////////////////////////////////////
//		Alinhamento Vertical
/////////////////////////////////////////////////
(function($){
    $.fn.vAlign = function(container) {
        return this.each(function(i){
	   if(container == null) {
	      container = 'div';
	   }
	   //alert($(this).html());
	   var paddingPx = 10; //change this value as you need (It is the extra height for the parent element)
	   $(this).html("<" + container + ">" + $(this).html() + "</" + container + ">");
	   var el = $(this).children(container + ":first");
	   var elh = $(el).height(); //new element height
	   var ph = $(this).height(); //parent height
	   if(elh > ph) { //if new element height is larger apply this to parent
	       $(this).height(elh + paddingPx);
	       ph = elh + paddingPx;
	   }
	   var nh = (ph - elh) / 2; //new margin to apply
	   $(el).css('margin-top', nh);
        });
     };
})(jQuery);
/////////////////////////////////////////////////
//		Add a Favoritos
/////////////////////////////////////////////////
function addFav(){
    var url      = "http://www.webartz.com.br";
    var title    = "Blog webARTz";
	
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}
/////////////////////////////////////////////////
//		Scroll to Top
/////////////////////////////////////////////////
(function($){
	$.fn.scrollToTop = function(){
		$(this).hide().removeAttr("href");
		if($(window).scrollTop() != "0"){
			$(this).fadeIn("slow");
		}
		var scrollDiv = $(this);
		$(window).scroll(function(){
			if($(window).scrollTop() == "0"){
				$(scrollDiv).fadeOut("slow");
			}else{
				$(scrollDiv).fadeIn("slow");
			}
		});
	$(this).click(function(){
		$("html, body").animate({scrollTop:0},"slow");
		}
	)}
})(jQuery);
/////////////////////////////////////////////////
//		Scroller Banner
/////////////////////////////////////////////////
(function($){
	$.fn.WebScroller = function(){
		if($(window).scrollTop() != "0"){
			$(this).fadeIn("slow");
		}
		var scrollDiv = $(this);
		$(window).scroll(function(){
			$(scrollDiv).fadeIn("slow");
		});
	}
})(jQuery);
/////////////////////////////////////////////////
/////////////////////////////////////////////////