//////////////////////////// Header Game Finder

$(document).ready(function() {

	//Default Action
	$(".tab-content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab-content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab-content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

//////////////////////////// Slider Effects

function formatText(index, panel) {
		  return index + "";
	    }
		
		    $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: false,                 // Should links change the hashtag in the URL?
                buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "",             // Start text
		        stopText: "",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
        });

//////////////////////////// Tooltip Styles



$(document).ready(function() {
						   
		$('.content a[href][title]').qtip({
		content: {
			text: false
		},
   		position: {
      		corner: {
         		target: 'topMiddle',
         		tooltip: 'bottomMiddle'
      			}
   			},
		style: {
			width: { max: 200 },
			tip: true,
			border: {
				width: 3,
				radius: 5
			},
			name: 'dark'
			}
	})
	
	
	$('img.walkthrough').qtip({
		content: 'This game has a walkthrough',
   		position: {
      		corner: {
         		target: 'bottomMiddle',
         		tooltip: 'topMiddle'
      			}
   			},
		style: {
			width: { max: 200 },
			tip: true,
			border: {
				width: 3,
				radius: 5
			},
			name: 'cream'
			}
	})
	
	$('img.highscores').qtip({
		content: 'This game has Highscores',
   		position: {
      		corner: {
         		target: 'bottomMiddle',
         		tooltip: 'topMiddle'
      			}
   			},
		style: {
			width: { max: 200 },
			tip: true,
			border: {
				width: 3,
				radius: 5
			},
			name: 'cream'
			}
	})
	
	$('img.editor').qtip({
		content: 'This game has a level editor and a place to share levels',
   		position: {
      		corner: {
         		target: 'bottomMiddle',
         		tooltip: 'topMiddle'
      			}
   			},
		style: {
			width: { max: 200 },
			tip: true,
			border: {
				width: 3,
				radius: 5
			},
			name: 'cream'
			}
	})
	
	$('img.facebook').qtip({
		content: 'Share scores on Facebook',
   		position: {
      		corner: {
         		target: 'bottomMiddle',
         		tooltip: 'topMiddle'
      			}
   			},
		style: {
			width: { max: 200 },
			tip: true,
			border: {
				width: 3,
				radius: 5
			},
			name: 'cream'
			}
	})

});
