function smyles(tag) {
	var myField;
	if (document.getElementById('texto') && document.getElementById('texto').type == 'textarea') {
		myField = document.getElementById('texto');
		}	
	else
		return false;
	if (document.selection) {
		//Ejecuto en IE
		myField.focus();
		sel = document.selection.createRange();
		//Agrego el smyle al valor del text area
		sel.text = tag;
		myField.focus();
		}
	else{
		if (myField.selectionStart || myField.selectionStart == '0') {
			//Se ejecuta en Mozila
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var cursorPos = endPos;
			//agrego el smyle en la posicion donde esta el cursor
			myField.value = myField.value.substring(0, startPos)
					  + tag
					  + myField.value.substring(endPos, myField.value.length);
			cursorPos += tag.length;
			myField.focus();
			myField.selectionStart = cursorPos;
			myField.selectionEnd = cursorPos;
			}
		else{
			//Si no se ejecuta ni en mozila ni en ie, agregamos al final del valor del text area
			myField.value += tag;
			myField.focus();
			}
		}
}

function texto(opcion){
	var myField;
	//Capturo el text area del form
	if (document.getElementById('texto') && document.getElementById('texto').type == 'textarea') {
		myField = document.getElementById('texto');
		}
	else
		return false;
	//Segun lo que quiera el usuario, signamos dos variables con los modificadores del texto
	if(opcion=='negrita'){
		tag1="<b>";
		tag2="</b>";
		}
	if(opcion=='cursiva'){
		tag1="<i>";
		tag2="</i>";
		}
	if (document.selection) {
		//Se ejecuta en IE
		myField.focus();
		sel = document.selection.createRange();
		aux = tag1 + sel.text + tag2;
		sel.text = aux;
		myField.focus();
		}
	else{
		if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var cursorPos = endPos;
			//asigno al valor al valor del text area el el vaor del mismo insertando las etiquetas
			myField.value = myField.value.substring(0, startPos)
					  + tag1 + myField.value.substring(startPos, endPos) + tag2
					  + myField.value.substring(endPos, myField.value.length);
			
			cursorPos +=  tag1.lenght + tag2.lenght;
			myField.focus();
			myField.selectionStart = cursorPos;
			myField.selectionEnd = cursorPos;
			}
		else{
			//En caso de que el navegador no acepte las dos funciones anteriores, se agrega al final
			myField.value += tag1 + tag2;
			myField.focus();
			}
		}
}


function enlace() {
	var myField;
	if (document.getElementById('texto') && document.getElementById('texto').type == 'textarea') {
		myField = document.getElementById('texto');
		}	
	else
		return false;
	//Capturo los enlaces y sus datos
	url = prompt("Dirección de la web a enlazar","http://");
	asociado = prompt("Texto asociado a la URL","Texto");
	
	if (document.selection) {
		//se ejecuta en IE
		myField.focus();
		sel = document.selection.createRange();
		//en donde haya seleccionado, coloco la url
		sel.text = '<a href="'+ url +'" target="_blank">' + asociado + '</a>';
		myField.focus();
		}
	else{
		if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var cursorPos = endPos;
			//Esto se ejecuta en mozila
			myField.value = myField.value.substring(0, startPos)
					  + '<a href="'+ url +'" target="_blank">' + asociado + '</a>' +
					  + myField.value.substring(endPos , myField.value.length);
			cursorPos += 31 + url.length + asociado.length;
			myField.focus();
			myField.selectionStart = cursorPos;
			myField.selectionEnd = cursorPos;
			}
		else{
			//Si no se ejecuta en un navegador que acepte los metodos anteriores
			myField.value += '<a href="'+ url +'" target="_blank">' + asociado + '</a>';
			myField.focus();
			}
		}
}

