

function initLightbox() {
		$(function() {
			// Use this example, or...
			//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
			// This, or...
			//$('#gallery a').lightBox(); // Select all links in object with gallery ID
			// This, or...
			//alert($('a.lightbox')[0].id);
			$('a.lightbox').lightBox(); // Select all links with lightbox class
			// This, or...
			//$('a').lightBox(); // Select all links in the page
			// ... The possibility are many. Use your creative or choose one in the examples above
		});
}

function activateTabCustom(Id, tabLength) {

var tab = substr(Id, 0, -1);
   for (var i = 1; i <= tabLength; i++) {
     //alert($('#'+tab+i).attr('class'));
     if (tab+i == Id)         { $('#'+tab+i).removeClass("tabIVout"); $('#'+tab+i).addClass("tabIVin");  $('#bloc'+i).show(); }
     else if (i == 1)         { $('#'+tab+i).removeClass("tabIVin"); $('#'+tab+i).addClass("tabIVout"); $('#bloc'+i).hide(); }
     else if (i == tabLength) { $('#'+tab+i).removeClass("tabIVin"); $('#'+tab+i).addClass("tabIVout"); $('#bloc'+i).hide(); }
     else                     { $('#'+tab+i).removeClass("tabIVin"); $('#'+tab+i).addClass("tabIVout"); $('#bloc'+i).hide(); }
   }
}


function activateSlider() {
		// Set up Sliders
		// **************
		$(function(){

			$('#slider1').anythingSlider({
				startStopped    : false, // If autoPlay is on, this can force it to start stopped
				width           : 800,   // Override the default CSS width
				height          : 500,   // Override the default CSS width
				theme           : 'metallic',
				autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
				resumeDelay     : 1000, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
				onSlideComplete : function(slider){
					// alert('Welcome to Slide #' + slider.currentPage);
				}
			});


		});
}

function substr( f_string, f_start, f_length ) {
    f_string += '';
 
    if(f_start < 0) {
        f_start += f_string.length;
    }
 
    if(f_length == undefined) {
        f_length = f_string.length;
    } else if(f_length < 0){
        f_length += f_string.length;
    } else {
        f_length += f_start;
    }
 
    if(f_length < f_start) {
        f_length = f_start;
    }

    return f_string.substring(f_start, f_length);
}

