function validar()
{
	var f=document.form;
	errores='';
	var r=true;
	r=MM_validateForm('nombre','','R','apellidos','','R','email','','RisEmail','actividad','','R','Comentarios','','R') && r;
	if (r && f.telefono.value!="") r=validaTelefono(f.telefono.value);
	return r
}



// 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 :-)
var estadoScroll = 'hide';

var upH = 14; // Height of up-arrow
var upW = 12; // Width of up-arrow
var downH = 14; // Height of down-arrow
var downW = 12; // Width of down-arrow
var dragH = 60; // Height of scrollbar
var dragW = 12; // Width of scrollbar
var scrollH = 226; // Height of scrollbar

var upH_2 = 14; // Height of up-arrow
var upW_2 = 12; // Width of up-arrow
var downH_2 = 14; // Height of down-arrow
var downW_2 = 12; // Width of down-arrow
var dragH_2 = 60; // Height of scrollbar
var dragW_2 = 12; // Width of scrollbar
var scrollH_2 = 226; // Height of scrollbar

var speed = 6; // Scroll speed

// 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 mouseY; // Mouse Y position onclick
var mouseX; // Mouse X position onclick

var mouseY_2; // Mouse Y position onclick
var mouseX_2; // Mouse X position onclick

var clickUp = false; // If click on up-arrow
var clickDown = false; // If click on down-arrow
var clickDrag = false; // If click on scrollbar
var clickAbove = false; // If click above scrollbar
var clickBelow = false; // If click below scrollbar

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 timer = setTimeout("",500); // Repeat variable
var upL; // Up-arrow X
var upT; // Up-arrow Y
var downL; // Down-arrow X
var downT; // Down-arrow Y
var dragL; // Scrollbar X
var dragT; // Scrollbar Y
var rulerL; // Ruler X
var rulerT; // Ruler Y
var contentT; // Content layer Y;
var contentH; // Content height
var contentClipH; // Content clip height
var scrollLength; // Number of pixels scrollbar should move
var startY; // Keeps track of offset between mouse and span

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
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 = (mouseY - dragT);
	startY_2 = (mouseY_2 - dragT_2);
	
	// If click on up-arrow, inferior
	if(mouseX >= upL && (mouseX <= (upL + upW)) && mouseY >= upT && (mouseY <= (upT + upH))){
		clickUp = true; activa_down=true;
		return scrollUp();
	}	
	// Else if click on down-arrow, inferior
	else if(mouseX >= downL && (mouseX <= (downL + downW)) && mouseY >= downT && (mouseY <= (downT + downH))){
		clickDown = true; activa_down=true;
		return scrollDown();
	}
	// Else if click on scrollbar, inferior
	else if(mouseX >= dragL && (mouseX <= (dragL + dragW)) && mouseY >= dragT && (mouseY <= (dragT + dragH))){
		clickDrag = true; activa_down=true;
		return false;
	}
	else if(mouseX >= dragL && (mouseX <= (dragL + dragW)) && mouseY >= rulerT && (mouseY <= (rulerT + scrollH))){
		// If click above drag
		if(mouseY < dragT){
			clickAbove = true;
			clickUp = true;
			activa_down=true;
			return scrollUp();
		}
		// Else click below drag
		else{
			clickBelow = true;
			clickDown = true;
			activa_down=true;
			return scrollDown();
		}
	}
		// If click on up-arrow, inferior
	if (estadoScroll=='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=='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=='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=='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 no scrolling is to take place
	/*else{
		return true;
	}*/
}

// Drag function
function move(e){
	if(clickDrag && contentH > contentClipH){
		getMouse(e);
		dragT = (mouseY - startY);
		
		if(dragT < (rulerT))
			dragT = rulerT;		
		if(dragT > (rulerT + scrollH - dragH))
			dragT = (rulerT + scrollH - dragH);
		
		contentT = ((dragT - rulerT)*(1/scrollLength));
		contentT = eval('-' + contentT);

		moveTo();
		
		
	}
	
	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();	
			
	}
	
	// So ie-pc doesn't select gifs
		if(ie4)
			return false;
}

function up(){
	clearTimeout(timer);
	// Resetting variables
	clickUp = false; 
	clickDown = false; 
	clickDrag = false; 
	clickAbove = false; 
	clickBelow = false; 
	clickUp_2 = false; 
	clickDown_2 = false; 
	clickDrag_2 = false; 
	clickAbove_2 = false; 
	clickBelow_2 = false; 	
	return true;
}



// Reads content layer top
function getT(){
	if(ie4)
		contentT = document.all.content.style.pixelTop;
	else if(nn4)
		contentT = document.contentClip.document.content.top;
	else if(dom)
		contentT = parseInt(document.getElementById("content").style.top);
}

// 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);
}


