/*!
 * jQuery replaceText - v1.1 - 11/21/2009
 * http://benalman.com/projects/jquery-replacetext-plugin/
 * 
 * Copyright (c) 2009 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */

// Script: jQuery replaceText: String replace for your jQueries!
//
// *Version: 1.1, Last updated: 11/21/2009*
// 
// Project Home - http://benalman.com/projects/jquery-replacetext-plugin/
// GitHub       - http://github.com/cowboy/jquery-replacetext/
// Source       - http://github.com/cowboy/jquery-replacetext/raw/master/jquery.ba-replacetext.js
// (Minified)   - http://github.com/cowboy/jquery-replacetext/raw/master/jquery.ba-replacetext.min.js (0.5kb)
// 
// About: License
// 
// Copyright (c) 2009 "Cowboy" Ben Alman,
// Dual licensed under the MIT and GPL licenses.
// http://benalman.com/about/license/
// 
// About: Examples
// 
// This working example, complete with fully commented code, illustrates one way
// in which this plugin can be used.
// 
// replaceText - http://benalman.com/code/projects/jquery-replacetext/examples/replacetext/
// 
// About: Support and Testing
// 
// Information about what version or versions of jQuery this plugin has been
// tested with, and what browsers it has been tested in.
// 
// jQuery Versions - 1.3.2
// Browsers Tested - Internet Explorer 6-8, Firefox 3-3.5, Safari 3-4, Chrome, Opera 9.6-10.
// 
// About: Release History
// 
// 1.1 - (11/21/2009) Simplified the code and API substantially.
// 1.0 - (11/21/2009) Initial release

(function($){
  '$:nomunge'; // Used by YUI compressor.
  
  // Method: jQuery.fn.replaceText
  // 
  // Replace text in specified elements. Note that only text content will be
  // modified, leaving all tags and attributes untouched. The new text can be
  // either text or HTML.
  // 
  // Uses the String prototype replace method, full documentation on that method
  // can be found here: 
  // 
  // https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/Replace
  // 
  // Usage:
  // 
  // > jQuery('selector').replaceText( search, replace [, text_only ] );
  // 
  // Arguments:
  // 
  //  search - (RegExp|String) A RegExp object or substring to be replaced.
  //    Because the String prototype replace method is used internally, this
  //    argument should be specified accordingly.
  //  replace - (String|Function) The String that replaces the substring received
  //    from the search argument, or a function to be invoked to create the new
  //    substring. Because the String prototype replace method is used internally,
  //    this argument should be specified accordingly.
  //  text_only - (Boolean) If true, any HTML will be rendered as text. Defaults
  //    to false.
  // 
  // Returns:
  // 
  //  (jQuery) The initial jQuery collection of elements.
  
  $.fn.replaceText = function( search, replace, text_only ) {
    return this.each(function(){
      var node = this.firstChild,
        val,
        new_val,
        
        // Elements to be removed at the end.
        remove = [];
      
      // Only continue if firstChild exists.
      if ( node ) {
        
        // Loop over all childNodes.
        do {
          
          // Only process text nodes.
          if ( node.nodeType === 3 ) {
            
            // The original node value.
            val = node.nodeValue;
            
            // The new value.
            new_val = val.replace( search, replace );
            
            // Only replace text if the new value is actually different!
            if ( new_val !== val ) {
              
              if ( !text_only && /</.test( new_val ) ) {
                // The new value contains HTML, set it in a slower but far more
                // robust way.
                $(node).before( new_val );
                
                // Don't remove the node yet, or the loop will lose its place.
                remove.push( node );
              } else {
                // The new value contains no HTML, so it can be set in this
                // very fast, simple way.
                node.nodeValue = new_val;
              }
            }
          }
          
        } while ( node = node.nextSibling );
      }
      
      // Time to remove those elements!
      remove.length && $(remove).remove();
    });
  };  
  
})(jQuery);


$(document).ready(function() {
		$("#twitter_feed").getTwitter({
			userName: "app_ski_mtn",
			numTweets: 1,
			loaderText: "Latest Twitter Status...",
			slideIn: true,
			slideDuration: 1000,
			showHeading: false,
			headingText: "",
			showProfileLink: false,
			showTimestamp: true
			});
		


jQuery(document).ready(function()
{
	
	jQuery("#faqlist .menu_head").click(function()
    {
		jQuery(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	
	});
	
});

							
			
	
	
  	$("#quick_links img").hover(function() {
    $(this).attr("src", $(this).attr("src").split(".gif").join("_over.gif"));
  	}, function() {
    $(this).attr("src", $(this).attr("src").split("_over.gif").join(".gif"));
  	});
	});

	jQuery.fn.delay = function(time,func){
	this.each(function(){
	setTimeout(func,time);
	});
	return this;
	};

$(document).ready(function(){
  
  
      $('#slides').cycle({
        fx:     'fade',
        speed:   500,
        timeout: 6000,
        next:   '.next',
        prev:   '.prev',
		random: 1
    });
	
$('#home_slides').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5000, 
    pager:  '#pager',
	  pagerAnchorBuilder: function(idx, slide) { 
        return '<a href="#"><img src="http://appskimtn.com/wp-content/themes/asm/images/blank2.gif" alt="" /></a>'; 
    } 
});
	
	
	

 	 $('#pause').click(function() { $('#photos_slideshow').cycle('pause');    $('#pause').css("display","none");  $("#play").css("display","inline"); return false; });
   	 $('#play').click(function() { $('#photos_slideshow').cycle('resume');  $('#play').css("display","none");  $("#pause").css("display","inline"); return false; });
$('#photos_slideshow img').click(function() { $('#photos_slideshow').cycle('pause');  });

	$('#wrapp').mouseover(function() { $('#slides').cycle('pause'); });
	$('#wrapp').mouseout(function() { $('#slides').cycle('resume');  });
 
 

	 $("a.post_image_fancybox").fancybox();
 
 
 
 
 $(".widget_tag_cloud div a").append(",");
 
 $(".widget_tag_cloud div a:last").replaceText( /,/gi, " " );

 
 $('.subpage_nav li').each(function(index) {
   $(this).addClass('colorme-' + index);
  
  });
 
 
 $("li.page-item-141 a").attr("href", "http://booneweather.com/Forecast/Appalachian+Ski+Mtn");
 $("li.page-item-141 a").attr('target', '_blank');
});
			
			
		
	