function email() {
	var myField;
	if (document.getElementById('texto') && document.getElementById('texto').type == 'textarea') {
		myField = document.getElementById('texto');
		}	
	else
		return false;
	//Capturo los enlaces y sus datos
	email = prompt("Direccion de Email","nombre@servidor.com");
	asociado = prompt("Texto asociado a la direccion de email","Texto");
	
	if (document.selection) {
		//se ejecuta en IE
		myField.focus();
		sel = document.selection.createRange();
		//en donde haya seleccionado, coloco la url
		sel.text = '<a href="mailto:'+ email +'" target="_blank">' + asociado + '</a>';
		myField.focus();
		}
	else{
		if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var cursorPos = endPos;
			//Esto se ejecuta en mozila
			myField.value = myField.value.substring(0, startPos)
					  + '<a href="mailto:'+ email +'" target="_blank">' + asociado + '</a>' +
					  + myField.value.substring(endPos , myField.value.length);
			cursorPos += 38 + email.length + asociado.length;
			myField.focus();
			myField.selectionStart = cursorPos;
			myField.selectionEnd = cursorPos;
			}
		else{
			//Si no se ejecuta en un navegador que acepte los metodos anteriores
			myField.value += '<a href="mailto:'+ email +'" target="_blank">' + asociado + '</a>';
			myField.focus();
			}
		}
}


function vinetas() {
	var myField;
	var tag1, tag2,i=0, cadena="<ul>";
	if (document.getElementById('texto') && document.getElementById('texto').type == 'textarea') {
		myField = document.getElementById('texto');
		}	
	else
		return false;
	
	cantidad = prompt("¿Cuantos items desea colocar?","");
	while(i<cantidad){
		vineta = prompt("Texto de la viñeta "+(i+1),"Texto "+(i+1));
		cadena+='<li>'+vineta+'</li>';
		i++;
		}
	cadena+='</ul>';
	
		if (document.selection) {
		//Se ejecuta en IE
		myField.focus();
		sel = document.selection.createRange();
		aux = sel.text + cadena;
		sel.text = aux;
		myField.focus();
		}
	else{
		if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var cursorPos = endPos;
			//asigno al valor al valor del text area el el vaor del mismo insertando las etiquetas
			myField.value = myField.value.substring(0, startPos)
					  + myField.value.substring(startPos, endPos) + cadena
					  + myField.value.substring(endPos, myField.value.length);
			
			cursorPos += cadena.lenght;
			myField.focus();
			myField.selectionStart = cursorPos;
			myField.selectionEnd = cursorPos;
			}
		else{
			//En caso de que el navegador no acepte las dos funciones anteriores, se agrega al final
			myField.value += cadena;
			myField.focus();
			}
		}
}


function encabezado(tipo) {
	var myField;
	var tag1, tag2;
	if (document.getElementById('texto') && document.getElementById('texto').type == 'textarea') {
		myField = document.getElementById('texto');
		}	
	else
		return false;

	switch(tipo){
		case 1:
			tag1='<h1>';
			tag2='</h1>';
			break;
		case 2:
			tag1='<h2>';
			tag2='</h2>';
			break;
		case 3:
			tag1='<h3>';
			tag2='</h3>';
			break;
		}
	
	if (document.selection) {
		//Se ejecuta en IE
		myField.focus();
		sel = document.selection.createRange();
		aux = tag1 + sel.text + tag2;
		sel.text = aux;
		myField.focus();
		}
	else{
		if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			var cursorPos = endPos;
			//asigno al valor al valor del text area el el vaor del mismo insertando las etiquetas
			myField.value = myField.value.substring(0, startPos)
					  + tag1 + myField.value.substring(startPos, endPos) + tag2
					  + myField.value.substring(endPos, myField.value.length);
			
			cursorPos +=  tag1.lenght + tag2.lenght;
			myField.focus();
			myField.selectionStart = cursorPos;
			myField.selectionEnd = cursorPos;
			}
		else{
			//En caso de que el navegador no acepte las dos funciones anteriores, se agrega al final
			myField.value += tag1 + tag2;
			myField.focus();
			}
		}
}



