// JavaScript Document

//Testlink
var cpos = 20;
function moveTest() {
//sample------------ document.getElementById('Controls').style.visibility = 'hidden';

document.getElementById('Controls').style.left = cpos+'px';
cpos = cpos+20;
//document.getElementById('Controls').style.visibility = 'hidden';
}


//get window height and width
var winW;
var winH;
function getWinW() {
        
        if (self.innerHeight)
        {
                winW = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                winW = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                winW = document.body.clientWidth;
        }
}
function getWinH() {
        
        if (self.innerHeight)
        {
                winH = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                winH = document.documentElement.clientHeight;
        }
        else if (document.body)
        {
                winH = document.body.clientHeight;
        }
}
getWinW();
getWinH();

var contWidth = winW-435;
//adjust to window
function fitOnwin() {
	//document.getElementById('TopArea').style.left = winW-140+'px';
	document.getElementById('PersArea').style.left = winW-306+'px';
	document.getElementById('LogArea').style.left = 180+'px';
	document.getElementById('Tiendas').style.left = 200+'px';
	document.getElementById('Tiendas').style.width = winW-340+'px';
	document.getElementById('InfoArea').style.height = 280+'px';
	
	document.getElementById('layout').style.width = winW-140+'px';
	document.getElementById('InfoArea').style.width = winW-140+'px';
	document.getElementById('Sld').style.width = winW-283+'px';
	
	document.getElementById('BoxSugerencia').style.left = winW-280+'px';
	document.getElementById('btnNext').style.left = winW-315+'px';
	document.getElementById('BoxInfo').style.left = winW-280+'px';
	document.getElementById('Contenido').style.width = contWidth+'px';
	
}

//rollover
function frameOn(divID, newAtt) {
	//var selID = "'"+divID+"'";
	document.getElementById(divID).style.visibility=newAtt;
}
function flechita(divID, newAtt) {
	//var selID = "'"+divID+"'";
	document.getElementById(divID).src=newAtt;
}
function muSet(turno, muDiv) {

	for (i=0;i<muVis;i++){
		document.getElementById(muDiv[turno]).style.left = loc[i]+'px';
		document.getElementById(muDiv[turno]).style.visibility = 'visible';
		turno++;
	}
	muNext=turno;
}

function muCycle(muDiv){
	muNx = muNext-muPlace;
	steps = 2;
	muDisp = muOff/steps*-1;
	muStart=muNx;
	f=0;
	function moveIt(muS) {
		muSi=muNx;
		if (f<steps){
			for (i=0;i<muPlace;i++){
				var muPosI = parseInt(document.getElementById(muDiv[muS]).style.left);
				document.getElementById(muDiv[muS]).style.left = muPosI+muDisp+'px';
				muS++;
			}
			f++;
			if(f==steps){
			document.getElementById(muDiv[muSi]).style.visibility ='hidden';
			musStart++;
			
			}
			muS=muSi
			setTimeout(moveIt(muS),1000);
		}
	}
	
	
	function moveAll(){
		moveIt(muStart);
		
	}
	moveAll();
	//alert(muNext);
}
