// Made by geeeet@ghtml.com
// Keep these two lines and you're free to use this code

// Known bugs :
// Not able to remove browser-scrollbar in netscape 6, if the span "content" is heigher than browserwindow... :-(
// If ie4.5 mac, please press apple-t to remove sidebar, otherwise everything is pushed 20px to the right...

// Corrected bugs :
// 25.01.2001 - When the height of the span "content" was less than the height of the span "contentClip" a javascript error occured, function changed : move()
// 21.02.2001 - Scrolling text wasn't selectable in ie, function changed : move()
// 05.03.2001 - Ie x and y coordinates was wrong when page was scrolled, function changed : getMouse()

// Touch me here :-)


// And now... go to the bottom of the page...

// Browser detection
var dom = document.getElementById ? true:false;
var nn4 = document.layers ? true:false;
var ie4 = document.all ? true:false;

var timer = setTimeout("",500); // Repeat variable
var speed = 6; // Scroll speed


var estadoScroll_1 = 'hide';

var upH_1 = 20; // Height of up-arrow
var upW_1 = 24; // Width of up-arrow
var downH_1 = 20; // Height of down-arrow
var downW_1 = 24; // Width of down-arrow
var dragH_1 = 26; // Height of scrollbar
var dragW_1 = 25; // Width of scrollbar
var scrollH_1 = 78; // Height of scrollbar


var mouseY_1; // Mouse Y position onclick
var mouseX_1; // Mouse X position onclick

var clickUp_1 = false; // If click on up-arrow
var clickDown_1 = false; // If click on down-arrow
var clickDrag_1 = false; // If click on scrollbar
var clickAbove_1 = false; // If click above scrollbar
var clickBelow_1 = false; // If click below scrollbar

var upL_1; // Up-arrow X
var upT_1; // Up-arrow Y
var downL_1; // Down-arrow X
var downT_1; // Down-arrow Y
var dragL_1; // Scrollbar X
var dragT_1; // Scrollbar Y
var rulerL_1; // Ruler X
var rulerT_1; // Ruler Y
var contentT_1; // Content layer Y;
var contentH_1; // Content height
var contentClipH_1; // Content clip height
var scrollLength_1; // Number of pixels scrollbar should move
var startY_1; // Keeps track of offset between mouse and span

// Mousedown
function down(e){
	if((document.layers && e.which!=1) || (document.all && event.button!=1)) return true; // Enables the right mousebutton
	getMouse(e);
	

	activa_down=false;

		startY_1 = (mouseY_1 - dragT_1);
		startY_2 = (mouseY_2 - dragT_2);
		startY_3 = (mouseY_3 - dragT_3);
		
		// If click on up-arrow, inferior
	if (estadoScroll_1=='show') if(mouseX_1 >= upL_1 && (mouseX_1 <= (upL_1 + upW_1)) && mouseY_1 >= upT_1 && (mouseY_1 <= (upT_1 + upH_1))){
		clickUp_1 = true; activa_down=true;
		return scrollUp_1();
	}	
	// Else if click on down-arrow, inferior
	else if (estadoScroll_1=='show') if(mouseX_1 >= downL_1 && (mouseX_1 <= (downL_1 + downW_1)) && mouseY_1 >= downT_1 && (mouseY_1 <= (downT_1 + downH_1))){
		clickDown_1 = true; activa_down=true;
		return scrollDown_1();
	}
	// Else if click on scrollbar, inferior
	else if (estadoScroll_1=='show') if(mouseX_1 >= dragL_1 && (mouseX_1 <= (dragL_1 + dragW_1)) && mouseY_1 >= dragT_1 && (mouseY_1 <= (dragT_1 + dragH_1))){
		clickDrag_1 = true; activa_down=true;
		return false;
	}
	else if (estadoScroll_1=='show') if(mouseX_1 >= dragL_1 && (mouseX_1 <= (dragL_1 + dragW_1)) && mouseY_1 >= rulerT_1 && (mouseY_1 <= (rulerT_1 + scrollH_1))){
		// If click above drag
		if(mouseY_1 < dragT_1){
			clickAbove_1 = true; 
			clickUp_1 = true; activa_down=true;
			return scrollUp_1();
		}
		// Else click below drag
		else{
			clickBelow_1 = true;
			clickDown_1 = true; activa_down=true;
			return scrollDown_1();
		}
	}
		// If click on up-arrow, inferior
	if (estadoScroll_2=='show') if(mouseX_2 >= upL_2 && (mouseX_2 <= (upL_2 + upW_2)) && mouseY_2 >= upT_2 && (mouseY_2 <= (upT_2 + upH_2))){
		clickUp_2 = true; activa_down=true;
		return scrollUp_2();
	}	
	// Else if click on down-arrow, inferior
	else if (estadoScroll_2=='show') if(mouseX_2 >= downL_2 && (mouseX_2 <= (downL_2 + downW_2)) && mouseY_2 >= downT_2 && (mouseY_2 <= (downT_2 + downH_2))){
		clickDown_2 = true; activa_down=true;
		return scrollDown_2();
	}
	// Else if click on scrollbar, inferior
	else if (estadoScroll_2=='show') if(mouseX_2 >= dragL_2 && (mouseX_2 <= (dragL_2 + dragW_2)) && mouseY_2 >= dragT_2 && (mouseY_2 <= (dragT_2 + dragH_2))){
		clickDrag_2 = true; activa_down=true;
		return false;
	}
	else if (estadoScroll_2=='show') if(mouseX_2 >= dragL_2 && (mouseX_2 <= (dragL_2 + dragW_2)) && mouseY_2 >= rulerT_2 && (mouseY_2 <= (rulerT_2 + scrollH_2))){
		// If click above drag
		if(mouseY_2 < dragT_2){
			clickAbove_2 = true; 
			clickUp_2 = true; activa_down=true;
			return scrollUp_2();
		}
		// Else click below drag
		else{
			clickBelow_2 = true;
			clickDown_2 = true; activa_down=true;
			return scrollDown_2();
		}
	}
		// If click on up-arrow, inferior
	if (estadoScroll_3=='show') if(mouseX_3 >= upL_3 && (mouseX_3 <= (upL_3 + upW_3)) && mouseY_3 >= upT_3 && (mouseY_3 <= (upT_3 + upH_3))){
		clickUp_3 = true; activa_down=true;
		return scrollUp_3();
	}	
	// Else if click on down-arrow, inferior
	else if (estadoScroll_3=='show') if(mouseX_3 >= downL_3 && (mouseX_3 <= (downL_3 + downW_3)) && mouseY_3 >= downT_3 && (mouseY_3 <= (downT_3 + downH_3))){
		clickDown_3 = true; activa_down=true;
		return scrollDown_3();
	}
	// Else if click on scrollbar, inferior
	else if (estadoScroll_3=='show') if(mouseX_3 >= dragL_3 && (mouseX_3 <= (dragL_3 + dragW_3)) && mouseY_3 >= dragT_3 && (mouseY_3 <= (dragT_3 + dragH_3))){
		clickDrag_3 = true; activa_down=true;
		return false;
	}
	else if (estadoScroll_3=='show') if(mouseX_3 >= dragL_3 && (mouseX_3 <= (dragL_3 + dragW_3)) && mouseY_3 >= rulerT_3 && (mouseY_3 <= (rulerT_3 + scrollH_3))){
		// If click above drag
		if(mouseY_3 < dragT_3){
			clickAbove_3 = true; 
			clickUp_3 = true; activa_down=true;
			return scrollUp_3();
		}
		// Else click below drag
		else{
			clickBelow_3 = true;
			clickDown_3 = true; activa_down=true;
			return scrollDown_3();
		}
	}
		// If no scrolling is to take place
	return activa_down;
	/*
	else{
		return true;
	}*/
}