function validaRegistro(){
	var totOK = true;
	var textError = "";
	 
	 if (document.registro.user.value==""){
		textError += "\nError. Debe introducir su nombre de usuario.";
		document.registro.nombre.focus();
		totOK = false;
		}
		
	if (document.registro.user.value.length<5){
		textError += "\nError. El nombre de usuario debe contener 5 caracteres como mínimo.";
		document.registro.user.focus();
		totOK = false;
		}
	
	if (document.registro.user.value.length>15){
		textError += "\nError. El nombre de usuario puede tener 15 caracteres como máximo.";
		document.registro.user.focus();
		totOK = false;
		}
		
	if (document.registro.user.value.indexOf(' ') != -1){
		textError += "\nError. El nombre de usuario no puede contener caracteres en blanco.";
		document.registro.user.focus();
		totOK = false;
		}
		
	if (document.registro.nombre.value==""){
		textError += "\nError. Debe introducir su nombre.";
		document.registro.nombre.focus();
		totOK = false;
		}
	   
	 if (document.registro.email.value==""){
		textError += "\nError. Debe introducir una direccón de e-mail.";
		document.registro.email.focus();
		totOK = false;
		}
		
	 if ((document.registro.email.value.indexOf('@') == -1)||(document.registro.email.value.indexOf('.') == -1)) {
		textError += "\nError. El Email es incorrecto.";
		document.registro.email.focus()
		totOK=false;
		}
	 
	if (document.registro.pass.value==""){        
		textError += "\nError. Debe introducir una contraseña.";
		document.registro.pass.focus();
		totOK = false;
		}
	   
	if (document.registro.repass.value==""){        
		textError += "\nError. La Confirmacion de la contraseña esta vacia.";
		document.registro.repass.focus();
		totOK = false;
		}
	
	if (document.registro.pass.value!=document.registro.repass.value){        
		textError += "\nError. Las contraseñas no coinciden.";
		document.registro.pass.focus();
		totOK = false;
		}
		
	if (document.registro.pass.value.length<4 || document.registro.repass.value.length<4){        
		textError += "\nError. La contraseña debe tener como minimo 4 caracteres.";
		document.registro.pass.focus();
		totOK = false;
		}
	
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
}

function validaTema(){
	var totOK = true;
	var textError = "";
	var i=0;
	var limite=75;
	var mini,cadena,vector;
	
	if (document.foro.asunto.value==""){
		textError += "\nError. Debe introducir el asunto.";
		document.foro.asunto.focus();
		totOK = false;
		}
	
	
	if (document.foro.asunto.value.length>=100){
		textError += "\nError. El asunto es demasiado largo.";
		document.foro.asunto.focus();
		totOK = false;
		}
		
	if (document.foro.texto.value==""){
		textError += "\nError. El mensaje no puede estar vacío.";
		document.foro.texto.focus();
		totOK = false;
		}
	
	mini=document.foro.texto.value;
	vector=mini.split(" ");

	while(i<vector.length){
		cadena=vector[i];
		if(cadena.length>limite){
			textError += "\nError. El mensaje contiene palabras execivamente largas.";
			document.foro.texto.focus();
			i=vector.length;
			totOK = false;
			}
		i++;
		}
	
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
}

function validaComentario(){
	var totOK = true;
	var textError = "";
	
	if (document.nuevo_comentario.autor.value==""){
		textError += "\nError. Debe introducir un nombre.";
		document.nuevo_comentario.autor.focus();
		totOK = false;
		}
	
	if (document.nuevo_comentario.autor.value.length<=1 || document.nuevo_comentario.autor.value.length>=20){
		textError += "\nError. El nombre es debe contener entre 2 y 20 caracteres.";
		document.nuevo_comentario.autor.focus();
		totOK = false;
		}
	
	if ((document.nuevo_comentario.email.value.indexOf('@') == -1)||(document.nuevo_comentario.email.value.indexOf('.') == -1)) {
		textError += "\nError. El Email es incorrecto.";
		document.nuevo_comentario.email.focus()
		totOK=false;
		}
	
	if (document.nuevo_comentario.texto.value.length==""){
		textError += "\nError. El mensaje no puede estar vacío.";
		document.nuevo_comentario.texto.focus();
		totOK = false;
		}
		
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
}


