contains = function (input, arrayData) {
           for (i=0; i<arrayData.length; i++) {
             if (arrayData[i] == input) {return true;}
           }
           return false;
           };
           
jQuery.fn.printStatus= function(str){
			// Loop 
			this.each(
				function( intI ){
				        // Generar una instancia.
				        var jNode = jQuery( this );
                jNode.append('<span id="statusBar" style="position:absolute;padding:5px;top:0;right:0;background-color:#000000;color:#ffffff;font-size:1.2em">'+str+'</span>');
				        }
				);
			// FIN: each()
			// Encadenamiento
			return( this );
		};

jQuery.fn.clearStatus= function(){
			// Loop 
			this.each(
				function( intI ){
				        // Generar una instancia.
				        var jNode = jQuery( this );
                	jNode.children('#statusBar').remove();
				        }
				);
			// FIN: each()
			// Encadenamiento
			return( this );
		};  

/*
 * Tooltip script
 * powered by jQuery (http://www.jquery.com)
 * written by Alen Grakalic (http://cssglobe.com)
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 */

this.tooltip = function(){
 /* CONFIG */
 xOffset = 10;
 yOffset = 20;
 // these 2 variable determine popup's distance from the cursor
 // you might want to adjust to get the right result
 /* END CONFIG */
 jQuery("a.tooltip").hover(function(e){
 if(!(this.name)==""){
 this.t = this.name;
 jQuery("body").append("<p id='tooltip'>"+ this.t +"</p>");
 jQuery("#tooltip")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px")
 .fadeIn("fast");
 }
 },
 function(){
 if(!(this.t)==""){
 this.name = this.t; }
 jQuery("#tooltip").remove();
 });
 jQuery("a.tooltip").mousemove(function(e){
 jQuery("#tooltip")
 .css("top",(e.pageY - xOffset) + "px")
 .css("left",(e.pageX + yOffset) + "px");
 });
};

//Limpia los valores de los formularios
jQuery.fn.clearForm = function() {
  // iterate each matching form
  return this.each(function() {
 // iterate the elements within the form
 jQuery(':input', this).each(function() {
   var type = this.type, tag = this.tagName.toLowerCase();
   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;
 });
  });
};  
      