// Drag function
function move(e){

	activa_move = false;
	
		if(clickDrag_1 && contentH_1 > contentClipH_1){
		getMouse(e);
		activa_move=true;
		dragT_1 = (mouseY_1 - startY_1);
		
		if(dragT_1 < (rulerT_1))
			dragT_1 = rulerT_1;		
		if(dragT_1 > (rulerT_1 + scrollH_1 - dragH_1))
			dragT_1 = (rulerT_1 + scrollH_1 - dragH_1);
		
		contentT_1 = ((dragT_1 - rulerT_1)*(1/scrollLength_1));
		contentT_1 = eval('-' + contentT_1);

		moveTo_1();
		
		
		
		
			
	}
		if(clickDrag_2 && contentH_2 > contentClipH_2){
		getMouse(e);
		activa_move=true;
		dragT_2 = (mouseY_2 - startY_2);
		
		if(dragT_2 < (rulerT_2))
			dragT_2 = rulerT_2;		
		if(dragT_2 > (rulerT_2 + scrollH_2 - dragH_2))
			dragT_2 = (rulerT_2 + scrollH_2 - dragH_2);
		
		contentT_2 = ((dragT_2 - rulerT_2)*(1/scrollLength_2));
		contentT_2 = eval('-' + contentT_2);

		moveTo_2();
		
		
		
		
			
	}
		if(clickDrag_3 && contentH_3 > contentClipH_3){
		getMouse(e);
		activa_move=true;
		dragT_3 = (mouseY_3 - startY_3);
		
		if(dragT_3 < (rulerT_3))
			dragT_3 = rulerT_3;		
		if(dragT_3 > (rulerT_3 + scrollH_3 - dragH_3))
			dragT_3 = (rulerT_3 + scrollH_3 - dragH_3);
		
		contentT_3 = ((dragT_3 - rulerT_3)*(1/scrollLength_3));
		contentT_3 = eval('-' + contentT_3);

		moveTo_3();
		
		
		
		
			
	}
		// So ie-pc doesn't select gifs
	if(ie4 && activa_move)	
			return false;
}

function up(){
	clearTimeout(timer);
	// Resetting variables
		clickUp_1 = false; 
	clickDown_1 = false; 
	clickDrag_1 = false; 
	clickAbove_1 = false; 
	clickBelow_1 = false; 
		clickUp_2 = false; 
	clickDown_2 = false; 
	clickDrag_2 = false; 
	clickAbove_2 = false; 
	clickBelow_2 = false; 
		clickUp_3 = false; 
	clickDown_3 = false; 
	clickDrag_3 = false; 
	clickAbove_3 = false; 
	clickBelow_3 = false; 
		return true;
}



// Reads content layer top
function getT_1(){
	if(ie4)
		contentT_1 = document.all.content_1.style.pixelTop;
	else if(nn4)
		contentT_1 = document.contentClip_1.document.content_1.top;
	else if(dom)
		contentT_1 = parseInt(document.getElementById("content_1").style.top);
}

