var contador = 0;
/*var altoThumb_corpo = 132;*/
var altoThumb_corpo = 167;
var cteY_corpo = altoThumb_corpo/12;

var altoThumb_coment = 135;
var cteY_coment = (altoThumb_coment/15);

var cual = "";
var scroleando = false;
function slideYthumbsTop(kual, limite, objForm, este, posFijo){
	if(posFijo == undefined){
		posFijo = '';
	}
	if(objForm != undefined || objForm != null){
		if(objForm.contador.value<limite-2 && !scroleando){
			contador = objForm.contador.value;
			contador ++;
			objForm.contador.value = contador;
		}
	}else{
		if(contador<limite-2 && !scroleando){
			if(objForm != undefined || objForm != null){
				contador = objForm.contador.value;
			}
			contador ++;
			objForm.contador.value = contador;
		}
	}
	if(kual != undefined){
		cual = kual;
	}
	if(cual == 'slideComent'){
		var miAlto = altoThumb_coment;
		var miCte = cteY_coment;
		var compenza = 2;
	}else{
		var miAlto = altoThumb_corpo;
		var miCte = cteY_corpo;
		var compenza = 0;
	}
		
	slidDivObj = document.getElementById(cual);
	if (parseInt(slidDivObj.style.top) > -(miAlto+compenza)*contador){
		scroleando = true;
		slidDivObj.style.top = parseInt(slidDivObj.style.top) - miCte + "px";
		setTimeout("slideYthumbsTop('"+cual+"',"+limite+")", 1);
	}else{
		slidDivObj.style.top = -(miAlto+compenza)*contador + 'px';
		scroleando = false;
	}
	
	if (este != undefined) {
		nodoPadre = este.parentNode.parentNode;
		var nomNavegador = navigator.appName;
		if (nomNavegador == "Microsoft Internet Explorer"){
			flechaSup = nodoPadre.firstChild.nextSibling;
			flechaInf = nodoPadre.firstChild.nextSibling.nextSibling.nextSibling
		}else {
			flechaSup = nodoPadre.firstChild.nextSibling.nextSibling.nextSibling;
			flechaInf = nodoPadre.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
		}
	
		if(cual == 'slideComent'){
			flechaSup.firstChild.nextSibling.style.backgroundImage = 'url(http://i2.esmas.com/tvolucion/coke20/img/flechaTop'+posFijo+'.png)';
		}else{
			flechaSup.firstChild.style.backgroundImage = 'url(http://i2.esmas.com/tvolucion/coke20/img/flechaTop'+posFijo+'.png)';
		}
	
		if(objForm.contador.value>limite-3){
			este.style.backgroundImage = 'url(http://i2.esmas.com/tvolucion/coke20/img/flechaBott'+posFijo+'_off.png)';
		}
	}
	
	
}

