// JavaScript Document
if (navigator.userAgent.match(/like Mac OS X/i)) {
           ios = true;
        }else{
		ios = false;	
		}


var bighold = document.getElementById('bigslidemover');
var dotshold = document.getElementById('bigslidedots');
var biglefty = document.getElementById('bigslideleft');
var bigrighty = document.getElementById('bigslideright');


var currentbig = 0;
createdots();
checkbigarrows();

var slidewidth = 876;

var bigshow = setInterval(function(){bigslideright()},9000);
if(ios != true) {
for (i=1;i<=totalbigslides;i++)
		{
		document.getElementById('bigslide'+i).style.opacity = '.1';	
		}
}

function killbigshow() {
clearInterval(bigshow);	
}


function loadbig(bignum){
	if(bignum != currentbig){
if(ios != true) {
		for (i=0;i<=totalbigslides;i++)
		{
		document.getElementById('bigslide'+i).style.opacity = '.1';	
		}
		document.getElementById('bigslide'+bignum).style.opacity = '1';
}
		theleft = 0 - (slidewidth * bignum);
		bighold.style.left = theleft+"px";
		currentbig = bignum;
		checkbigarrows();	
	}
}


function bigslideleft() {
	
	if(currentbig == 0){
	loadbig(totalbigslides);	
	}else{
	loadbig(currentbig-1);
	}
	
checkbigarrows();
	
}

function bigslideright() {

	if(currentbig == totalbigslides){
	loadbig(0);	
	}else{
	loadbig(currentbig+1);
	}
	
checkbigarrows();
	
}


function checkbigarrows() {
	
for (i=0;i<=totalbigslides;i++)
{
if (currentbig == i){
document.getElementById("slidedot"+i).style.backgroundPosition = "-16px 0px";
}else{
document.getElementById("slidedot"+i).style.backgroundPosition = "0px 0px";
}
}

if(currentbig == 0){
biglefty.style.backgroundPosition = "-40px 0px";	
}else{
biglefty.style.backgroundPosition = "0px 0px";	
}
	
if(currentbig == totalbigslides){
bigrighty.style.backgroundPosition = "-40px -94px";	
}else{
bigrighty.style.backgroundPosition = "0px -94px";	
}
	
}

function createdots() {
var dotshtml = "";
	for (i=0;i<=totalbigslides;i++)
{
dotshtml = dotshtml + '<div class="slidedot" id="slidedot'+i+'"><a href="javascript:;" onclick="loadbig('+i+'); killbigshow(); return false;"><img src="main-images/invisible.png" width="16" height="16" border="0" /></a></div>';
}

dotshold.innerHTML = dotshtml;
	
}