// Reads mouse X and Y coordinates
function getMouse(e){
	if(ie4){
		mouseY = event.clientY + document.documentElement.scrollTop; // en XHTML se pone 'documentElement' en vez de 'body';
		mouseX = 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;		
	}
	else if(nn4 || dom){
		mouseY = e.pageY;
		mouseX = e.pageX;
		mouseY_2 = e.pageY;
		mouseX_2 = e.pageX;
	}
}

// Moves the layer
function moveTo(){
	if(ie4){
		document.all.content.style.top = contentT;
		document.all.ruler.style.top = dragT;
		document.all.drag.style.top = dragT;
	}
	else if(nn4){
		document.contentClip.document.content.top = contentT;
		document.ruler.top = dragT;
		document.drag.top = dragT;
	}
	else if(dom){
		document.getElementById("content").style.top = contentT + "px";
		document.getElementById("drag").style.top = dragT + "px";
		document.getElementById("ruler").style.top = dragT + "px";
	}
}

// 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(){
	getT();
	
	if(clickAbove){
		if(dragT <= (mouseY-(dragH/2)))
			return up();
	}
	
	if(clickUp){
		if(contentT < 0){		
			dragT = dragT - (speed*scrollLength);
			
			if(dragT < (rulerT))
				dragT = rulerT;
				
			contentT = contentT + speed;
			if(contentT > 0)
				contentT = 0;
			
			moveTo();
			timer = setTimeout("scrollUp()",25);
		}
	}
	return false;
}

