var timer_is_on=1;
var currentslidenumber=1;
//Change this value to control the seconds between slides
var slidetime=5000;

//HTML variables for each of the four slides
strMainImageDivID = 'hc_flf_option1_bg';
strMainImageHTML1 = '<a href="/bras/detail/5602.aspx?sid=5602&colid=8"><img src="/images/homepage/flf/flf_option_1/bg_main_image5.gif" style="border: 0px;"/></a>';
strMainImageHTML2 = '<a href="/panties/detail/2355.aspx?sid=2355&sf=1"><img src="/images/homepage/flf/flf_option_2/bg_slide_two_5.gif" border="0" /></a>';
strMainImageHTML3 = '<a href="/shapewear/detail/4080.aspx?sid=4080&featid=37&colid=14"><img src="/images/homepage/flf/flf_option_3/bg_slide_three5.gif" border="0" /></a>';

strGoButtonDivID = 'hc_flf_option1_link';
strGoButtonHTML1 = '<a href="/bras/detail/5602.aspx?sid=5602&colid=8"><img src="/images/homepage/flf/flf_option_1/btn_go5.gif"  onmouseover="this.src=\'/images/homepage/flf/flf_option_1/btn_go5.gif\';" onmouseout="this.src=\'/images/homepage/flf/flf_option_1/btn_go5.gif\';" alt="Dreamform" style="border: 0;" /></a>';
strGoButtonHTML2 = '<a href="/panties/detail/2355.aspx?sid=2355&sf=1"><img src="/images/homepage/flf/flf_option_2/btn_go_5.gif"  onmouseover="this.src=\'/images/homepage/flf/flf_option_2/btn_go_5.gif\';" onmouseout="this.src=\'/images/homepage/flf/flf_option_2/btn_go_5.gif\';" alt="Solution Finder" style="border: 0;" /></a>';
strGoButtonHTML3 = '<a href="/shapewear/detail/4080.aspx?sid=4080&featid=37&colid=14"><img src="/images/homepage/flf/flf_option_3/btn_go_5.gif"  onmouseover="this.src=\'/images/homepage/flf/flf_option_3/btn_go_5.gif\';" onmouseout="this.src=\'/images/homepage/flf/flf_option_3/btn_go_5.gif\';" alt="Solution Finder" style="border: 0;" /></a>';

strSeeMoreDivID = 'hc_flf_nav';
strSeeMoreHTML1 = '<img src="/images/homepage/flf/hdr_see_more.gif" border="0" /><a href="#" onclick="tab_click(1);"><img id="imgFLFNum1" src="/images/homepage/flf/btn_1_bl_wht_over.gif" border="0" /></a><a href="#" onclick="tab_click(2);"><img id="imgFLFNum2" src="/images/homepage/flf/btn_2_bl_wht.gif" border="0" /></a><a href="#" onclick="tab_click(3);"><img id="imgFLFNum3" src="/images/homepage/flf/btn_3_bl_wht.gif" border="0" /></a>';
strSeeMoreHTML2 = '<img src="/images/homepage/flf/hdr_see_more.gif" border="0" /><a href="#" onclick="tab_click(1);"><img id="imgFLFNum1" src="/images/homepage/flf/btn_1_bl_wht.gif" border="0" /></a><a href="#" onclick="tab_click(2);"><img id="imgFLFNum2" src="/images/homepage/flf/btn_2_bl_wht_over.gif" border="0" /></a><a href="#" onclick="tab_click(3);"><img id="imgFLFNum3" src="/images/homepage/flf/btn_3_bl_wht.gif" border="0" /></a>';
strSeeMoreHTML3 = '<img src="/images/homepage/flf/hdr_see_more.gif" border="0" /><a href="#" onclick="tab_click(1);"><img id="imgFLFNum1" src="/images/homepage/flf/btn_1_bl_wht.gif" border="0" /></a><a href="#" onclick="tab_click(2);"><img id="imgFLFNum2" src="/images/homepage/flf/btn_2_bl_wht.gif" border="0" /></a><a href="#" onclick="tab_click(3);"><img id="imgFLFNum3" src="/images/homepage/flf/btn_3_bl_wht_over.gif" border="0" /></a>';


//Window Onload
window.onload = init;
function init()
{
setTimeout("next_timed_slide(2)", slidetime);	
}

//Stop the timed slide presentation and show the selected slide
function tab_click(tabNumber)
{
timer_is_on=0;
slide_change(tabNumber);
}

function slide_change(slideNumber)
{
switch(slideNumber)
{
case 1:
  html_change(strMainImageHTML1, strMainImageDivID);
  html_change(strSeeMoreHTML1, strSeeMoreDivID);
  html_change(strGoButtonHTML1, strGoButtonDivID);
  break;
case 2:
  html_change(strMainImageHTML2, strMainImageDivID);
  html_change(strSeeMoreHTML2, strSeeMoreDivID);
  html_change(strGoButtonHTML2, strGoButtonDivID);
  break;
case 3:
  html_change(strMainImageHTML3, strMainImageDivID);
  html_change(strSeeMoreHTML3, strSeeMoreDivID);
  html_change(strGoButtonHTML3, strGoButtonDivID);
  break;

}
}

function html_change(strHTML,strElementID)
{
var div = document.getElementById(strElementID);
div.innerHTML = strHTML;
}

function next_timed_slide(slideNumber)
{
	//Set up another slide only if timer is on
	if (timer_is_on == 1)
	{
	
	//Change to the next slide
	slide_change(slideNumber)
	
	//increment the slide number
	var newslidenumber = 0;	
	if (currentslidenumber == 1)
	{newslidenumber = 2;}
	if (currentslidenumber == 2)
	{newslidenumber = 3;}
	if(currentslidenumber == 3)
	{newslidenumber = 1;}

	currentslidenumber = newslidenumber;
	
	//start a timer for the next slide
	if (currentslidenumber == 1)
	{setTimeout("next_timed_slide(1)", slidetime);}
	if (currentslidenumber == 2)
	{setTimeout("next_timed_slide(2)", slidetime);}
	if (currentslidenumber == 3)
	{setTimeout("next_timed_slide(3)", slidetime);}
	
	}
	
}

function slideshow()
{
//Start the timed slideshow
setTimeout("next_timed_slide(2)", slidetime);
}