function validaNoticia(){
	var totOK = true;
	var textError = "";
	
	if (document.noticia.titulo.value==""){
		textError += "\nError. El titulo no puede estar vacia.";
		document.noticia.titulo.focus();
		totOK = false;
		}
	
	if (document.noticia.corta.value==""){
		textError += "\nError. La Introduccion de la noticia no puede estar vacia.";
		document.noticia.corta.focus();
		totOK = false;
		}
		
	if (document.noticia.larga.value==""){
		textError += "\nError. El Desarrollo de la noticia no puede estar vacio.";
		document.noticia.larga.focus();
		totOK = false;
		}
	
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
}

function confirmarNoticia() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\nRecuerde que si elimina una noticia, se eliminaran todos sus comentarios.\n¿Realmente desea continuar?")){
		return true;
		}
	else{
		return false;
		}
}

function confirmarCategoria() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\nRecuerde que si elimina una categoria, se eliminaran todas sus noticias y los comentarios de estas.\n¿Realmente desea continuar?")){
		return true;
		}
	else{
		return false;
		}
}

function confirmarTema() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\nRecuerde que si elimina un tema, se eliminaran todos sus mensajes.\n¿Realmente desea continuar?")){
		return true;
		}
	else{
		return false;
		}
}

function confirmarMensaje() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\n¿Realmente desea eliminar el mensaje?")){
		return true;
		}
	else{
		return false;
		}
}

function validaModificarPassword(){
	var totOK = true;
	var textError = "";
	
	/*if ((document.modificar_usuario.email.value.indexOf('@') == -1)||(document.modificar_usuario.email.value.indexOf('.') == -1)) {
		textError += "\nError. El Email es incorrecto.";
		document.modificar_usuario.email.focus()
		totOK=false;
		}*/
	
	if (document.modificar_password.repass.value==""){
		textError += "\nError. La confirmacion de la contraseña no puede estar vacia.";
		document.modificar_password.repass.focus();
		totOK = false;
		}
		
	if (document.modificar_password.pass.value!=document.modificar_password.repass.value){
		textError += "\nError. Las contraseñas no pueden ser distintas.";
		document.modificar_password.repass.focus();
		totOK = false;
		}
		
	
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
}


function validaModificarDatos(){
	var totOK = true;
	var textError = "";
	
	if ((document.modificar_datos.email.value.indexOf('@') == -1)||(document.modificar_datos.email.value.indexOf('.') == -1)) {
		textError += "\nError. El Email es incorrecto.";
		document.modificar_datos.email.focus()
		totOK=false;
		}

	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
}

function confirmarEliminarUsuario() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\n¿Realmente desea eliminar el usuario?")){
		return true;
		}
	else{
		return false;
		}
}

function confirmarEliminarComentario() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\n¿Realmente desea eliminar el comentario?")){
		return true;
		}
	else{
		return false;
		}
}

function insertarImagenCategoria(texto){
	window.opener.document.nueva_categoria.archivo.value = texto;
	window.close();
}

function popup (img,sx,sy,num) {
        var winl = (screen.width-sx)/2;
        var wint = (screen.height-sy)/2;
        image = "<a href='javascript:self.close()'><img src="+img+" border='0' alt='Clic aquí para cerrar'></a>";
        popupwin=window.open("","photo"+num,"toolbar=no,location=no,directories=no,status=no,menubar=no,top="+wint+",left="+winl+",width="+sx+",height="+sy+"");
        popupwin.document.write("<HTML><HEAD><TITLE>Galeria de Fotos</TITLE></HEAD><BODY BGCOLOR=#FFFFFF><CENTER>" + image + "</CENTER></BODY></HTML>");
        popupwin.document.close();
        }
	
function insertarImagenEnlace(texto){
	window.opener.document.editar_enlace.imagen.value = texto;
	window.close();
}

function confirmarEliminarCatEnlace() {
	//Muestro un mensaje para confirmar la operación
	if (confirm("Esta a punto de modificar la base de datos.\nEsto eliminará todos los enlaces de la categoria.\n¿Realmente desea eliminar la categoria?")){
		return true;
		}
	else{
		return false;
		}
}