/** 
#  * Copyright (c) 2008 Pasyuk Sergey (www.codeasily.com) 
#  * Licensed under the MIT License: 
#  * http://www.opensource.org/licenses/mit-license.php 
#  *  
#  * Splits a <ul>/<ol>-list into equal-sized columns. 
#  *  
#  * Requirements:  
#  * <ul> 
#  * <li>"ul" or "ol" element must be styled with margin</li> 
#  * </ul> 
#  *  
#  * @see http://www.codeasily.com/jquery/multi-column-list-with-jquery 
#  */  
jQuery.fn.makeacolumnlists = function(settings){
	settings = jQuery.extend({
		cols: 3,		// set number of columns
		colWidth: 0,		// set width for each column or leave 0 for auto width
		equalHeight: false, 	// can be false, 'ul', 'ol', 'li'
		startN: 1		// first number on your ordered list
	}, settings);
 
	if(jQuery('> li', this)) {
		this.each(function(y) {
			var y=jQuery('.li_container').size(),
		    	height = 0, 
		        maxHeight = 0,
				t = jQuery(this),
				classN = t.attr('class'),
				listsize = jQuery('> li', this).size(),
				percol = Math.ceil(listsize/settings.cols),
				contW = t.width(),
				bl = ( isNaN(parseInt(t.css('borderLeftWidth'),10)) ? 0 : parseInt(t.css('borderLeftWidth'),10) ),
				br = ( isNaN(parseInt(t.css('borderRightWidth'),10)) ? 0 : parseInt(t.css('borderRightWidth'),10) ),
				pl = parseInt(t.css('paddingLeft'),10),
				pr = parseInt(t.css('paddingRight'),10),
				ml = parseInt(t.css('marginLeft'),10),
				mr = parseInt(t.css('marginRight'),10),
				col_Width = Math.floor((contW - (settings.cols-1)*(bl+br+pl+pr+ml+mr))/settings.cols);
			if (settings.colWidth) {
				col_Width = settings.colWidth; 
			}
			var colnum=1,
				percol2=percol;
			jQuery(this).addClass('li_cont1').wrap('<div id="li_container' + (++y) + '" class="li_container"></div>');
			if (settings.equalHeight=='li') {
			    jQuery('> li', this).each(function() {
			        var e = jQuery(this);
			        var border_top = ( isNaN(parseInt(e.css('borderTopWidth'),10)) ? 0 : parseInt(e.css('borderTopWidth'),10) );
			        var border_bottom = ( isNaN(parseInt(e.css('borderBottomWidth'),10)) ? 0 : parseInt(e.css('borderBottomWidth'),10) );
			        height = e.height() + parseInt(e.css('paddingTop'), 10) + parseInt(e.css('paddingBottom'), 10) + border_top + border_bottom;
			        maxHeight = (height > maxHeight) ? height : maxHeight;
			    });
			}
			for (var i=0; i<=listsize; i++) {
				if(i>=percol2) { percol2+=percol; colnum++; }
				var eh = jQuery('> li:eq('+i+')',this);
				eh.addClass('li_col'+ colnum);
				if(jQuery(this).is('ol')){eh.attr('value', ''+(i+settings.startN))+'';}
				if (settings.equalHeight=='li') {
			        var border_top = ( isNaN(parseInt(eh.css('borderTopWidth'),10)) ? 0 : parseInt(eh.css('borderTopWidth'),10) );
			        var border_bottom = ( isNaN(parseInt(eh.css('borderBottomWidth'),10)) ? 0 : parseInt(eh.css('borderBottomWidth'),10) );
					mh = maxHeight - (parseInt(eh.css('paddingTop'), 10) + parseInt(eh.css('paddingBottom'), 10) + border_top + border_bottom );
			        eh.height(mh);
				}
			}
			jQuery(this).css({cssFloat:'left', width:''+col_Width+'px'});
			for (colnum=2; colnum<=settings.cols; colnum++) {
				if(jQuery(this).is('ol')) {
					jQuery('li.li_col'+ colnum, this).appendTo('#li_container' + y).wrapAll('<ol class="li_cont'+colnum +' ' + classN + '" style="float:left; width: '+col_Width+'px;"></ol>');
				} else {
					jQuery('li.li_col'+ colnum, this).appendTo('#li_container' + y).wrapAll('<ul class="li_cont'+colnum +' ' + classN + '" style="float:left; width: '+col_Width+'px;"></ul>');
				}
			}
			if (settings.equalHeight=='ul' || settings.equalHeight=='ol') {
				for (colnum=1; colnum<=settings.cols; colnum++) {
				    jQuery('#li_container'+ y +' .li_cont'+colnum).each(function() {
				        var e = jQuery(this);
				        var border_top = ( isNaN(parseInt(e.css('borderTopWidth'),10)) ? 0 : parseInt(e.css('borderTopWidth'),10) );
				        var border_bottom = ( isNaN(parseInt(e.css('borderBottomWidth'),10)) ? 0 : parseInt(e.css('borderBottomWidth'),10) );
				        height = e.height() + parseInt(e.css('paddingTop'), 10) + parseInt(e.css('paddingBottom'), 10) + border_top + border_bottom;
				        maxHeight = (height > maxHeight) ? height : maxHeight;
				    });
				}
				for (colnum=1; colnum<=settings.cols; colnum++) {
					var eh = jQuery('#li_container'+ y +' .li_cont'+colnum);
			        var border_top = ( isNaN(parseInt(eh.css('borderTopWidth'),10)) ? 0 : parseInt(eh.css('borderTopWidth'),10) );
			        var border_bottom = ( isNaN(parseInt(eh.css('borderBottomWidth'),10)) ? 0 : parseInt(eh.css('borderBottomWidth'),10) );
					mh = maxHeight - (parseInt(eh.css('paddingTop'), 10) + parseInt(eh.css('paddingBottom'), 10) + border_top + border_bottom );
			        eh.height(mh);
				}
			}
		    jQuery('#li_container' + y).append('<div style="clear:both; overflow:hidden; height:0px;"></div>');
		});
	}
}
 
