
//No select text

function disableselect(e){
	return false
}
function reEnable(){
	return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

window.onresize = onresizeW;
function onresizeW(){
	init();
	changeOpacity();
}

	//Coordeandas del raton actuales.
	var mouseX;
	var mouseY;

	//Tamaņo de la ventana
	var winW = 0;
	var	winH = 0;

	//XPos de bigContainer
	var bigContainerX = 360;
	var bigContainerXF;
	var NewPosX;	
	
	//Variable de status
	var status = "volando";

	//timers
	var timer1;
	var timer2;

	//extras texto tamaņo
	var actualSize;
	var actualSize = 12;
	var Gid;

function init(){
	windowSize();
	debug();
}


function windowSize(){
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winW = window.innerWidth;
    winH = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winW = document.documentElement.clientWidth;
    winH = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winW = document.body.clientWidth;
    winH = document.body.clientHeight;
  }
}


function move(value){
	clearInterval(timer1);
	var value;
	NewPosX = value*360*-1;
	NewPosX = NewPosX +360;
	
	bigContainerX = document.getElementById("bigContainer").style.left;
	bigContainerXF = parseFloat (bigContainerX);

	timer1 = setInterval ( "movePlusMinus()", 1 );
}

function movePlusMinus(){
	if ( NewPosX < bigContainerXF ){
		moveMinus();
	}

	if ( NewPosX > bigContainerXF ){
		movePlus();
	}
	
	if ( NewPosX == bigContainerXF ){
		clearInterval(timer1);
		setTimeout ( "changeOpacity()", 60 );
	}
}

function movePlus(){
	bigContainerX = document.getElementById("bigContainer").style.left;
	bigContainerXF = parseFloat (bigContainerX);
	var proximity = NewPosX - bigContainerXF;
	var velocity = (proximity/8);
	if ( velocity > 50 ){
		velocity = 50;
	}else if( velocity < 1 ){
		velocity = 1;
	}
	velocity = parseInt(velocity);
	bigContainerXF = bigContainerXF + velocity;
	document.getElementById("bigContainer").style.left = bigContainerXF+"px";
	debug();
	//changeOpacity();
}

function moveMinus(){
	bigContainerX = document.getElementById("bigContainer").style.left;
	bigContainerXF = parseFloat (bigContainerX);
	var proximity = bigContainerXF - NewPosX;
	var velocity = (proximity/8);
		if ( velocity > 50 ){
		velocity = 50;
	}else if( velocity < 1 ){
		velocity = 1;
	}
	velocity = parseInt(velocity);
	bigContainerXF = bigContainerXF - velocity;
	document.getElementById("bigContainer").style.left = bigContainerXF+"px";
	debug();
	//changeOpacity();
}


function changeOpacity(){
	bigContainerX = document.getElementById("bigContainer").style.left;
	bigContainerXF = parseFloat (bigContainerX);
	
	var i=0;
	var PieceX;
	var alpha;
	var id;
	var id2;
	
	for (i=0;i<=7;i++){
		id = "Piece"+i ;
		id2 = "Txt"+i ;
		PieceX = bigContainerXF + (360*i);
		
		if ( PieceX < 720 && PieceX >= 360) {
		//var MyHeight;
		//MyHeight = document.getElementById("Txt1").offsetHeight;
			//alpha = PieceX/(360);
			//alpha = (1-alpha);
			//if (alpha < 0.5) { alpha = 0.5; }
			
			//document.getElementById(id).style.filter = "alpha(opacity="+(alpha*100)+")";
			//document.getElementById(id).style.opacity = alpha;		
			document.getElementById(id2).style.display = "";
		}else{			
			if ( bigContainerXF == -2520 ){
			}else{
				document.getElementById(id2).style.display = "none";		
			}
		}
	}
	for (i=8;i<=17;i++){
		
		id3 = "Piece"+i ;
		PieceX = bigContainerXF + (360*8);
		
		if ( PieceX < 720 && PieceX >= 360) {
		}else{
			document.getElementById(id3).style.display = "none";
		}
	}
}


