	// Funcions del Menú (Cridades pel swf del menú)
function carregaPantalla(opcio){
switch (opcio){
	case "quiSom": {
					window.location.href="./presentacionempresa.html";
					break;
					}
	case "cursos": {
					window.location.href="./cursosformacion.asp";
					break;
					}
	case "articles": {
					window.location.href='./articulos.asp';
					break;
					}
	case "consells": {
					window.location.href="./consejosmedicinaalternativa.asp";
					break;
					}
	case "segonama": 	{
					window.location.href="./pdesegundamano.asp";
					break;
					}
	case "ccompra": {
					window.location.href="./condicionsdecompra.htm";
					break;
					}
	case "contacte": {
					contacte=window.open('./contacto.htm','contacte','resizable=yes, width=280, height=230, scrollbars=no');
					break;
					}
	case "home": {
					window.location.href="./default.asp";
					break;
					}
	}
}

function carregaCategoria(id,posIniScroll){
	window.location.href='./cpmedic.asp?cat='+id+'&posIniScroll='+posIniScroll;
}

	// Per detectar que el tipus d' imatge a pujar sigui .jpg
	// Nom formulari: frmSend, nom file: attach1
function checkFoto() {
  var ext = document.frmSend.attach1.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg' && ext!='') {
    alert('Ha sel.leccionat un arxiu .'+ext+
          ' i les imatges han de ser .jpg!');
    return false; }
  else
    return true; }

function checkFotoCast() {
  var ext = document.frmSend.attach1.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg' && ext!='') {
    alert('Ha seleccionado un archivo .'+ext+
          ' y las imagenes deben ser .jpg!');
    return false; }
  else
    return true; }

	// Comprova l' extensió de 3 imatges incloses en el document
function check3FotosCast() {
  var trobat=false;
  var extChunga;
  var ext = document.frmSend.attach1.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg' && ext!='') {
	  trobat=true;
	  extChunga=ext;
  }
  ext = document.frmSend.attach2.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg' && ext!='') {
	  trobat=true;
	  extChunga=ext;
  }
  ext = document.frmSend.attach3.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg' && ext!='') {
	  trobat=true;
	  extChunga=ext;
  }
  if (trobat){ 
    alert('Ha seleccionado un archivo .'+extChunga+
          ' y las imagenes deben ser .jpg!');
    return false; }
  else
    return true; }

	// Per obrir una foto en un popup autoajustable
var cont=0;

function obrePopup(imatge){
afoto(imatge,"Thermactol.com");
ventana=window.open('','ventana','resizable=yes,scrollbars=no, width=1, height=1')
}

function afoto(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
ventana=window.open('','ventana','resizable=yes,scrollbars=no, width=1, height=1')
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">')
ventana.document.close()
cont++
}

function redimensionar(ancho,alto)
{
ventana.resizeTo(ancho+6,alto+48)
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2) //centra la ventana. Eliminar si no se quiere centrar el popup
}
