// JavaScript Document

var sliderwidth="600px"
//Specify the slider's height
var sliderheight="150px"
//Specify the slider's slide speed (larger is faster 1-10)
//var slidespeed=2
//configure background color:
slidebgcolor=""

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=0;


////NO NEED TO EDIT BELOW THIS LINE////////////


if(typeof(slidespeed) == "undefined")
	slidespeed = 2;
if(typeof(slide_a_height) == "undefined")
	slide_a_height = 80;
if(typeof(slide_a_width) == "undefined")
	slide_a_width = 120;
	
var copyspeed=slidespeed

var iedom

var actualwidth=''
var cross_slide, ns_slide

function g_fixImageMargin(cm){
	var imgs = cm.getElementsByTagName("img");
	
	for(i = 0; i < imgs.length; i++){
		if(imgs[i].style){
			imgs[i].parentNode.style.cssFloat = "left";
			imgs[i].parentNode.style.styleFloat = "left";
			imgs[i].parentNode.style.display = "block";
			imgs[i].style.marginTop = (slide_a_height - imgs[i].height) / 2 + "px";
			imgs[i].style.marginLeft = (slide_a_width - imgs[i].width) / 2 + "px";
		}
	}
}

_slide_current_window_onload = window.onload;


function init_slide(){
	iedom = document.all||document.getElementById
	
	if (_slide_current_window_onload)
		_slide_current_window_onload();
		
	if (iedom){
		cross_slide = document.getElementById? document.getElementById("test2") : document.all.test2;
		cross_slide2 = document.getElementById? document.getElementById("test3") : document.all.test3;
		//cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
		//actualwidth = cross_slide.offsetWidth;
		actualwidth = cross_slide.getElementsByTagName("a").length;
		actualwidth = actualwidth * (slide_a_width + 5 + 2);
		cross_slide.style.width = actualwidth + "px";
		cross_slide2.style.width = actualwidth + "px";
		cross_slide2.style.left=actualwidth+slideshowgap+"px"
		g_fixImageMargin(cross_slide);
		g_fixImageMargin(cross_slide2);
	}
	
	lefttime=setInterval("slideleft()",30)
}
window.onload = init_slide;

function slideleft(){
if (iedom){
	if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
		cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
	else
		cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
	
	if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
		cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
	else
		cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}

/*else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}*/
}
