/*----------------------------------------------------------------------
[Global JavaScript ] 
Desc: site wide javascript		
-----------------------------------------------------------------------*/


/* Not looking for any trouble here -----------------------------------*/

var $j = jQuery.noConflict();


/* When the dom is ready... -------------------------------------------*/

$j(document).ready(function() {
	init();
});

/* Global > run some functions  ---------------------------------------*/

function init(){
	
	$j('body').addClass('js');
	if($j.browser.msie) { 
		$j('body').addClass('ie');
	};

	$j('#slider_prestations').bxSlider({
		displaySlideQty: 	8
	});
	
	$j('.gallery').bxSlider({
		displaySlideQty: 	1,
		auto: true,
		mode: 'fade',
		speed: 1500,
		pause: 4000,
		randomStart: true, 
		controls: false
	});
	
	/* TOOLTIPS
	$j.fn.qtip.styles.matstyle = { // Last part is the name of the style
		color: '#000',
		backgroundColor: '#BCBEBD',
		opacity: 0.5,
		textAlign: 'center',
		border: {
			width: 1,
			radius: 2,
			color: '#BCBEBD'
		},
		tip: {
			size: {x:5,y:5}
		},
		title: {
			opacity : 0.5,
			color: '#000',
			backgroundColor: '#BCBEBD'
		},
		button: {
			color: '#000',
			backgroundColor: '#BCBEBD',
			opacity : 0.5
		},
		show: 'mouseover',
		hide: 'mouseout'
	};*/

	
	$j(function() {
	
		// LIGHTBOX
		$j('.gallery a').lightBox(); // Select all links in object with gallery ID
		
		/* TOOLTIP
		$j('a[title]').qtip({ position: { corner: { target: 'topMiddle', tooltip: 'bottomLeft'}}, style: { name: 'matstyle', tip: true } });
		$j('#content img[title]').qtip({ position: { corner: { target: 'topMiddle', tooltip: 'bottomLeft'}}, style: { name: 'matstyle', tip: true } });
		$j('#colophon img[title]').qtip({ position: { corner: { target: 'topLeft', tooltip: 'bottomRight'}}, style: { name: 'matstyle', tip: true } });
		$j('#branding img[title]').qtip({ position: { corner: { target: 'center', tooltip: 'bottomLeft'}}, style: { name: 'matstyle', tip: true } });*/
		
		// CUFON
		 Cufon.replace('#site-description', { fontFamily: 'DIN' })('.site-title a', { fontFamily: 'DIN' })('#access', { fontFamily: 'DIN' })('#access_pages', { fontFamily: 'DIN' })('.showroom', { fontFamily: 'din light' })('.showroom strong', { fontFamily: 'DIN' })('.page-title', { fontFamily: 'din light' })('#gallery_prestations_titre', { fontFamily: 'DIN' });
	});
	
	// NIVO SLIDER ACCUEIL
	$j('#slider').nivoSlider({
		effect:'fade',
		slices:10,
		animSpeed:1000, //Slide transition speed
        pauseTime:4000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:true, //Only show on hover
        controlNav:true, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
	});
};



