// JavaScript Document

var auto_flash;

function auto_flash()
{
	jQuery("#flash").load("/template/inc/server/system.aspx?flash=flash",function(){auto_scroll_flash()})
}

function auto_scroll_flash()
{
	i = parseInt(jQuery("#flash_num").val())
	if(i > 3){ i = 0}
	
	var src = jQuery("#flash_smallpic img").eq(i).attr("src")
	var title = jQuery("#flash_smallpic img").eq(i).attr("alt")
	var href = jQuery("#flash_smallpic div a").eq(i).attr("href")
	
	jQuery("#flash_bigpic a").removeAttr("attr").attr({"href":href})
	jQuery("#flash_bigpic a img").attr({"src":src}).css({"display":"none"}).show()
	jQuery("#flash_bigpic_text").text(title)
	jQuery("#flash_smallpic div").not(jQuery("#flash_smallpic div").eq(i)).css({"background-image":"none"})
	jQuery("#flash_smallpic div").eq(i).css({"background-image":"url(/template/images/flash_smallpic_adorn.gif)"})
	
	jQuery("#flash_num").val(i+1)
	auto_flash = setTimeout("auto_scroll_flash()",5000)
}

function stop_flash(num)
{
	clearTimeout(auto_flash);
	var i;
	if(num == null)
	{
		i = parseInt(jQuery("#flash_num").val())
		if(i > 3){ i = 0}
	}
	else
	{
		i = num;
	}
	
	var src = jQuery("#flash_smallpic img").eq(i).attr("src")
	var title = jQuery("#flash_smallpic img").eq(i).attr("alt")
	var href = jQuery("#flash_smallpic div a").eq(i).attr("href")
	
	jQuery("#flash_bigpic a").removeAttr("attr").attr({"href":href})
	jQuery("#flash_bigpic img").attr({"src":src}).css({"display":"none"}).show()
	jQuery("#flash_bigpic_text").text(title)
	jQuery("#flash_smallpic div").not(jQuery("#flash_smallpic div").eq(i)).css({"background-image":"none"})
	jQuery("#flash_smallpic div").eq(i).css({"background-image":"url(/template/images/flash_smallpic_adorn.gif)"})
	
	jQuery("#flash_num").val(i+1)
}

function continue_flash(i)
{
	var src = jQuery("#flash_smallpic img").eq(i).attr("src")
	var title = jQuery("#flash_smallpic img").eq(i).attr("alt")
	var href = jQuery("#flash_smallpic div a").eq(i).attr("href")
	
	jQuery("#flash_bigpic a").removeAttr("attr").attr({"href":href})
	jQuery("#flash_bigpic img").attr({"src":src})
	jQuery("#flash_bigpic_text").text(title)
	jQuery("#flash_smallpic div").not(jQuery("#flash_smallpic div").eq(i)).css({"background-image":"none"})
	jQuery("#flash_smallpic div").eq(i).css({"background-image":"url(/template/images/flash_smallpic_adorn.gif)"})
	
	jQuery("#flash_num").val(i+1)

	auto_flash = setTimeout("auto_scroll_flash()",5000)
}