function validaAgregarEnlace(){
	var totOK = true;
	var textError = "";
	
	if (document.agregar_enlace.titulo.value==""){
		textError += "\nError. El titulo no puede estar vacío.";
		document.agregar_enlace.titulo.focus();
		totOK = false;
		}
	
	if (document.agregar_enlace.web.value=="" || document.agregar_enlace.web.value=="http://"){
		textError += "\nError. La web no puede estar vacía.";
		document.agregar_enlace.web.focus();
		totOK = false;
		}
	
	
	if (document.agregar_enlace.descripcion.value==""){
		textError += "\nError. La descripcion no puede estar vacía.";
		document.agregar_enlace.descripcion.focus();
		totOK = false;
		}
		
	
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
	}

function validaAgregarCategoriaEnlace(){
	var totOK = true;
	var textError = "";
	
	if (document.agregar_categoria_enlace.nombre.value==""){
		textError += "\nError. El titulo no puede estar vacío.";
		document.agregar_categoria_enlace.nombre.focus();
		totOK = false;
		}
	
	if (document.agregar_categoria_enlace.descripcion.value==""){
		textError += "\nError. La descripcion no puede estar vacía.";
		document.agregar_categoria_enlace.descripcion.focus();
		totOK = false;
		}
		
	
	if (!totOK){
		alert(textError);
		}
	   
	return totOK;
	}
	
function tratarFecha(dia,mes,ano){
	if(dia<10){
		dia="0"+dia;
		}
	if(mes<10){
		mes="0"+mes;
		}
	window.opener.document.modificar_partido.fecha.value = dia + "/"+ mes + "/" + ano;
	window.close();
	}

function OcultarMenu(){
	obj = document.getElementById("desplegable");
	x = parseInt(obj.style.left);
	if(x<0)
		x=0
	else
		x=-500;
	obj.style.left = x+"px";
	}
	
	
	
<!--FUNCIONES REFERIDAS A LA TIENDA-->
function buyItem(newItem, newPrice, newQuantity) {
	if (newQuantity <= 0) {
		rc = alert('La cantidad ingresada es incorrecta');
		return false;
	}
	if (confirm('¿Agregar '+newQuantity+' '+newItem+' al carrito?')) {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
			countend = document.cookie.indexOf(";", index);
			if (countend == -1) {
					countend = document.cookie.length;
			}
				document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+","+newPrice+"#"+newQuantity+"]";
	}
	return true;
}

function resetShoppingBasket() {
	index = document.cookie.indexOf("TheBasket");
	document.cookie="TheBasket=.";
}

function CargarFoto(img, ancho, alto){
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
  fin=window.open(img,"",string);
}

function alterError(value) {
	if (value<=0.99) {
		newPounds = '0';
	} else {
		newPounds = parseInt(value);
	}
	newPence = parseInt((value+.0008 - newPounds)* 100);
	if (eval(newPence) <= 9) newPence='0'+newPence;
	newString = newPounds + '.' + newPence;
	return (newString);
}

function showItems() {
	index = document.cookie.indexOf("TheBasket");
	countbegin = (document.cookie.indexOf("=", index) + 1);
		countend = document.cookie.indexOf(";", index);
		if (countend == -1) {
				countend = document.cookie.length;
		}
	fulllist = document.cookie.substring(countbegin, countend);
	totprice = 0;
	document.writeln('<form><table border="1" cellspacing="0" width="500" bgcolor="#E0E0E0" bordercolor="#FFFFFF" class="td">');

document.writeln('<TR><TD width="250"><b>Producto</b></TD><TD width="80" align="right"><b>Cantidad</b></TD><TD width="120" align="right"><b>Costo x unidad</b></TD><td width="100" align="right"><b>Costo total</b><TD width="90">&nbsp;</TD></TR>');
	itemlist = 0;
	for (var i = 0; i <= fulllist.length; i++) {
		if (fulllist.substring(i,i+1) == '[') {
			itemstart = i+1;
		} else if (fulllist.substring(i,i+1) == ']') {
			itemend = i;
			thequantity = fulllist.substring(itemstart, itemend);
			itemtotal = 0;
			itemtotal = (eval(theprice*thequantity));
			temptotal = itemtotal * 100;
			var tax = itemtotal / 100 * (0 - 0);
				tax = Math.floor(tax * 100)/100
			totprice = totprice + itemtotal + tax;
			itemlist=itemlist+1;
document.writeln('<tr><td>'+theitem+'</td><td align=right>'+thequantity+'</td><td align=right>'+theprice+'</td><td align=right>'+alterError(itemtotal)+'</td><td align=center><input TYPE="button" NAME="remove" VALUE="Quitar" onclick="javascript:removeItem('+itemlist+')"></td></tr>');
		} else if (fulllist.substring(i,i+1) == ',') {
			theitem = fulllist.substring(itemstart, i);
			itemstart = i+1;
		} else if (fulllist.substring(i,i+1) == '#') {
			theprice = fulllist.substring(itemstart, i);
			itemstart = i+1;
		}
	}

	

	document.writeln('<tr><td colspan=3><b>Total</b></td><td align=right>'+alterError(totprice)+'</td><td>&nbsp;</td></tr>');
	document.writeln('</TABLE>');
}