jQuery.fn.uncolumnlists = function(){
	jQuery('.li_cont1').each(function(i) {
		var onecolSize = jQuery('#li_container' + (++i) + ' .li_cont1 > li').size();
		if(jQuery('#li_container' + i + ' .li_cont1').is('ul')) {
			jQuery('#li_container' + i + ' > ul > li').appendTo('#li_container' + i + ' ul:first');
			for (var j=1; j<=onecolSize; j++) {
				jQuery('#li_container' + i + ' ul:first li').removeAttr('class').removeAttr('style');
			}
			jQuery('#li_container' + i + ' ul:first').removeAttr('style').removeClass('li_cont1').insertBefore('#li_container' + i);
		} else {
			jQuery('#li_container' + i + ' > ol > li').appendTo('#li_container' + i + ' ol:first');
			for (var j=1; j<=onecolSize; j++) {
				jQuery('#li_container' + i + ' ol:first li').removeAttr('class').removeAttr('style');
			}
			jQuery('#li_container' + i + ' ol:first').removeAttr('style').removeClass('li_cont1').insertBefore('#li_container' + i);
		}
		jQuery('#li_container' + i).remove();
	});
}

jQuery.fn.attrList = function( strAttribute, strDelimiter ){
			// Create an array to store the attribute values of
			// the jQuery stack items.
			var arrValues = new Array();
 
			// Check to see if we were given a delimiter.
			// By default, we will use the comma.
			strDelimiter = (strDelimiter ? strDelimiter : ",");
 
			// Loop over each element in the jQuery stack and
			// add the given attribute to the value array.
			this.each(
				function( intI ){
					// Get a jQuery version of the current
					// stack element.
					var jNode = jQuery( this );
 
					// Add the given attribute value to our
					// values array.
					arrValues[ arrValues.length ] = jNode.attr(
						strAttribute
						);
 
				}
				);
 
			// Return the value list by joining the array.
			return(
				arrValues.join( strDelimiter )
				);
		}






// FULL FLY:
		jQuery.fn.hoverfullfly= function(){
			// Loop 
			this.each(
				function( intI ){
				        // Generar una instancia.
				        var jNode = jQuery( this );
                var titulo = jNode.attr("title");
                
                var print = function(){
                               jNode.append("<span class='centrado'>"+titulo+"</span>");
                }

					      var reset = function(){
                               jNode.bind('mouseover', sube);
					      }

			          var sube = function(){
                               jNode.unbind().bind('mouseout', sale ).dequeue().stop().animate({"top":"-20px","opacity": "1"}, 100, "linear", print);
                }	

			          var sale = function(){                 
                               jNode.dequeue().stop().animate({"top":"0px","opacity": ".75"}, 150, "linear", reset);
                               jNode.unbind().bind('mouseover',sube);
                               jNode.children("span").remove();                   
			       }

					   // ejecuta al inicio
					   jNode.bind('mouseenter',sube);
				}

				);

			// FIN: each()

			// Encadenamiento
			return( this );
		}
		
// FLY:
		jQuery.fn.hoverfly= function(){
			// Loop 
			this.each(
				function( intI ){
				        // Generar una instancia.
				        var jNode = jQuery( this );

					      var reset = function(){
                               jNode.bind('mouseover', sube);
					      }

			          var sube = function(){
                               jNode.unbind().bind('mouseout', sale ).dequeue().stop().animate({"top":"-20px","opacity": "1"}, 100, "linear");
                }	

			          var sale = function(){                 
                               jNode.dequeue().stop().animate({"top":"0px","opacity": ".75"}, 150, "linear", reset);
                               jNode.unbind().bind('mouseover',sube);                
			       }
					   // ejecuta al inicio
					   jNode.bind('mouseenter',sube);
				}
				);

			// FIN: each()

			// Encadenamiento
			return( this );
		}


// MEZCLA DE FONDOS
// <div class="xxx"> (este div debe tener el fondo a mezclar)
// <span>hey</span>
// </div> 
 
		jQuery.fn.hovermerger= function(){

			// Loop 
			this.each(
				function( intI ){
				     // Generar una instancia.
			       var jNode = jQuery( this );
             var bgurl =  jNode.css("background-image");
             var bgheight = jNode.css("height");
             var bgdiv = jQuery("<div>").attr('class','bgmerge');
             bgdiv.css({ position:"absolute",top:"0",backgroundImage:bgurl,width:"100%",height:bgheight,backgroundPosition:"0 -"+bgheight,opacity:"0"});
             var handler = jNode.children(":first");
             handler.css({lineHeight:bgheight,textAlign:"center",position:"absolute",zIndex:"10",width:"100%"}) ;
             jNode.append( bgdiv );

		         var reset = function(){
                               handler.bind('mouseenter', sube);
  		       }

			      var sube = function(){
                               handler.unbind().bind('mouseout', sale );
                               bgdiv.dequeue().stop().animate({"opacity": "1"}, 100, "linear");                      
			       }	
			       var sale = function(){
                               bgdiv.stop().animate({"opacity": "0"}, 500, "linear", reset);
                               handler.unbind().bind('mouseenter',sube);
			       }

			       // ejecuta al inicio
			       handler.bind('mouseenter',sube);
			       }

				);

			// FIN: each()

			// Encadenamiento
			return( this );

		}
		
