/////////////////////////////////////////////////
/////////////////////////////////////////////////
(function ($) {
    $.fn.vAlign = function(container) {
        return this.each(function(i){
	   if(container == null) {
	      container = 'div';
	   }
	   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);

(function ($) {
	$.fn.qtip_blue = function(){
	return this.each(function() {
			$(this).qtip({
				content: $(this).attr('alt'), // Use the tooltip attribute of the element for the content
				position: {
					corner: {
						tooltip: 'topMiddle', // Use the corner...
						target: 'bottomMiddle' // ...and opposite corner
                	},
					adjust: { x:0, y:-1 }
               	},
				/*
				show: { effect: 'slide' },
				hide: { effect: 'slide' },				
				*/
				style: {
					border: {
						width:3,
						radius:5
                  	},
					width: { max: 120 },
					padding: 6, 
					textAlign: 'center',
					tip: true, // Give it a speech bubble tip with automatic corner detection
					name: 'blue' // Styles: cream, light, dark, green, red, blue
				}
			});
		});
	};		
}
)(jQuery);
/////////////////////////////////////////////////
/////////////////////////////////////////////////
(function ($) {
	$.fn.qtip_dark = function(){
	return this.each(function() {
			$(this).qtip({
				content: $(this).attr('alt'), // Use the tooltip attribute of the element for the content
				position: {
					corner: {
						tooltip: 'bottomLeft', // Use the corner...
						target: 'topRight' // ...and opposite corner
                	},
					adjust: { x:-13, y:0 }
               	},
				/*
				show: { effect: 'slide' },
				hide: { effect: 'slide' },				
				*/
				style: {
					border: {
						width:3,
						radius:6
                  	},
					width: { max: 100 },
					padding: 5, 
					textAlign: 'center',
					tip: true, // Give it a speech bubble tip with automatic corner detection
					name: 'dark' // Styles: cream, light, dark, green, red, blue
				}
			});
		});
	};		
}
)(jQuery);
/////////////////////////////////////////////////
/////////////////////////////////////////////////
(function ($) {
	$.fn.qtip_tweet = function(){
	return this.each(function() {
			$(this).qtip({
				content: $(this).attr('alt'), // Use the tooltip attribute of the element for the content
				position: {
					corner: {
						tooltip: 'bottomLeft', // Use the corner...
						target: 'topRight' // ...and opposite corner
                	},
					adjust: { x:-70, y:0 }
               	},
				/*
				show: { effect: 'slide' },
				hide: { effect: 'slide' },				
				*/
				style: {
					border: {
						width:3,
						radius:6
                  	},
					width: { max: 120 },
					padding: 5, 
					textAlign: 'center',
					tip: true, // Give it a speech bubble tip with automatic corner detection
					name: 'dark' // Styles: cream, light, dark, green, red, blue
				}
			});
		});
	};		
}
)(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);
}
/////////////////////////////////////////////////
//		Busca no Blog
/////////////////////////////////////////////////
function busca(){
	var frm = document.searchform.s;		
	
	if(frm.value == '' || frm.value == 'Busca no webARTz'){
		alert('Para fazer uma busca você precisa digitar algo.');
		frm.focus();
		return false;
	}else{
		return true;			
	}		
}
function busca_focus(){
	var frm = document.searchform.s;
	if(frm.value == 'Busca no webARTz'){
		frm.value = '';
	}
}
function busca_blur(){
	var frm = document.searchform.s;
	
	if(frm.value == '' || frm.value == 'Busca no webARTz'){
		frm.value = 'Busca no webARTz';		
	}	
}
/////////////////////////////////////////////////
/////////////////////////////////////////////////