function slideYthumbsBot(kual, objForm, este, posFijo){
	if(posFijo == undefined){
		posFijo = '';
	}
	if(objForm != undefined && objForm != null){
		if(objForm.contador.value>0 && !scroleando){
			contador = objForm.contador.value;
			contador --;
			objForm.contador.value = contador;
		}
	}else{
		if(contador>0 && !scroleando){
			if(objForm != undefined || objForm != null){
				contador = objForm.contador.value;
			}
			contador --;
			objForm.contador.value = contador;
		}
	}
	
	if(kual != undefined){
		cual = kual;
	}
	
	if(cual == 'slideComent'){
		var miAlto = altoThumb_coment;
		var miCte = cteY_coment;
		var compenza = 2;
	}else{
		var miAlto = altoThumb_corpo;
		var miCte = cteY_corpo;
		var compenza = 0;
	}
	
	slidDivObj = document.getElementById(cual);
	if (parseInt(slidDivObj.style.top) < -(miAlto+compenza)*contador){
		scroleando = true;
		slidDivObj.style.top = parseInt(slidDivObj.style.top) + miCte + "px";
		setTimeout("slideYthumbsBot('"+cual+"')", 1);
	}else{
		slidDivObj.style.top = -(miAlto+compenza)*contador + 'px';
		scroleando = false;	
	}
	
	if (este != undefined) {
		nodoPadre = este.parentNode.parentNode;
		var nomNavegador = navigator.appName;
		if (nomNavegador == "Microsoft Internet Explorer"){
			flechaSup = nodoPadre.firstChild.nextSibling;
			flechaInf = nodoPadre.firstChild.nextSibling.nextSibling.nextSibling
		}else {
			flechaSup = nodoPadre.firstChild.nextSibling.nextSibling.nextSibling;
			flechaInf = nodoPadre.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
		}
	
		if(cual == 'slideComent'){
			flechaInf.firstChild.nextSibling.style.backgroundImage = 'url(http://i2.esmas.com/tvolucion/coke20/img/flechaBott'+posFijo+'.png)';
		}else{
			flechaInf.firstChild.style.backgroundImage = 'url(http://i2.esmas.com/tvolucion/coke20/img/flechaBott'+posFijo+'.png)';
		}
	
		if(objForm.contador.value<1){	
			este.style.backgroundImage = 'url(http://i2.esmas.com/tvolucion/coke20/img/flechaTop'+posFijo+'_off.png)';
		}
	}
	
}
var ban1=0;
var ban2=0;
function rollThumb(este){
	
	/*slidDivObj = document.getElementById('thumbCocaInfo');
	slidDivObj.style.top = parseInt(slidDivObj.style.top) - 1 + "px";
	setTimeout("rollOutThumb('"+indiceThmb+"')", 1);
	
	if (parseInt(elementosInfoThmb[0].style.bottom) > 30){
		elementosInfoThmb[0].style.top = parseInt(elementosInfoThmb[0].style.top) - 1 + "px";
		setTimeout("rollOutThumb('"+indiceThmb+"')", 1);
	}else{
		
	}

	var elemento = este.firstChild.nextSibling.nextSibling.nextSibling.nextSibling;
	elemento.style.bottom = '0';*/
	
	var esteTmp = este.parentNode;
	var nomNavegador = navigator.appName;
	if(ban1==0){
		if (nomNavegador == "Microsoft Internet Explorer"){
			var esteTambien = esteTmp.firstChild.nextSibling.nextSibling.nextSibling.nextSibling;
		}else {
			var esteTambien = esteTmp.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
		}
	
		t1 = new Tween(esteTambien.style,'bottom',Tween.regularEaseOut,-70,0,0.5,'px');
		t1.start();
		ban1=1;
	}else{
		ban1=0;
	}
}

function rollOutThumb(este){
	if(t1 != null || t1 != undefined){
		t1.stop();
	}
	var esteTmp = este.parentNode;
	var nomNavegador = navigator.appName;
	if(ban2==0){
		if (nomNavegador == "Microsoft Internet Explorer"){
			var esteTambien = esteTmp.firstChild.nextSibling.nextSibling.nextSibling.nextSibling;
		}else {
			var esteTambien = esteTmp.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
		}
		esteTambien.style.bottom = '-70px';
		ban2=1;
	}else{
		ban2=0;
	}
	
}

function scrollComentTop(cual){
	slidDivObj_coment = document.getElementById(cual);
	if (parseInt(slidDivObj_coment.style.top) < 0){
		slidDivObj_coment.style.top = parseInt(slidDivObj_coment.style.top) + 10 + "px";	
	}else{
		slidDivObj_coment.style.top = '0px';
	}
	
}

function scrollComentBot(cual, cuantos){
	slidDivObj_coment_ = document.getElementById(cual);
	/*alert(((cuantos-4)*180)+'px')*/
	if (parseInt(slidDivObj_coment_.style.top) > -190){
		slidDivObj_coment_.style.top = parseInt(slidDivObj_coment_.style.top) - 10 + "px";
	}else{
		
	}
	
}

window.onload=function(){
	if(document.columnaIzq != null){
		document.columnaIzq.contador.value = 0;
	}
	if(document.columnaCen != null){
		document.columnaCen.contador.value = 0;
	}
	if(document.columnaDer != null){
		document.columnaDer.contador.value = 0;
	}
	if(document.columnaComent != null){
		document.columnaComent.contador.value = 0;
	}
	if ( document.getElementById('starsContainer')) {
	loadStarsRating();
	}	
};