// Reads mouse X and Y coordinates
function getMouse(e){
	if(ie4){
				mouseY_1 = event.clientY + document.documentElement.scrollTop; // en XHTML se pone 'documentElement' en vez de 'body'
		mouseX_1 = event.clientX + document.documentElement.scrollLeft;
				mouseY_2 = event.clientY + document.documentElement.scrollTop; // en XHTML se pone 'documentElement' en vez de 'body'
		mouseX_2 = event.clientX + document.documentElement.scrollLeft;
				mouseY_3 = event.clientY + document.documentElement.scrollTop; // en XHTML se pone 'documentElement' en vez de 'body'
		mouseX_3 = event.clientX + document.documentElement.scrollLeft;
			}
	else if(nn4 || dom){
				mouseY_1 = e.pageY;
		mouseX_1 = e.pageX;
				mouseY_2 = e.pageY;
		mouseX_2 = e.pageX;
				mouseY_3 = e.pageY;
		mouseX_3 = e.pageX;
			}
}

// Moves the layer
function moveTo_1(){
	if(ie4){
		document.all.content_1.style.top = contentT_1;
		document.all.ruler_1.style.top = dragT_1;
		document.all.drag_1.style.top = dragT_1;
	}
	else if(nn4){
		document.contentClip_1.document.content_1.top = contentT_1;
		document.ruler_1.top = dragT_1;
		document.drag_1.top = dragT_1;
	}
	else if(dom){
		document.getElementById("content_1").style.top = contentT_1 + "px";
		document.getElementById("drag_1").style.top = dragT_1 + "px";
		document.getElementById("ruler_1").style.top = dragT_1 + "px";
	}
}


// Scrolls up
function scrollUp_1(){
	getT_1();
	
	if(clickAbove_1){
		if(dragT_1 <= (mouseY_1-(dragH_1/2)))
			return up_1();
	}
	
	if(clickUp_1){
		if(contentT_1 < 0){		
			dragT_1 = dragT_1 - (speed*scrollLength_1);
			
			if(dragT_1 < (rulerT_1))
				dragT_1 = rulerT_1;
				
			contentT_1 = contentT_1 + speed;
			if(contentT_1 > 0)
				contentT_1 = 0;
			
			moveTo_1();
			timer = setTimeout("scrollUp_1()",25);
		}
	}
	return false;
}

// Scrolls down
function scrollDown_1(){
	getT_1();
	

	if(clickBelow_1){
		if(dragT_1 >= (mouseY_1-(dragH_1/2)))
			return up_1();
	}

	if(clickDown_1){
		if(contentT_1 > -(contentH_1 - contentClipH_1)){			
			dragT_1 = dragT_1 + (speed*scrollLength_1);
			if(dragT_1 > (rulerT_1 + scrollH_1 - dragH_1))
				dragT_1 = (rulerT_1 + scrollH_1 - dragH_1);
			
			contentT_1 = contentT_1 - speed;
			if(contentT_1 < -(contentH_1 - contentClipH_1))
				contentT_1 = -(contentH_1 - contentClipH_1);
			
			moveTo_1();
			timer = setTimeout("scrollDown_1()",25);
		}
	}
	return false;
}



// Preload
function eventLoader_1(){
	if(ie4){
		// Up-arrow X and Y variables
		upL_1 = document.all.up_1.style.pixelLeft;
		upT_1 = document.all.up_1.style.pixelTop;		
		// Down-arrow X and Y variables
		downL_1 = document.all.down_1.style.pixelLeft;
		downT_1 = document.all.down_1.style.pixelTop;
		// Scrollbar X and Y variables
		dragL_1 = document.all.drag_1.style.pixelLeft;
		dragT_1 = document.all.drag_1.style.pixelTop;	
		// Ruler Y variable
		rulerT_1 = document.all.ruler_1.style.pixelTop;		
		// Height of content layer and clip layer
		contentH_1 = parseInt(document.all.content_1.scrollHeight);
		contentClipH_1 = parseInt(document.all.contentClip_1.style.height);
	}
	else if(nn4){
		// Up-arrow X and Y variables
		upL_1 = document.up_1.left;
		upT_1 = document.up_1.top;		
		// Down-arrow X and Y variables
		downL_1 = document.down_1.left;
		downT_1 = document.down_1.top;		
		// Scrollbar X and Y variables
		dragL_1 = document.drag_1.left;
		dragT_1 = document.drag_1.top;
		// Ruler Y variable
		rulerT_1 = document.ruler_1.top;
		// Height of content layer and clip layer
		contentH_1 = document.contentClip_1.document.content_1.clip.bottom;
		contentClipH_1 = document.contentClip_1.clip.bottom;
	}
	else if(dom){
		// Up-arrow X and Y variables
		upL_1 = parseInt(document.getElementById("up_1").style.left);
		upT_1 = parseInt(document.getElementById("up_1").style.top);
		// Down-arrow X and Y variables
		downL_1 = parseInt(document.getElementById("down_1").style.left);
		downT_1 = parseInt(document.getElementById("down_1").style.top);
		// Scrollbar X and Y variables
		dragL_1 = parseInt(document.getElementById("drag_1").style.left);
		dragT_1 = parseInt(document.getElementById("drag_1").style.top);
		// Ruler Y variable
		rulerT_1 = parseInt(document.getElementById("ruler_1").style.top);
		// Height of content layer and clip layer
		contentH_1 = parseInt(document.getElementById("content_1").offsetHeight);
		contentClipH_1 = parseInt(document.getElementById("contentClip_1").offsetHeight);
		document.getElementById("content_1").style.top = 0 + "px";
		
	}
	// Number of pixels scrollbar should move
	scrollLength_1 = ((scrollH_1-dragH_1)/(contentH_1-contentClipH_1));

	// Initializes event capturing
		if(nn4){
		document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
		window.onresize = reloadPage;
	}
	document.onmousedown = down;
	document.onmousemove = move;
	document.onmouseup = up;
	}

