idx_2 = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10a', '10b', '11', '12a', '12b', '12c');
idx2_2 = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10a', '10b', '11', '12a', '12b', '12c');
picture_2 = new Array();
picture2_2 = new Array();

var vNav_2 = 0;
var vScroll_2 = false;
var run_2 = false;

// time delay between slides (in milliseconds)
var vTimer_2 = 12000;

// check for ie
function isIe_2()
{
	
	if(navigator.appVersion.indexOf("MSIE") > -1 && navigator.userAgent.indexOf("Opera") <= -1)
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

// set picture index (ie)
function navIe_2(p_index)
{
	document.images.img_1_2.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=2)";
	document.images.img_1_2.filters[0].apply();
	document.images.img_1_2.src = picture_2[p_index].src;
	document.images.img_1_2.filters[0].play();

	document.images.img_3_2.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=2)";
	document.images.img_3_2.filters[0].apply();
	document.images.img_3_2.src = picture2_2[p_index].src;
	document.images.img_3_2.filters[0].play();
}

// set picture index (other browsers)
function navNorm_2(p_index)
{
	 document.images.img_1_2.src = picture_2[p_index].src;
	 document.images.img_3_2.src = picture2_2[p_index].src;
}

// change slide (true - next, false - previous)
function nav_2(d)
{
	if(d == 1) // next
	{
		if(vNav_2 == picture_2.length - 1)
		{
			vNav_2 = 0;
		}
		else
		{
			vNav_2 = vNav_2 + 1;
		}
	}
	else // prev
	{
		if(vNav_2 == 0)
		{
			vNav_2 = picture_2.length - 1;
		}
		else
		{
			vNav_2 = vNav_2 - 1;
		}
	}

	if(!picture_2[vNav_2]) loadText_2(vNav_2);
	if(!picture2_2[vNav_2]) loadImage_2(vNav_2);

	if(!isIe_2())
	{
		navNorm_2(vNav_2);
	}
	else
	{
		navIe_2(vNav_2);
	}
}

function nextPic_2()
{
	nav_2(1);
	window.clearInterval(run_2);
	vScroll_2 = false;
}

function prevPic_2()
{
	nav_2(0);
	window.clearInterval(run_2);
	vScroll_2 = false;
}

// start/stop slideshow
function startstop_2() 
{
	if(vScroll_2 == true) 
	{
		window.clearInterval(run_2);
	}
	else
	{
		run_2 = setInterval("nav_2(true)", vTimer_2);
	}
	vScroll_2 = !vScroll_2;
	
}

function loadText_2(p_index)
{
	picture_2[p_index] = new Image();
	picture_2[p_index].src = site_url+'/images/why_carousel/'+idx_2[p_index]+'text.gif';
}

function loadImage_2(p_index)
{
	picture2_2[p_index] = new Image();
	picture2_2[p_index].src = site_url+'/images/why_carousel/'+idx2_2[p_index]+'image.jpg';
}

// preload images
function preLoadImages_2()
{
	for(i = 0; i <= idx_2.length-1; i++)
	{
		loadText_2(i);
		loadImage_2(i);
	}
	
	startstop_2();
}

function slower_2()
{
	vTimer_2 -= 1000;
	if(vTimer_2 < 1000)
	{
		vTimer_2 = 1000;
	}	
}

function faster_2()
{
	vTimer_2 += 1000;
	if(vTimer_2 > 10000)
	{
		vTimer_2 = 10000;
	}	
}

function calcPosition_2()
{
	var iLeft_2 = (window.document.body.offsetWidth/2); 
	var iTop_2 = (window.document.body.offsetWidth/2);
	document.images.img_1_2.style.left= iLeft_2 - 375;	
	document.images.img_3_2.style.left= iLeft_2 - 22;	
}
