// JavaScript Document

///EQUALIZE COLS


(function($){
jQuery.fn.equalHeight = function() {
        var height = 0, 
        maxHeight = 0;

        // Store the tallest element's height
        this.each(function() {
                var t = $(this);
				//img=t.find('img.card-img:eq(0)');
				//if(img.length==0)
				t.css('min-height','0');
				//desc=t.find('p.card-description:eq(0)');
				//name=t.find('h3.card-name:eq(0)');
				
				pt=parseInt(t.css('paddingTop'), 10);
				pb=parseInt(t.css('paddingBottom'), 10);
				bt=isNaN(parseInt(t.css('borderTopWidth'), 10))?0:parseInt(t.css('borderTopWidth'), 10);
				bb=isNaN(parseInt(t.css('borderBottomWidth'), 10))?0:parseInt(t.css('borderBottomWidth'), 10);
                height = t.height() + (pt + pb + bt + bb);
                maxHeight = (height > maxHeight) ? height : maxHeight;
				
        });

        // Set element's min-height to tallest element's height
        return this.each(function() {
				 var t = $(this);
				pt=parseInt(t.css('paddingTop'), 10);
				pb=parseInt(t.css('paddingBottom'), 10);
				bt=isNaN(parseInt(t.css('borderTopWidth'), 10))?0:parseInt(t.css('borderTopWidth'), 10);
				bb=isNaN(parseInt(t.css('borderBottomWidth'), 10))?0:parseInt(t.css('borderBottomWidth'), 10);
             	 
                 mh = maxHeight - (pt + pb + bt + bb);
				// fill=document.createElement('div');
				// fill.style.height=mh-t.height());
                t.css({minHeight: mh +'px'});
				
        });
};

	  
 })(jQuery);
//GET TAG NAME OF AN JQUERY OBJECT
(function($){ 
$.fn.tagName = function() {	return this.get(0).tagName;	}
})(jQuery);  


//FOCUS AND BLUR INPUTS
  (function($){ 
		$.fn.focusBlurInputs = function(){
			inputs=$(this).filter('input[type=text]');;
			
			 return this.each(function(i,item){
					
					input=$(item);
					
					title=input.attr('title');
					
					input.focus(function(){
						value=input.attr('value');
						if(value==title)
						input.attr('value','');				   
					});
					
					input.blur(function(){
						value=input.attr('value');
						if(value=='')
						input.attr('value',title);				   
					});
					
					
			 });
		}
			
	})(jQuery);  
  
  
  
	//ODD EVEN
  (function($){ 
		$.fn.oddEven = function(){
			group=$(this);
			//odd_items=group.filter(':odd');
			//even_items=group.filter(':even');
			
			
			group.each(function(i){
				
				if(i%4==0)
				$(this).addClass('even').next().addClass('even');
									});
			//odd_items.addClass('odd');
			//even_items.addClass('even');
			return $(this);
		}
			
	})(jQuery);
  
  
  
  //////////////////////////////////////////////////////////////IE 6 PLUGINS
   if (!window.XMLHttpRequest) {
	
   }
  /////////////////////////////////////////////////////////END IE 6 PLUGINS