function ajustarCombo_1(){
	if(ie4)
		{
		ycontentT_1 = document.getElementById("bloquepadreficha").offsetTop+document.getElementById("bloquecentralfichaprods").offsetTop+document.getElementById("columnacaracteristicas").offsetTop+document.getElementById("ch1").offsetTop;
		if ((3*document.getElementById("ch1").offsetHeight/3/4) > 14)
			ycontentT_1+=parseInt(3*document.getElementById("ch1").offsetHeight/3/4) ;
		//xcontentT = document.getElementById("bloquepadreficha").offsetLeft+document.getElementById("bloquecentralfichaprods").offsetLeft+document.getElementById("columnacaracteristicas").offsetLeft+document.getElementById("ch1").offsetLeft;
		
		//alert (3*document.getElementById("ch1").offsetHeight/3);		
		
		
		xcontentT_1 = document.all.ch1.offsetLeft;
			switch (screen.width)
			{
				case 1024:
				xcontentT_1+=320+95 + x_scroll_Vertical;
				break;
				case 800:
				xcontentT_1+=320+95-60 + x_scroll_Vertical;
				break;
				default:
				xcontentT_1+=Math.ceil(screen.width / 2.4) + x_scroll_Vertical;
				break;
			}		
		}
	else if(nn4)
		{
		ycontentT_1 = document.ch1.offsetTop;
		xcontentT_1 = document.ch1.offsetLeft;
		}
	else if(dom)
		{
		ycontentT_1 = parseInt(document.getElementById("ch1").offsetTop);
		if ( (3*document.getElementById("ch1").offsetHeight/3/4) > 14 ) 
			ycontentT_1+= parseInt(3*document.getElementById("ch1").offsetHeight/3/4);
		xcontentT_1 = parseInt(document.getElementById("ch1").offsetLeft)-360;		
		}
		
		
			

	document.getElementById("up_1").style.top=ycontentT_1+121 + "px";
	document.getElementById("up_1").style.left=xcontentT_1+186+300 + "px";
	document.getElementById("down_1").style.top=ycontentT_1+48 + "px";
	document.getElementById("down_1").style.left=xcontentT_1+186+300 + "px";
	document.getElementById("drag_1").style.top=ycontentT_1+66 + "px";
	document.getElementById("drag_1").style.left=xcontentT_1+186+300 + "px";
	document.getElementById("ruler_1").style.top=ycontentT_1+65 + "px";
	document.getElementById("ruler_1").style.left=xcontentT_1+171+300 + "px";
	document.getElementById("fondoScroll_1").style.top=ycontentT_1+32 + "px";
	document.getElementById("fondoScroll_1").style.left=xcontentT_1+185+300 + "px";
	
	document.getElementById("trans1_1").style.top=ycontentT_1+45 + "px";
	document.getElementById("trans1_1").style.left=xcontentT_1+7+300 + "px";
	
	document.getElementById("contentClip_1").style.top=ycontentT_1+48 + "px";
	document.getElementById("contentClip_1").style.left=xcontentT_1+38+323 + "px";
	
	document.getElementById("selPais0_1").style.top=ycontentT_1+25 + "px";
	document.getElementById("selPais0_1").style.left=xcontentT_1+38+323 + "px";
	
	document.getElementById("selPais1_1").style.top=ycontentT_1+25 + "px";
	document.getElementById("selPais1_1").style.left=xcontentT_1+186+300 + "px";	
	
		
	estadoScroll_1="hide";
	MM_showHideLayers('contentClip_1','',estadoScroll_1,'trans1_1','',estadoScroll_1,'up_1','',estadoScroll_1,'down_1','',estadoScroll_1,'drag_1','',estadoScroll_1,'ruler_1','',estadoScroll_1,'fondoScroll_1','',estadoScroll_1)

}

function estadoS_1()
{

	if(ie4) {
		visib_1 = document.all.contentClip_1.style.visibility;
		}
	else if(nn4)
		visib1 = document.contentClip_1.document.content_1.visibility;
	else if(dom)
		visib_1 = parseInt(document.getElementById("contentClip_1").style.visibility);
		
	if(visib_1!='visible'){estadoScroll_1='show'} else {estadoScroll_1='hide';}
	//if(estadoScroll_1=='hide'){estadoScroll_1='show'} else {estadoScroll_1='hide';}
	
		
	for (var buc = 1; buc < (3+1); buc++) 
	{
		if (buc != 1) 
		{
			eval ("estadoScroll_"+buc+"='hide';");
			eval ("MM_showHideLayers('up_"+buc+"','','hide','ruler_"+buc+"','','hide','down_"+buc+"','','hide','drag_"+buc+"','','hide','contentClip_"+buc+"','','hide','trans1_"+buc+"','','hide','fondoScroll_"+buc+"','','hide');");	 
		}
	}
	
	if (estadoScroll_1=='show') if (document.getElementById("content_1").scrollHeight < 195)
	{MM_showHideLayers('up_1','','hide','ruler_1','','hide','down_1','','hide','drag_1','','hide');}

}



var estadoScroll_2 = 'hide';

var upH_2 = 20; // Height of up-arrow
var upW_2 = 24; // Width of up-arrow
var downH_2 = 20; // Height of down-arrow
var downW_2 = 24; // Width of down-arrow
var dragH_2 = 26; // Height of scrollbar
var dragW_2 = 25; // Width of scrollbar
var scrollH_2 = 78; // Height of scrollbar


var mouseY_2; // Mouse Y position onclick
var mouseX_2; // Mouse X position onclick

var clickUp_2 = false; // If click on up-arrow
var clickDown_2 = false; // If click on down-arrow
var clickDrag_2 = false; // If click on scrollbar
var clickAbove_2 = false; // If click above scrollbar
var clickBelow_2 = false; // If click below scrollbar

