$(document).ready(function() {
							
	
	$(".gbl_feature_play").click(function() {
		$(".gbl_fs_ls_navtabs").tabs().play();
		});
	$(".gbl_feature_stop").click(function() {
		
		$(".gbl_fs_ls_navtabs").tabs().stop();
		
		});

	$(".gbl_fs_ls_navtabs").tabs(".gbl_fs_ls_tabs > div", {
			// enable "cross-fading" effect
			effect: 'fade',
			fadeOutSpeed: 400,
			fadeInSpeed: 400,
			tabs: 'li',
			event: 'mouseover',
			// start from the beginning after the last tab
			rotate: true
		// use the slideshow plugin. It accepts its own configuration
	}).slideshow({
			autoplay: true,
			clickable: false,
			autopause: true,
			onPause: function(){
				$(".gbl_feature_stop").addClass('active').css('display', 'none');
				$(".gbl_feature_play").removeClass('active').css('display','block');
			},
			onPlay: function(){
				$(".gbl_feature_stop").removeClass('active').css('display','block');
				$(".gbl_feature_play").addClass('active').css('display', 'none');
			},
			interval: 5000
	});
		
		
		$(".gbl_fs_girldirectory_tabs").tabs("div.gbl_fs_girldirectory_panes > div");
	
		$("ul.gd_category_tags li").fadeTo(0, 0.8); //instantly set to 80%
		$("ul.gd_category_tags li").hover(function(){
			$(this).fadeTo(0, 1.0); // This should set the opacity to 100% on hover
		},function(){
	   		$(this).fadeTo("fast", 0.8); // This should set the opacity back to 80% on mouseout
		});
		

		$.getJSON("/ext/homepage/girl_section.json", function(data) { 
		
	    var gd_shtml = '';
		    for(var i = 0; i < data.girlSection.length && i <= 9; i++) {
		    var item = data.girlSection[i];
			
		
			
gd_shtml += '<li><div class="gbl_simplestruct"><div class="gbl_simplestruct_box1">';
gd_shtml += '<a href="' + item['gs_girlpageURL'] + '" title="'+ item['gs_girlFirst'] + '&nbsp;'+ item['gs_girlLast'] + '"><img src="' + item['gs_girlimageURL'] + '" alt="'+ item['gs_girlFirst'] + ''+ item['gs_girlLast'] + '"/></a></div>';
gd_shtml += '<div class="gbl_simplestruct_box2"><a href="' + item['gs_girlpageURL'] + '" name="fs_girl_name"><span class="fs_girl_section_first">'+ item['gs_girlFirst'] + '</span>';
gd_shtml += '<span class="fs_girl_section_last">'+ item['gs_girlLast'] + '</span>';
gd_shtml += '</a></div>';
gd_shtml += '<div class="gbl_simplestruct_box3"><a href="' + item['gs_tagOneURL'] + '" name="' + item['gs_tagOneURL'] + '">'+ item['gs_tagOne'] + '</a></div></div></li>';
			
			
			
			
			}
		
		
		
		
		
		
		
		/*		
				gd_shtml += '<div class="gbl_simplestruct"><div class="gbl_simplestruct_box1">';
				gd_shtml += '<a href="' + item['gs_girlpageURL'] + '" title=""><img src="' + item['gs_girlimageURL'] + '" alt=""/></a></div>';
				gd_shtml += '<div class="gbl_simplestruct_box2"><a href="' + item['gs_girlpageURL'] + '"><span class="fs_girl_section_first">'+ item['gs_girlFirst'] + '</span><span class="fs_girl_section_last">'+ item['gs_girLast'] + '</span>';
				gd_shtml += '</a></div>';
				gd_shtml += '<div class="gbl_simplestruct_box3"><a href="' + item['gs_tagOneURL'] + '">Tag 1</a>&nbsp;&bull;&nbsp;<a href="' + item['gs_tagTwoURL'] + '">Tag 2</a></div></div>';		
		
		
		
		
				"gs_girlimageURL": "http://www.playboy.com/girl/images/courtney-metscher/courtney-metscher-nude-thumbnail-2.jpg",
				"gs_girlpageURL": "http://www.playboy.com",
				"gs_tagOne": "Tag 1",
				"gs_tagOneURL": "http://www.playboy.com",
				"gs_tagTwo": "Tag 2",
				"gs_tagTwoURL": "http://www.playboy.com",
				"gs_girlFirst": "Courtney",
				"gs_girlLast": "Merscher"*/
		
	    $("ul.fs_girl_section").append(gd_shtml).fadeIn("slow");
		
				
	/*
	$('<div id="gbl_fs_girlName_tooltip">&nbsp;</div>').insertAfter($('#gbl_wrap_outer'));
		$("#chained img[title]").tooltip({
			 
			// use div.tooltip as our tooltip
			tip: '#gbl_fs_girlName_tooltip',
			// use fade effect instead of the default
			effect: 'fade',
			// make fadeOutSpeed similar to browser's default
			fadeOutSpeed: 100,
			// the time before tooltip is shown
			predelay: 0,
			// tweak the position
			position: "top center"
				
		});
*/
	});
});