// MENU ACORDION
// <div class="xxx"> 
// texto
// </div> 
 
		jQuery.fn.hoveraccordion= function(){

			// Loop 
			this.each(
				function( intI ){
				     // Generar una instancia.
			       var jNode = jQuery( this );

		         var reset = function(){
                               jNode.bind('mouseenter', sube);
  		       }

			       var sube = function(){
                               jNode.unbind().bind('mouseout', sale );
                               jNode.dequeue().stop().animate({backgroundColor: "#101010"}, 100, "linear");                      
			       }	
			       var sale = function(){
                               jNode.stop().animate({backgroundColor: "#000"}, 50, "linear", reset);
                               jNode.unbind().bind('mouseenter',sube);
			       }

			       // ejecuta al inicio
			       jNode.bind('mouseenter',sube);
			       }

				);

			// FIN: each()

			// Encadenamiento
			return( this );

		}
		
		
		
		// OPACITY IMG NAVS
    // <img class="xxx"> 

 
		jQuery.fn.hoveropacity= function(options){
                        options = jQuery.extend({opacity : ".5"}, options);
			// Loop 
			this.each(
			       function( intI ){
			       // Generar una instancia.
			       var jNode = jQuery( this );
		               var reset = function(){
                               jNode.bind('mouseenter', sube);
  		       }

			       var sube = function(){
                               jNode.unbind().bind('mouseout', sale );
                               jNode.dequeue().stop().animate({"opacity": "1"}, 100, "linear");                      
			       }	
			       var sale = function(){
                               jNode.stop().animate({"opacity": options.opacity}, 500, "linear", reset);
                               jNode.unbind().bind('mouseenter',sube);
			       }

			       // ejecuta al inicio
			       jNode.bind('mouseenter',sube);
			       jNode.animate({"opacity": options.opacity}, 500, "linear", reset);
			       }

				);

			// FIN: each()

			// Encadenamiento
			return( this );

		}
		
		
		
		
		
		
		
// LINKS ILUMINADOS
 
		jQuery.fn.hoverlinks= function(){

			// Loop 
			this.each(
				function( intI ){
				     // Generar una instancia.
			       var jNode = jQuery( this );

		         var reset = function(){
                               jNode.bind('mouseenter', sube);
  		       }

			       var sube = function(){
                               jNode.unbind().bind('mouseout', sale );
                               jNode.dequeue().stop().animate({backgroundColor: "#FF9C08", color:"#000"}, 100, "linear");                      
			       }	
			       var sale = function(){
                               jNode.stop().animate({backgroundColor: "#000", color: "#fff"}, 500, "linear", reset);
                               jNode.unbind().bind('mouseenter',sube);
			       }

			       // ejecuta al inicio
			       jNode.bind('mouseenter',sube);
			       }

				);

			// FIN: each()

			// Encadenamiento
			return( this );

		}


// LINKS OJOS DE PEZ
 
		jQuery.fn.fishlinks= function(options){
                       options = jQuery.extend({maxSize : "25px"}, options);
			// Loop 
			this.each(
			       function(){
			       // Generar una instancia.
			       var jNode = jQuery( this );

		               var reset = function(){
                               jNode.bind('mouseenter', sube);
  		               }

			       var sube = function(){
                               jNode.unbind().bind('mouseout', sale );
                               jNode.dequeue().stop().animate({fontSize: options.maxSize}, 100, "linear");                      
			       }	
			       var sale = function(){
                               jNode.stop().animate({fontSize: "11px"}, 500, "linear", reset);
                               jNode.unbind().bind('mouseenter',sube);
			       }

			       // ejecuta al inicio
			       jNode.bind('mouseenter',sube);
			       }

			       );

			// FIN: each()

			// Encadenamiento
			return( this );

		}