var upL_2; // Up-arrow X
var upT_2; // Up-arrow Y
var downL_2; // Down-arrow X
var downT_2; // Down-arrow Y
var dragL_2; // Scrollbar X
var dragT_2; // Scrollbar Y
var rulerL_2; // Ruler X
var rulerT_2; // Ruler Y
var contentT_2; // Content layer Y;
var contentH_2; // Content height
var contentClipH_2; // Content clip height
var scrollLength_2; // Number of pixels scrollbar should move
var startY_2; // Keeps track of offset between mouse and span

// Mousedown



// Reads content layer top
function getT_2(){
	if(ie4)
		contentT_2 = document.all.content_2.style.pixelTop;
	else if(nn4)
		contentT_2 = document.contentClip_2.document.content_2.top;
	else if(dom)
		contentT_2 = parseInt(document.getElementById("content_2").style.top);
}


// Moves the layer
function moveTo_2(){
	if(ie4){
		document.all.content_2.style.top = contentT_2;
		document.all.ruler_2.style.top = dragT_2;
		document.all.drag_2.style.top = dragT_2;
	}
	else if(nn4){
		document.contentClip_2.document.content_2.top = contentT_2;
		document.ruler_2.top = dragT_2;
		document.drag_2.top = dragT_2;
	}
	else if(dom){
		document.getElementById("content_2").style.top = contentT_2 + "px";
		document.getElementById("drag_2").style.top = dragT_2 + "px";
		document.getElementById("ruler_2").style.top = dragT_2 + "px";
	}
}


// Scrolls up
function scrollUp_2(){
	getT_2();
	
	if(clickAbove_2){
		if(dragT_2 <= (mouseY_2-(dragH_2/2)))
			return up_2();
	}
	
	if(clickUp_2){
		if(contentT_2 < 0){		
			dragT_2 = dragT_2 - (speed*scrollLength_2);
			
			if(dragT_2 < (rulerT_2))
				dragT_2 = rulerT_2;
				
			contentT_2 = contentT_2 + speed;
			if(contentT_2 > 0)
				contentT_2 = 0;
			
			moveTo_2();
			timer = setTimeout("scrollUp_2()",25);
		}
	}
	return false;
}

// Scrolls down
function scrollDown_2(){
	getT_2();
	

	if(clickBelow_2){
		if(dragT_2 >= (mouseY_2-(dragH_2/2)))
			return up_2();
	}

	if(clickDown_2){
		if(contentT_2 > -(contentH_2 - contentClipH_2)){			
			dragT_2 = dragT_2 + (speed*scrollLength_2);
			if(dragT_2 > (rulerT_2 + scrollH_2 - dragH_2))
				dragT_2 = (rulerT_2 + scrollH_2 - dragH_2);
			
			contentT_2 = contentT_2 - speed;
			if(contentT_2 < -(contentH_2 - contentClipH_2))
				contentT_2 = -(contentH_2 - contentClipH_2);
			
			moveTo_2();
			timer = setTimeout("scrollDown_2()",25);
		}
	}
	return false;
}



// Preload
function eventLoader_2(){
	if(ie4){
		// Up-arrow X and Y variables
		upL_2 = document.all.up_2.style.pixelLeft;
		upT_2 = document.all.up_2.style.pixelTop;		
		// Down-arrow X and Y variables
		downL_2 = document.all.down_2.style.pixelLeft;
		downT_2 = document.all.down_2.style.pixelTop;
		// Scrollbar X and Y variables
		dragL_2 = document.all.drag_2.style.pixelLeft;
		dragT_2 = document.all.drag_2.style.pixelTop;	
		// Ruler Y variable
		rulerT_2 = document.all.ruler_2.style.pixelTop;		
		// Height of content layer and clip layer
		contentH_2 = parseInt(document.all.content_2.scrollHeight);
		contentClipH_2 = parseInt(document.all.contentClip_2.style.height);
	}
	else if(nn4){
		// Up-arrow X and Y variables
		upL_2 = document.up_2.left;
		upT_2 = document.up_2.top;		
		// Down-arrow X and Y variables
		downL_2 = document.down_2.left;
		downT_2 = document.down_2.top;		
		// Scrollbar X and Y variables
		dragL_2 = document.drag_2.left;
		dragT_2 = document.drag_2.top;
		// Ruler Y variable
		rulerT_2 = document.ruler_2.top;
		// Height of content layer and clip layer
		contentH_2 = document.contentClip_2.document.content_2.clip.bottom;
		contentClipH_2 = document.contentClip_2.clip.bottom;
	}
	else if(dom){
		// Up-arrow X and Y variables
		upL_2 = parseInt(document.getElementById("up_2").style.left);
		upT_2 = parseInt(document.getElementById("up_2").style.top);
		// Down-arrow X and Y variables
		downL_2 = parseInt(document.getElementById("down_2").style.left);
		downT_2 = parseInt(document.getElementById("down_2").style.top);
		// Scrollbar X and Y variables
		dragL_2 = parseInt(document.getElementById("drag_2").style.left);
		dragT_2 = parseInt(document.getElementById("drag_2").style.top);
		// Ruler Y variable
		rulerT_2 = parseInt(document.getElementById("ruler_2").style.top);
		// Height of content layer and clip layer
		contentH_2 = parseInt(document.getElementById("content_2").offsetHeight);
		contentClipH_2 = parseInt(document.getElementById("contentClip_2").offsetHeight);
		document.getElementById("content_2").style.top = 0 + "px";
		
	}
	// Number of pixels scrollbar should move
	scrollLength_2 = ((scrollH_2-dragH_2)/(contentH_2-contentClipH_2));

	// Initializes event capturing
	}

