// JavaScript Document
function mainMenuOver(x)
{
	x.className = "mainMenuActive";
}

function mainMenuOut(x)
{
	x.className = "mainMenu";
}

function langOver(x, langID)
{
	x.src = "images/" + langID +"_active.jpg";
	//window.alert(x);
}
function langOut(x, langID)
{
	x.src = "images/" + langID +".jpg";
}

var movingNow=false;

function left()
{
	if (movingNow)
	return;
	if (currentPic<picMaxNumber)
	{
		movingNow = true;
		curr_Pic = document.getElementById("pic"+currentPic);
		another_Pic = document.getElementById("pic"+(currentPic+1));
		movingLeft = setInterval("leftit(curr_Pic, another_Pic)",50);
		currentPic = currentPic + 1;
	}
}

function leftit(cur, next)
{
	if (cur.filters.alpha.opacity>20)
	{
		cur.filters.alpha.opacity-=5;		
		next.filters.alpha.opacity+=5;
		x= document.getElementById("imageSet").style.posLeft;
		w1= cur.width;
		w2= next.width;
		cur.width = w1 - 2;
		next.width = w2 + 2;
		
		//window.alert(x);
		document.getElementById("imageSet").style.posLeft = x-10;
		
	}else{
		if (window.movingLeft)
		{
			clearInterval(movingLeft);
			movingNow = false;
		}
	}
}

function right()
{
	if (movingNow)
	return;
	if (currentPic>1)
	{
		movingNow = true;
		curr_Pic = document.getElementById("pic"+currentPic);
		another_Pic = document.getElementById("pic"+(currentPic-1));
		movingRight = setInterval("rightit(curr_Pic, another_Pic)",50);
		currentPic = currentPic - 1;
	}
}


function rightit(cur, next)
{
	if (cur.filters.alpha.opacity>20)
	{
		cur.filters.alpha.opacity-=5;		
		next.filters.alpha.opacity+=5;
		w1= cur.width;
		w2= next.width;
		cur.width = w1 - 2;
		next.width = w2 + 2;

		x= document.getElementById("imageSet").style.posLeft;
		//window.alert(x);
		document.getElementById("imageSet").style.posLeft = x+10;
	}else{
		if (window.movingRight)
		{
			clearInterval(movingRight)
			movingNow = false;
		}
	}
}
