// Arrows And Icons Global JavaScript Calls

jQuery(document).ready(function(){
	jQuery("ul.sf-menu").superfish({ //Superfish menus for navigation
		pathClass: 'current',
		pathLevels: 1,
		speed: 'fast',
		autoArrows: false,
		dropShadows: false
	});
	
	jQuery(".tweet").tweet({ //Tweet to pull Twitter feed into article sidebars
		username: "arrowsandicons",
		join_text: "auto",
		avatar_size: 0,
		count: 3,
		auto_join_text_default: "//",
		auto_join_text_ed: "//",
		auto_join_text_ing: "//",
		auto_join_text_reply: "//",
		auto_join_text_url: "//",
		loading_text: "loading tweets..."
	});
	
	jQuery('#search input.search-input').each(function() { //Clears text input value on focus
		$(this).focus(function() {
		  	if($(this).val() == this.defaultValue)
			$(this).val("");
		});
		$(this).blur(function() {
			if($(this).val() == "")
			$(this).val(this.defaultValue);
		});
	});
	
	jQuery('a.new-window').click(function(){
        window.open(this.href);
        return false;
    });
	
    /*jQuery('#feed').gFeed({  //Industry news feed
        url: 'http://feedstitch.com/ryanplascano/arrows-icons-industry-news.rss', 
        max: 20
    });*/
	
	/*jQuery.('#feed').jGFeed('http://feedstitch.com/ryanplascano/arrows-icons-industry-news.rss',
		function(feeds){
		  // Check for errors
		  if(!feeds){
			// there was an error
			return false;
		  }
		  // do whatever you want with feeds here
		  for(var i=0; i<feeds.entries.length; i++){
			var entry = feeds.entries[i];
			// Entry title
			entry.title;
		  }
		}, 10);*/

});

// Google AJAX API Call

/*google.load("feeds", "1");

function initialize() {
	var feed = new google.feeds.Feed("http://feedstitch.com/ryanplascano/arrows-icons-industry-news.rss");
	feed.load(function(result) {
	  if (!result.error) {
		var container = document.getElementById("feed");
		for (var i = 0; i < result.feed.entries.length; i++) {
		  var entry = result.feed.entries[i];
		  var attributes = ["title", "link", "publishedDate", "contentSnippet"];
		  for (var j = 0; j < attributes.length; j++) {
			var div = document.createElement("div");
			div.appendChild(document.createTextNode(entry[attributes[j]]));
			container.appendChild(div);
		  }
		}
	  }
	});
}
google.setOnLoadCallback(initialize);
*/ 