function ajustarCombo_2(){
	if(ie4)
		{
		ycontentT_2 = document.getElementById("bloquepadreficha").offsetTop+document.getElementById("bloquecentralfichaprods").offsetTop+document.getElementById("columnacaracteristicas").offsetTop+document.getElementById("ch1").offsetTop;
		if ((3*document.getElementById("ch1").offsetHeight/3/4) > 14)
			ycontentT_2+=parseInt(3*document.getElementById("ch1").offsetHeight/3/4) ;
		//xcontentT = document.getElementById("bloquepadreficha").offsetLeft+document.getElementById("bloquecentralfichaprods").offsetLeft+document.getElementById("columnacaracteristicas").offsetLeft+document.getElementById("ch1").offsetLeft;
		
		//alert (3*document.getElementById("ch1").offsetHeight/3);		
		
		
		xcontentT_2 = document.all.ch1.offsetLeft;
			switch (screen.width)
			{
				case 1024:
				xcontentT_2+=320+95 + x_scroll_Vertical;
				break;
				case 800:
				xcontentT_2+=320+95-60 + x_scroll_Vertical;
				break;
				default:
				xcontentT_2+=Math.ceil(screen.width / 2.4) + x_scroll_Vertical;
				break;
			}		
		}
	else if(nn4)
		{
		ycontentT_2 = document.ch1.offsetTop;
		xcontentT_2 = document.ch1.offsetLeft;
		}
	else if(dom)
		{
		ycontentT_2 = parseInt(document.getElementById("ch1").offsetTop);
		if ( (3*document.getElementById("ch1").offsetHeight/3/4) > 14 ) 
			ycontentT_2+= parseInt(3*document.getElementById("ch1").offsetHeight/3/4);
		xcontentT_2 = parseInt(document.getElementById("ch1").offsetLeft)-360;		
		}
		
		
	 ycontentT_2+=52; 		

	document.getElementById("up_2").style.top=ycontentT_2+121 + "px";
	document.getElementById("up_2").style.left=xcontentT_2+186+300 + "px";
	document.getElementById("down_2").style.top=ycontentT_2+48 + "px";
	document.getElementById("down_2").style.left=xcontentT_2+186+300 + "px";
	document.getElementById("drag_2").style.top=ycontentT_2+66 + "px";
	document.getElementById("drag_2").style.left=xcontentT_2+186+300 + "px";
	document.getElementById("ruler_2").style.top=ycontentT_2+65 + "px";
	document.getElementById("ruler_2").style.left=xcontentT_2+171+300 + "px";
	document.getElementById("fondoScroll_2").style.top=ycontentT_2+32 + "px";
	document.getElementById("fondoScroll_2").style.left=xcontentT_2+185+300 + "px";
	
	document.getElementById("trans1_2").style.top=ycontentT_2+45 + "px";
	document.getElementById("trans1_2").style.left=xcontentT_2+7+300 + "px";
	
	document.getElementById("contentClip_2").style.top=ycontentT_2+48 + "px";
	document.getElementById("contentClip_2").style.left=xcontentT_2+38+323 + "px";
	
	document.getElementById("selPais0_2").style.top=ycontentT_2+25 + "px";
	document.getElementById("selPais0_2").style.left=xcontentT_2+38+323 + "px";
	
	document.getElementById("selPais1_2").style.top=ycontentT_2+25 + "px";
	document.getElementById("selPais1_2").style.left=xcontentT_2+186+300 + "px";	
	
		
	estadoScroll_2="hide";
	MM_showHideLayers('contentClip_2','',estadoScroll_2,'trans1_2','',estadoScroll_2,'up_2','',estadoScroll_2,'down_2','',estadoScroll_2,'drag_2','',estadoScroll_2,'ruler_2','',estadoScroll_2,'fondoScroll_2','',estadoScroll_2)

}

function estadoS_2()
{

	if(ie4) {
		visib_2 = document.all.contentClip_2.style.visibility;
		}
	else if(nn4)
		visib2 = document.contentClip_2.document.content_2.visibility;
	else if(dom)
		visib_2 = parseInt(document.getElementById("contentClip_2").style.visibility);
		
	if(visib_2!='visible'){estadoScroll_2='show'} else {estadoScroll_2='hide';}
	//if(estadoScroll_2=='hide'){estadoScroll_2='show'} else {estadoScroll_2='hide';}
	
		
	for (var buc = 1; buc < (3+1); buc++) 
	{
		if (buc != 2) 
		{
			eval ("estadoScroll_"+buc+"='hide';");
			eval ("MM_showHideLayers('up_"+buc+"','','hide','ruler_"+buc+"','','hide','down_"+buc+"','','hide','drag_"+buc+"','','hide','contentClip_"+buc+"','','hide','trans1_"+buc+"','','hide','fondoScroll_"+buc+"','','hide');");	 
		}
	}
	
	if (estadoScroll_2=='show') if (document.getElementById("content_2").scrollHeight < 195)
	{MM_showHideLayers('up_2','','hide','ruler_2','','hide','down_2','','hide','drag_2','','hide');}

}



var estadoScroll_3 = 'hide';

var upH_3 = 20; // Height of up-arrow
var upW_3 = 24; // Width of up-arrow
var downH_3 = 20; // Height of down-arrow
var downW_3 = 24; // Width of down-arrow
var dragH_3 = 26; // Height of scrollbar
var dragW_3 = 25; // Width of scrollbar
var scrollH_3 = 78; // Height of scrollbar


var mouseY_3; // Mouse Y position onclick
var mouseX_3; // Mouse X position onclick