function removeItem(itemno) {
	newItemList = null;
	itemlist = 0;
	for (var i = 0; i <= fulllist.length; i++) {
		if (fulllist.substring(i,i+1) == '[') {
			itemstart = i+1;
		} else if (fulllist.substring(i,i+1) == ']') {
			itemend = i;
			theitem = fulllist.substring(itemstart, itemend);
			itemlist=itemlist+1;
			if (itemlist != itemno) {
				newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']';
			}
		}
	}
	index = document.cookie.indexOf("TheBasket");
	document.cookie="TheBasket="+newItemList;
	top.location = "index.php?opcion=estado";
}

function clearBasket() {
	if (confirm('¿Confirma que desea reestablecer el carrito?')) {
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket=.";
		top.location = "index.php?opcion=estado";
	}
}


function Enviar(form) {
	for (i = 0; i < form.elements.length; i++) {
		if (form.elements[i].type == "text" && form.elements[i].value == "") {  
			alert("Por favor complete todos los campos del formulario"); form.elements[i].focus(); 
			return false; 
			}
		}
	form.submit();
}


function showItemsFinal() {
	index = document.cookie.indexOf("TheBasket");
	countbegin = (document.cookie.indexOf("=", index) + 1);
		countend = document.cookie.indexOf(";", index);
		if (countend == -1) {
				countend = document.cookie.length;
		}
	fulllist = document.cookie.substring(countbegin, countend);
	totprice = 0;

	itemlist = 0;
	for (var i = 0; i <= fulllist.length; i++) {
		if (fulllist.substring(i,i+1) == '[') {
			itemstart = i+1;
		} else if (fulllist.substring(i,i+1) == ']') {
			itemend = i;
			thequantity = fulllist.substring(itemstart, itemend);
			itemtotal = 0;
			itemtotal = (eval(theprice*thequantity));
			temptotal = itemtotal * 100;
			var tax = itemtotal / 100 * (0 - 0);
				tax = Math.floor(tax * 100)/100
			totprice = totprice + itemtotal + tax;
			itemlist=itemlist+1;
			document.writeln('<INPUT TYPE="hidden" NAME="Producto'+itemlist+'" VALUE="'+theitem+'" SIZE="40">');
			document.writeln('<INPUT TYPE="hidden" NAME="Cantidad'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">')
			document.writeln('<INPUT TYPE="hidden" NAME="ProductoTotal'+itemlist+'" VALUE="'+alterError(itemtotal)+'" SIZE="40">');
		} else if (fulllist.substring(i,i+1) == ',') {
			theitem = fulllist.substring(itemstart, i);
			itemstart = i+1;
		} else if (fulllist.substring(i,i+1) == '#') {
			theprice = fulllist.substring(itemstart, i);
			itemstart = i+1;
		}
	}

	document.writeln('<INPUT TYPE="hidden" NAME="Total" VALUE="'+alterError(totprice)+'" SIZE="40">');

}
function Total() {
	document.writeln(alterError(totprice));
}


function OcultarAviso(){
	obj = document.getElementById("proximos_eventos");
	x = parseInt(obj.style.left);
	if(x<0)
		x=455
	else
		x=-800;
	obj.style.left = x+"px";
	}
	


<!--FIN FUNCIONES TIENDA-->