// MEZCLA DE FONDOS
// <div class="xxx"> (este div debe tener el fondo a mezclar)
// <span>hey</span>
// </div> 
 
		jQuery.fn.hoverbuttons= function(){

			// Loop 
			this.each(
				function( intI ){
				     // Generar una instancia.
			       var jNode = jQuery( this );
             var bgurl =  jNode.css("background-image"); 
             var temp = bgurl.substring(0,bgurl.length-6);
             bgurl = temp + '-on.png)'
             var bgheight = jNode.css("height");
             var bgwidth = jNode.css("width");
             var bgdiv = jQuery("<div>").attr('class','bgmerge');
             bgdiv.css({position:"absolute",top:"0",backgroundImage:bgurl,height:bgheight,width:bgwidth,opacity:"0"});
             jNode.append( bgdiv );

		         var reset = function(){
                               jNode.bind('mouseenter', sube);
  		       }

			      var sube = function(){
                               jNode.unbind().bind('mouseout', sale );
                               bgdiv.dequeue().stop().animate({"opacity": "1"}, 100, "linear");                      
			       }	
			       var sale = function(){
                               bgdiv.stop().animate({"opacity": "0"}, 500, "linear", reset);
                               jNode.unbind().bind('mouseenter',sube);
			       }

			       // ejecuta al inicio
			       jNode.bind('mouseenter',sube);
			       }

				);

			// FIN: each()

			// Encadenamiento
			return( this );

		}

    function waitFor(i,n){             
                 if(!i.complete){
                  setTimeout(function(){waitFor(i,n)}, 250);
                 }
                else{
                 imgname = 'url('+i.src+')';
                 imgid=n.attr("id");
                 w = i.width;
                 h = i.height;
                 n.css('background-image' , imgname );
                 n.css('width' , w+'px' );
                 n.css('height' , h+'px' );
                 setTimeout('jQuery(document).pngFix()', 500);
                 }
     } 

    function waitForHalf(i,n){             
                 if(!i.complete){
                  setTimeout(function(){waitForHalf(i,n)}, 250);
                 }
                else{
                 imgname = 'url('+i.src+')';
                 imgid=n.attr("id");
                 w = i.width;
                 h = i.height/2;
                 n.css('background-image' , imgname );
                 n.css('width' , w+'px' );
                 n.css('height' , h+'px' );
                 setTimeout('jQuery(document).pngFix()', 500);
                 }
      } 


		jQuery.fn.id2bg= function(options){
                        options = jQuery.extend({mime : "png"}, options);		
			// Loop 
			this.each(
			 function( intI ){
			 // Generar una instancia.
			 var jNode = jQuery( this );
                         var name = jNode.attr("id");
                         imgsrc = "/wp-content/themes/base/images/"+name+"."+options.mime;
                         imgname = "url(/wp-content/themes/base/images/"+name+"."+options.mime+")";  		        
                
                         var img = new Image();              
                         img.src = imgsrc;
                         waitFor(img,jNode);        
                	        }
			);
			// FIN: each()
			
			// Encadenamiento
			return( this );
		}


		jQuery.fn.hoverMoveBg= function(options){		
                        options = jQuery.extend({mime : "png"}, options);		
			// Loop 
			this.each(
			       function(){
			       // Generar una instancia.
			       var jNode = jQuery( this );

                               var name = jNode.attr("id");
                               imgsrc = "/wp-content/themes/base/images/"+name+"."+options.mime;
                               imgname = "url(/wp-content/themes/base/images/"+name+"."+options.mime+")";  		        
                
                               var img = new Image();              
                               img.src = imgsrc;
                               moveHeight = (img.height)/2;
                               waitForHalf(img,jNode);

			       var sube = function(){
                               jNode.css({"backgroundPosition": "0 -"+moveHeight+"px"});                                          
			       }	
			       var sale = function(){
                               jNode.stop().css({"backgroundPosition": "0 0"});  
			       }

			       // ejecuta al inicio
			       jNode.bind('mouseenter',sube);
			       jNode.bind('mouseout',sale);
			       }

			       );

			// FIN: each()
			
			// Encadenamiento
			return( this );
		}