var clickUp_3 = false; // If click on up-arrow
var clickDown_3 = false; // If click on down-arrow
var clickDrag_3 = false; // If click on scrollbar
var clickAbove_3 = false; // If click above scrollbar
var clickBelow_3 = false; // If click below scrollbar

var upL_3; // Up-arrow X
var upT_3; // Up-arrow Y
var downL_3; // Down-arrow X
var downT_3; // Down-arrow Y
var dragL_3; // Scrollbar X
var dragT_3; // Scrollbar Y
var rulerL_3; // Ruler X
var rulerT_3; // Ruler Y
var contentT_3; // Content layer Y;
var contentH_3; // Content height
var contentClipH_3; // Content clip height
var scrollLength_3; // Number of pixels scrollbar should move
var startY_3; // Keeps track of offset between mouse and span

// Mousedown



// Reads content layer top
function getT_3(){
	if(ie4)
		contentT_3 = document.all.content_3.style.pixelTop;
	else if(nn4)
		contentT_3 = document.contentClip_3.document.content_3.top;
	else if(dom)
		contentT_3 = parseInt(document.getElementById("content_3").style.top);
}


// Moves the layer
function moveTo_3(){
	if(ie4){
		document.all.content_3.style.top = contentT_3;
		document.all.ruler_3.style.top = dragT_3;
		document.all.drag_3.style.top = dragT_3;
	}
	else if(nn4){
		document.contentClip_3.document.content_3.top = contentT_3;
		document.ruler_3.top = dragT_3;
		document.drag_3.top = dragT_3;
	}
	else if(dom){
		document.getElementById("content_3").style.top = contentT_3 + "px";
		document.getElementById("drag_3").style.top = dragT_3 + "px";
		document.getElementById("ruler_3").style.top = dragT_3 + "px";
	}
}


// Scrolls up
function scrollUp_3(){
	getT_3();
	
	if(clickAbove_3){
		if(dragT_3 <= (mouseY_3-(dragH_3/2)))
			return up_3();
	}
	
	if(clickUp_3){
		if(contentT_3 < 0){		
			dragT_3 = dragT_3 - (speed*scrollLength_3);
			
			if(dragT_3 < (rulerT_3))
				dragT_3 = rulerT_3;
				
			contentT_3 = contentT_3 + speed;
			if(contentT_3 > 0)
				contentT_3 = 0;
			
			moveTo_3();
			timer = setTimeout("scrollUp_3()",25);
		}
	}
	return false;
}

// Scrolls down
function scrollDown_3(){
	getT_3();
	

	if(clickBelow_3){
		if(dragT_3 >= (mouseY_3-(dragH_3/2)))
			return up_3();
	}

	if(clickDown_3){
		if(contentT_3 > -(contentH_3 - contentClipH_3)){			
			dragT_3 = dragT_3 + (speed*scrollLength_3);
			if(dragT_3 > (rulerT_3 + scrollH_3 - dragH_3))
				dragT_3 = (rulerT_3 + scrollH_3 - dragH_3);
			
			contentT_3 = contentT_3 - speed;
			if(contentT_3 < -(contentH_3 - contentClipH_3))
				contentT_3 = -(contentH_3 - contentClipH_3);
			
			moveTo_3();
			timer = setTimeout("scrollDown_3()",25);
		}
	}
	return false;
}



// Preload
function eventLoader_3(){
	if(ie4){
		// Up-arrow X and Y variables
		upL_3 = document.all.up_3.style.pixelLeft;
		upT_3 = document.all.up_3.style.pixelTop;		
		// Down-arrow X and Y variables
		downL_3 = document.all.down_3.style.pixelLeft;
		downT_3 = document.all.down_3.style.pixelTop;
		// Scrollbar X and Y variables
		dragL_3 = document.all.drag_3.style.pixelLeft;
		dragT_3 = document.all.drag_3.style.pixelTop;	
		// Ruler Y variable
		rulerT_3 = document.all.ruler_3.style.pixelTop;		
		// Height of content layer and clip layer
		contentH_3 = parseInt(document.all.content_3.scrollHeight);
		contentClipH_3 = parseInt(document.all.contentClip_3.style.height);
	}
	else if(nn4){
		// Up-arrow X and Y variables
		upL_3 = document.up_3.left;
		upT_3 = document.up_3.top;		
		// Down-arrow X and Y variables
		downL_3 = document.down_3.left;
		downT_3 = document.down_3.top;		
		// Scrollbar X and Y variables
		dragL_3 = document.drag_3.left;
		dragT_3 = document.drag_3.top;
		// Ruler Y variable
		rulerT_3 = document.ruler_3.top;
		// Height of content layer and clip layer
		contentH_3 = document.contentClip_3.document.content_3.clip.bottom;
		contentClipH_3 = document.contentClip_3.clip.bottom;
	}
	else if(dom){
		// Up-arrow X and Y variables
		upL_3 = parseInt(document.getElementById("up_3").style.left);
		upT_3 = parseInt(document.getElementById("up_3").style.top);
		// Down-arrow X and Y variables
		downL_3 = parseInt(document.getElementById("down_3").style.left);
		downT_3 = parseInt(document.getElementById("down_3").style.top);
		// Scrollbar X and Y variables
		dragL_3 = parseInt(document.getElementById("drag_3").style.left);
		dragT_3 = parseInt(document.getElementById("drag_3").style.top);
		// Ruler Y variable
		rulerT_3 = parseInt(document.getElementById("ruler_3").style.top);
		// Height of content layer and clip layer
		contentH_3 = parseInt(document.getElementById("content_3").offsetHeight);
		contentClipH_3 = parseInt(document.getElementById("contentClip_3").offsetHeight);
		document.getElementById("content_3").style.top = 0 + "px";
		
	}
	// Number of pixels scrollbar should move
	scrollLength_3 = ((scrollH_3-dragH_3)/(contentH_3-contentClipH_3));

	// Initializes event capturing
	}