// 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(){
	getT();
	
	if(clickBelow){
		if(dragT >= (mouseY-(dragH/2)))
			return up();
	}

	if(clickDown){
		if(contentT > -(contentH - contentClipH)){			
			dragT = dragT + (speed*scrollLength);
			if(dragT > (rulerT + scrollH - dragH))
				dragT = (rulerT + scrollH - dragH);
			
			contentT = contentT - speed;
			if(contentT < -(contentH - contentClipH))
				contentT = -(contentH - contentClipH);
			
			moveTo();
			timer = setTimeout("scrollDown()",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;
}



// reloads page to position the layers again
function reloadPage(){
	location.reload();
}

// Preload
function eventLoader(){
	if(ie4){
		// Up-arrow X and Y variables
		upL = document.all.up.style.pixelLeft;
		upT = document.all.up.style.pixelTop;		
		// Down-arrow X and Y variables
		downL = document.all.down.style.pixelLeft;
		downT = document.all.down.style.pixelTop;
		// Scrollbar X and Y variables
		dragL = document.all.drag.style.pixelLeft;
		dragT = document.all.drag.style.pixelTop;	
		// Ruler Y variable
		rulerT = document.all.ruler.style.pixelTop;		
		// Height of content layer and clip layer
		contentH = parseInt(document.all.content.scrollHeight);
		contentClipH = parseInt(document.all.contentClip.style.height);
	}
	else if(nn4){
		// Up-arrow X and Y variables
		upL = document.up.left;
		upT = document.up.top;		
		// Down-arrow X and Y variables
		downL = document.down.left;
		downT = document.down.top;		
		// Scrollbar X and Y variables
		dragL = document.drag.left;
		dragT = document.drag.top;
		// Ruler Y variable
		rulerT = document.ruler.top;
		// Height of content layer and clip layer
		contentH = document.contentClip.document.content.clip.bottom;
		contentClipH = document.contentClip.clip.bottom;
	}
	else if(dom){
		// Up-arrow X and Y variables
		upL = parseInt(document.getElementById("up").style.left);
		upT = parseInt(document.getElementById("up").style.top);
		// Down-arrow X and Y variables
		downL = parseInt(document.getElementById("down").style.left);
		downT = parseInt(document.getElementById("down").style.top);
		// Scrollbar X and Y variables
		dragL = parseInt(document.getElementById("drag").style.left);
		dragT = parseInt(document.getElementById("drag").style.top);
		// Ruler Y variable
		rulerT = parseInt(document.getElementById("ruler").style.top);
		// Height of content layer and clip layer
		contentH = parseInt(document.getElementById("content").offsetHeight);
		contentClipH = parseInt(document.getElementById("contentClip").offsetHeight);
		document.getElementById("content").style.top = 0 + "px";
		
	}
	// Number of pixels scrollbar should move
	scrollLength = ((scrollH-dragH)/(contentH-contentClipH));

	// 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;
}

// 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(){

	if(ie4)
		{
		ycontentT = document.all.ch1.offsetTop;	
			switch (screen.height)
			{
				case 768:
				ycontentT-=100;
				break;
				case 600:
				ycontentT+=100;
				break;
				default:
				ycontentT-=100;
				break;
			}
		
		xcontentT = document.all.ch1.offsetLeft;
			switch (screen.width)
			{
				case 1024:
				xcontentT+=785;
				break;
				case 800:
				xcontentT+=208;
				break;
				case 1152:
				xcontentT+=790;
				break;			
				case 1280:
				xcontentT+=910;
				break;			
				default:
				xcontentT+=Math.ceil(screen.width / 1.51);
				break;
			}		
		}
	else if(nn4)
		{
		ycontentT = document.ch1.offsetTop;
		xcontentT = document.ch1.offsetLeft;
		}
	else if(dom)
		{
		ycontentT = parseInt(document.getElementById("ch1").offsetTop)-213;
		xcontentT = parseInt(document.getElementById("ch1").offsetLeft)-Math.ceil(screen.width/100)+400+((screen.width-1024)/2);		
		}
		
	
	
		
	var controlY = 103;
	var controlY_t = 123;
	var controlX = -185;
	var controlX_t = -493;
	var controlX_clip = -485;
	
	
	if (navigator.appName.toString().indexOf('Microsoft') == -1) 
	{
		controlY += 102;
		controlX_clip += 396;
		controlY_t += 99;
		controlX_t += 390;
		controlX += 396;
	}
	
	controlX+=156;
	controlX_t+=156;
	controlX_clip+=156;
	document.getElementById("up").style.top=ycontentT+358+controlY + "px";
	document.getElementById("up").style.left=xcontentT+controlX + "px";
	document.getElementById("down").style.top=ycontentT+596+controlY + "px";
	document.getElementById("down").style.left=xcontentT+controlX + "px";
	
	document.getElementById("drag").style.top=ycontentT+372+controlY + "px";
	document.getElementById("drag").style.left=xcontentT+controlX + "px";
	
	document.getElementById("ruler").style.top=ycontentT+372+controlY + "px";
	document.getElementById("ruler").style.left=xcontentT+controlX + "px";
	
	document.getElementById("fondoScroll").style.top=ycontentT+372+controlY + "px";
	document.getElementById("fondoScroll").style.left=xcontentT+controlX + "px";
	
	document.getElementById("contentClip").style.top=ycontentT+358+controlY + "px";
	document.getElementById("contentClip").style.left=xcontentT+controlX_clip + "px";
	
	document.getElementById("titulares_hidden").style.top=ycontentT+324+controlY_t + "px";
	document.getElementById("titulares_hidden").style.left=xcontentT+controlX_t + "px";
	
	document.getElementById("cerrar_hidden").style.top=ycontentT+596+controlY_t + "px";
	/*document.getElementById("cerrar_hidden").style.left=xcontentT+587+controlX_t + "px";*/
	document.getElementById("cerrar_hidden").style.left=xcontentT+587+controlX_t-156 + "px";
	
	/*controlX+=312;
	controlX_t+=312;
	controlX_clip+=312;*/
	controlX+=-2000;
	controlX_t+=2000;
	controlX_clip+=2000;
	
	document.getElementById("up_2").style.top=ycontentT+358+controlY + "px";
	document.getElementById("up_2").style.left=xcontentT+controlX + "px";
	document.getElementById("down_2").style.top=ycontentT+596+controlY + "px";
	document.getElementById("down_2").style.left=xcontentT+controlX + "px";
	
	document.getElementById("drag_2").style.top=ycontentT+372+controlY + "px";
	document.getElementById("drag_2").style.left=xcontentT+controlX + "px";
	
	document.getElementById("ruler_2").style.top=ycontentT+372+controlY + "px";
	document.getElementById("ruler_2").style.left=xcontentT+controlX + "px";
	
	document.getElementById("fondoScroll_2").style.top=ycontentT+372+controlY + "px";
	document.getElementById("fondoScroll_2").style.left=xcontentT+controlX + "px";
	
	document.getElementById("contentClip_2").style.top=ycontentT+358+controlY + "px";
	document.getElementById("contentClip_2").style.left=xcontentT+controlX_clip + "px";
	
	
	estadoScroll="hide";
	MM_showHideLayers('contentClip','',estadoScroll,'up','',estadoScroll,'down','',estadoScroll,'drag','',estadoScroll,'ruler','',estadoScroll,'fondoScroll','',estadoScroll,'titulares_hidden','',estadoScroll,'cerrar_hidden','',estadoScroll)
	MM_showHideLayers('contentClip_2','',estadoScroll,'up_2','',estadoScroll,'down_2','',estadoScroll,'drag_2','',estadoScroll,'ruler_2','',estadoScroll,'fondoScroll_2','',estadoScroll)

}

function estadoS()
{
	if (estadoScroll=="show") estadoScroll="hide"; else estadoScroll="show";
	MM_showHideLayers('contentClip','',estadoScroll,'up','',estadoScroll,'down','',estadoScroll,'drag','',estadoScroll,'ruler','',estadoScroll,'fondoScroll','',estadoScroll,'titulares_hidden','',estadoScroll,'cerrar_hidden','',estadoScroll);
	MM_showHideLayers('contentClip_2','',estadoScroll,'up_2','',estadoScroll,'down_2','',estadoScroll,'drag_2','',estadoScroll,'ruler_2','',estadoScroll,'fondoScroll_2','',estadoScroll)
}

function eventLoader__(){eventLoader();eventLoader_2();}

window.onresize=ajustarCombo;