function FitxaCursos()
{
	this.selectedTab = null;
	
	this.inicializar = function() {
		var strTab = this.getParameter( "tab" );
	    this.selectedTab = "descripcio";
	    if ( document.getElementById( "a_" + strTab ) )
	    {
	    	this.selectedTab = strTab;
	    }
	    // Registro en Google Analytics de la pestaņa visitada. 
	    /*if ( typeof( window[ 'pageTracker' ] ) != "undefined" )
	    {
	   		pageTracker._trackPageview('/ficha_curso/' + selectedTab );
	    }*/
	    	   
	    document.getElementById("descripcio").className = "escondido";
	    document.getElementById("programa").className = "escondido";
	    document.getElementById("matriculacio").className = "escondido";
	    if ( document.getElementById("preinscripcio") ) { 	          
	  	 	document.getElementById("preinscripcio").className = "escondido";
	    } 
	    document.getElementById("informacio").className = "escondido";
	    document.getElementById(this.selectedTab).className = "mostrado";	        
	    	    
	    this.toogle(this.selectedTab);
	    
	    this.toogleEnlaces('programa', '1', 3);
	    this.toogleEnlaces('matriculacio', '1', 5);
	    this.toogleEnlaces('preinscripcio', '1', 1);
	    this.toogleEnlaces('informacio', '1', 2);	    	   
	}
	
	this.toogle = function(param) {	          
		//if (param != this.selectedTab) {
		    // Registro en Google Analytics de la pestaņa visitada. 
		    /*if ( typeof( window[ 'pageTracker' ] ) != "undefined" )
		    {
		       pageTracker._trackPageview('/ficha_curso/' + param );
		    }*/
		      
		    document.getElementById("a_" + this.selectedTab).className = "";
		    document.getElementById(this.selectedTab).className= "escondido";
		    document.getElementById(param).className = "mostrado";
		    if ( param == "informacio" )
		    	document.getElementById("a_" + param).className = "seleccionado_ultimo";
		    else
		    	document.getElementById("a_" + param).className = "seleccionado";
		    this.selectedTab = param;		    
		//}
	}
	
	this.toogleEnlaces = function( capa, habilitado, max ) {
	    for ( var intAux=1; intAux<=max; intAux++ )
	    {
	    	document.getElementById(capa + "_" + intAux).className = "escondido";
	    }
		document.getElementById(capa + "_" + habilitado).className = "mostrado";
	}
	    
	this.openPrintScreen = function( pagina ) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=600, height=450, top=85, left=140";
		window.open(pagina,"",opciones);				
	}
	
	this.getParameter = function( name ) {
	    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	    var regexS = "[\\?&]"+name+"=([^&#]*)";
	    var regex = new RegExp( regexS );
	    var results = regex.exec( window.location.href );
	    if( results == null )
	      return "";
	    else
	      return results[1];
	}

}