function ajustarCombo_3(){
	if(ie4)
		{
		ycontentT_3 = document.getElementById("bloquepadreficha").offsetTop+document.getElementById("bloquecentralfichaprods").offsetTop+document.getElementById("columnacaracteristicas").offsetTop+document.getElementById("ch1").offsetTop;
		if ((3*document.getElementById("ch1").offsetHeight/3/4) > 14)
			ycontentT_3+=parseInt(3*document.getElementById("ch1").offsetHeight/3/4) ;
		//xcontentT = document.getElementById("bloquepadreficha").offsetLeft+document.getElementById("bloquecentralfichaprods").offsetLeft+document.getElementById("columnacaracteristicas").offsetLeft+document.getElementById("ch1").offsetLeft;
		
		//alert (3*document.getElementById("ch1").offsetHeight/3);		
		
		
		xcontentT_3 = document.all.ch1.offsetLeft;
			switch (screen.width)
			{
				case 1024:
				xcontentT_3+=320+95 + x_scroll_Vertical;
				break;
				case 800:
				xcontentT_3+=320+95-60 + x_scroll_Vertical;
				break;
				default:
				xcontentT_3+=Math.ceil(screen.width / 2.4) + x_scroll_Vertical;
				break;
			}		
		}
	else if(nn4)
		{
		ycontentT_3 = document.ch1.offsetTop;
		xcontentT_3 = document.ch1.offsetLeft;
		}
	else if(dom)
		{
		ycontentT_3 = parseInt(document.getElementById("ch1").offsetTop);
		if ( (3*document.getElementById("ch1").offsetHeight/3/4) > 14 ) 
			ycontentT_3+= parseInt(3*document.getElementById("ch1").offsetHeight/3/4);
		xcontentT_3 = parseInt(document.getElementById("ch1").offsetLeft)-360;		
		}
		
		
	 ycontentT_3+=115; 		

	document.getElementById("up_3").style.top=ycontentT_3+121 + "px";
	document.getElementById("up_3").style.left=xcontentT_3+186+300 + "px";
	document.getElementById("down_3").style.top=ycontentT_3+48 + "px";
	document.getElementById("down_3").style.left=xcontentT_3+186+300 + "px";
	document.getElementById("drag_3").style.top=ycontentT_3+66 + "px";
	document.getElementById("drag_3").style.left=xcontentT_3+186+300 + "px";
	document.getElementById("ruler_3").style.top=ycontentT_3+65 + "px";
	document.getElementById("ruler_3").style.left=xcontentT_3+171+300 + "px";
	document.getElementById("fondoScroll_3").style.top=ycontentT_3+32 + "px";
	document.getElementById("fondoScroll_3").style.left=xcontentT_3+185+300 + "px";
	
	document.getElementById("trans1_3").style.top=ycontentT_3+45 + "px";
	document.getElementById("trans1_3").style.left=xcontentT_3+7+300 + "px";
	
	document.getElementById("contentClip_3").style.top=ycontentT_3+48 + "px";
	document.getElementById("contentClip_3").style.left=xcontentT_3+38+323 + "px";
	
	document.getElementById("selPais0_3").style.top=ycontentT_3+25 + "px";
	document.getElementById("selPais0_3").style.left=xcontentT_3+38+323 + "px";
	
	document.getElementById("selPais1_3").style.top=ycontentT_3+25 + "px";
	document.getElementById("selPais1_3").style.left=xcontentT_3+186+300 + "px";	
	
		
	estadoScroll_3="hide";
	MM_showHideLayers('contentClip_3','',estadoScroll_3,'trans1_3','',estadoScroll_3,'up_3','',estadoScroll_3,'down_3','',estadoScroll_3,'drag_3','',estadoScroll_3,'ruler_3','',estadoScroll_3,'fondoScroll_3','',estadoScroll_3)

}

function estadoS_3()
{

	if(ie4) {
		visib_3 = document.all.contentClip_3.style.visibility;
		}
	else if(nn4)
		visib3 = document.contentClip_3.document.content_3.visibility;
	else if(dom)
		visib_3 = parseInt(document.getElementById("contentClip_3").style.visibility);
		
	if(visib_3!='visible'){estadoScroll_3='show'} else {estadoScroll_3='hide';}
	//if(estadoScroll_3=='hide'){estadoScroll_3='show'} else {estadoScroll_3='hide';}
	
		
	for (var buc = 1; buc < (3+1); buc++) 
	{
		if (buc != 3) 
		{
			eval ("estadoScroll_"+buc+"='hide';");
			eval ("MM_showHideLayers('up_"+buc+"','','hide','ruler_"+buc+"','','hide','down_"+buc+"','','hide','drag_"+buc+"','','hide','contentClip_"+buc+"','','hide','trans1_"+buc+"','','hide','fondoScroll_"+buc+"','','hide');");	 
		}
	}
	
	if (estadoScroll_3=='show') if (document.getElementById("content_3").scrollHeight < 195)
	{MM_showHideLayers('up_3','','hide','ruler_3','','hide','down_3','','hide','drag_3','','hide');}

}



// reloads page to position the layers again
function reloadPage(){
	location.reload();
}

function eventLoader(){eventLoader_1();eventLoader_2();eventLoader_3();}
function ajustarCombo(){ajustarCombo_1();ajustarCombo_2();ajustarCombo_3();}

function cambioTamanoV()
{ajustarCombo();eventLoader();}

window.onresize=cambioTamanoV;