function ShowExtra(id){
	var id;
	var id2;
	Gid = "Piece"+id ;
	setTimeout ( "Display()", 500 );
	
	for (i=8;i<=17;i++){
		id2 = "Piece"+i;
		if(id2 != id ){
			document.getElementById(id2).style.display = "none";
		}
	}
}

function Display(){
	document.getElementById(Gid).style.display = "";
}


function textSize(order){
	var order;
	var newSize;
	var id;
	
	if (order == 1){
		for (i=0;i<=8;i++){
			id = "Txt" + i;
			newSize = actualSize + 1;
			if (newSize > 22) { newSize = 22; }
			document.getElementById(id).style.fontSize = newSize + "px";
		}
	}
	
	if (order == 0){
		for (i=0;i<=8;i++){
			id = "Txt" + i;
			newSize = actualSize - 1;
			if (newSize < 11) { newSize = 11; }
			document.getElementById(id).style.fontSize = newSize + "px";
		}
	}
	
	debug()
	actualSize = newSize;
}


function ShowCopy(action){
	var action;
	var CopyX;
	
	CopyX = document.getElementById("Copy").style.right;
	CopyX = parseFloat (CopyX);
	
	if ( action == 1 ){
		//document.getElementById("Copy").style.right="0px";
		document.getElementById("cFuera").style.display="";
		document.getElementById("cDentro").style.display="none";

		setTimeout("ShowCopy(0)",6000);
		timer2 = setInterval ( "MoveCopyPlus()", 1 );
		
	}else if( action == 0 ){
		//document.getElementById("Copy").style.right="-145px";
		timer2 = setInterval ( "MoveCopyMinus()", 1 );		
	}
}


function MoveCopyPlus(){
	var CopyX;
	var NewCopyX;
	CopyX = document.getElementById("Copy").style.right;
	CopyX = parseFloat (CopyX);
	
	var proximity = -(CopyX*100)/145;
	proximity = parseInt(proximity);
	
	var velocity = (proximity/8);
		if ( velocity > 20 ){
		velocity = 20;
	}else if( velocity < 1 ){
		velocity = 1;
	}
	velocity = parseInt(velocity);
	NewCopyX = CopyX + velocity;
	
	if(CopyX >= 0){
		clearInterval(timer2);
		document.getElementById("Copy").style.right= "0px";
	}else{
		document.getElementById("Copy").style.right= NewCopyX + "px";
	}
}

function MoveCopyMinus(){
	var CopyX;
	var NewCopyX;
	CopyX = document.getElementById("Copy").style.right;
	CopyX = parseFloat (CopyX);
	
	var proximity = -(CopyX*100)/145;
	proximity = parseInt(proximity);
	//proximity = 100 - proximity;
	
	var velocity = (proximity/8);
		if ( velocity > 20 ){
		velocity = 20;
	}else if( velocity < 1 ){
		velocity = 1;
	}
	velocity = parseInt(velocity);
	NewCopyX = CopyX - velocity;
	
	if(CopyX <= -145){
		clearInterval(timer2);
		document.getElementById("Copy").style.right= "-145px";
		document.getElementById("cFuera").style.display="none";
		document.getElementById("cDentro").style.display="";
	}else{
		document.getElementById("Copy").style.right= NewCopyX + "px";
	}
}

function debug(){
	document.getElementById("debug").innerHTML = 
	"<br />&nbsp;&nbsp;&nbsp;&nbsp; TextSize = " + actualSize +
	"<br />&nbsp;&nbsp;&nbsp;&nbsp; WinW = " + winW +
	"<br />&nbsp;&nbsp;&nbsp;&nbsp; WinH = " + winH +
	"<br />&nbsp;&nbsp;&nbsp;&nbsp;	ContainerX = " + bigContainerXF+
	"<br />&nbsp;&nbsp;&nbsp;&nbsp;	NewPosX = " + NewPosX ;
}

function GoToURL(url) {
  	var url;
	var location = (url);
	this.location.href = location;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
