function redireccionar()
{
	var section = new Array();

	var url = String(window.location);
	section = url.split("=");

	if (section[1] != 'undefined')
	{
		go_to(String(section[1]));
	}
}

scrollmarks = new Array();
var sum = 0;

for (var index in cantidades)
{
	var j = 0;
	var index2 = "";

	for(var i=1; i<=cantidades[index]; i++)
	{
		var indexTotal = String(index+index2);
		scrollmarks[indexTotal] = sum;

		sum = sum + 1000;
		index2 = i;
	}
}

autoscroll = false;

function go_to(label)
{
	autoscroll = true;
	scroll_to(scrollmarks[label]);
	autoscroll = false;
}

function scroll_to(to)
{
	autoscroll = true;
	if (frameScroll.document.body){
		distance = Math.abs(to - frameScroll.document.body.scrollLeft);
		direction = (to - frameScroll.document.body.scrollLeft) / Math.abs(to - frameScroll.document.body.scrollLeft);
	}else{
		distance = Math.abs(to - frameScroll.window.pageXOffset);
		direction = (to - frameScroll.window.pageXOffset) / Math.abs(to - frameScroll.window.pageXOffset);
	}

	var i=0;
	var step = Math.round(distance/8.6);
	var slowdown_point = distance / 1.80;
	while (i<distance)
	{
		if ( (distance-i) < slowdown_point && step > 1)
		{
			step = Math.round(step * 0.82);
		}
		if ( (distance-i) < step )
		{
			autoscroll = false;
			step = (distance-i);
		}
		i+=step;
		frameScroll.window.scrollBy(step * direction,0);
	}
}


//---------Begins Flash Detection------------
var MM_FlashCanPlay = false;

var MM_contentVersion = 6;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if(plugin){
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for(var i=0; i < words.length; ++i){
		if (isNaN(parseInt(words[i])))
			continue;
		var MM_PluginVersion = words[i];
	}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
//---------Ends Flash Detection------------


//------------------------------------
function abrirPopup(url,ancho,alto){
	ancho = (ancho)?ancho:790;
	alto = (alto)?alto:550;
	posX = screen.width / 2 - ancho / 2;
	posY = screen.height / 2 - alto / 2;
	win = frameScroll.window.open(url,'Ventana','resizable=1,scrollbars=1,top='+posY+',left='+posX+',height='+alto+',width='+ancho );
}

//----------------------------------------
/*
if (frameScroll.window.addEventListener) {
    frameScroll.window.addEventListener("DOMMouseScroll", escrollear, false); } else {
    document.onmousewheel = escrollear;
}
scrollval = 0;
function escrollear(e){
    if(typeof(e)!="undefined"){
        if (e.detail >= 3){
            var velocidad = 50;
        }else if(e.detail <= -3){
            var velocidad = -50;
        }
    }else{
        if (frameScroll.window.event.wheelDelta >= 120){
            var velocidad = -50;
        }else if(frameScroll.window.event.wheelDelta <= -120){
            var velocidad = 50;
        }
    }
    scrollval+=velocidad;
    scrollTo(scrollval,0);
}
//-----------------------------------
*/


