var $j = jQuery.noConflict();

$j(function()
{
	// capture the uri and activate the slide
	if (location.hash =='')
    {
        $j('#explore_slideshow').cycle(
		{ 
		    fx:     'fade', // 'fade'
		    speed:  'slow', 
		    timeout: 0,
		    pause: true,
		    pager:  '.explore_tabs', 
		    pagerAnchorBuilder: function(idx, slide) 
			{ 
		        // return selector string for existing anchor 
		        return '.explore_tabs li:eq(' + idx + ') a'; 
		    }
		});

    }else if(location.hash =='#simmons-beautyrest'){   
	 		
        var thehash = location.hash;
				
    	$j('#explore_slideshow').cycle(
		{ 
			
		    fx:     'fade', 
		    speed:  'slow', 
		    timeout: 0,
		    pause: true,
		    pager:  '.explore_tabs', 
		    startingSlide: 1,
			pagerAnchorBuilder: function(idx, slide) 
			{ 
		        // return selector string for existing anchor 
		        return '.explore_tabs li:eq(' + idx + ') a'; 
		    }
			
		
		});
		
		}else if (location.hash =='#simmons-beautyrest'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
			
		}else if (location.hash =='#comforpedic'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
			
		   }else if (location.hash =='#vera-wang'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
			
			}else if (location.hash =='#icomfort'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
			
		    }else if (location.hash =='#adjustable-beds'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
			
		  }else if (location.hash =='#videos'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
			
				}else if (location.hash =='#why-mfl'){   

	        var thehash = location.hash;

	    	$j('#explore_slideshow').cycle(
			{ 
			    fx:     'fade', 
			    speed:  'slow', 
			    timeout: 0,
			    pause: true,
			    pager:  '.explore_tabs', 
			    startingSlide: 2,
				pagerAnchorBuilder: function(idx, slide) 
				{ 
			        // return selector string for existing anchor 
			        return '.explore_tabs li:eq(' + idx + ') a'; 
			    }
			});
	
	
	}
//closing
});


//start
$j(document).ready(function() {

	$j('#slideshow').cycle(
	{ 
	    fx:     'fade', 
	    speed:  'slow', 
	    timeout: 9000,
	    pause: true,
	    pager:  '.rotator_nav', 
	    pagerAnchorBuilder: function(idx, slide) 
		{ 
	        // return selector string for existing anchor 
	        return '.rotator_nav li:eq(' + idx + ') a'; 
	    } 
	     
 	});

});


    
