//<![CDATA[
// Demo NyroModal
jQuery(function() {
	jQuery.nyroModalSettings({
		debug: false,
		processHandler: function(settings) {
			var url = settings.url;
      if (url && url.indexOf('http://www.youtube.com/watch?v=') == 0) {
				jQuery.nyroModalSettings({
					type: 'swf',
					height: 500,
					width: 650,
					url: url.replace(new RegExp("watch\\?v=", "i"), 'v/')
				});
			}
		},
		endShowContent: function(elts, settings) {
			jQuery('.resizeLink', elts.contentWrapper).click(function(e) {
				e.preventDefault();
				jQuery.nyroModalSettings({
					modal: true
				});
				return false;
			});
			jQuery('.bgLink', elts.contentWrapper).click(function(e) {
				e.preventDefault();
				jQuery.nyroModalSettings({
					bgColor: '#'+parseInt(255*Math.random()).toString(16)+parseInt(255*Math.random()).toString(16)+parseInt(255*Math.random()).toString(16)
				});
				return false;
			});
		}
	});
			
	function preloadImg(image) {
		var img = new Image();
		img.src = image;
	}
	
	preloadImg('img/ajaxLoader.gif');
	preloadImg('img/prev.gif');
	preloadImg('img/next.gif');
	
});	
//]]>

function showModal(ref, nom) {
jQuery.nyroModalManual({
	debug: false,
	type: 'ajax',
	selIndicator: true,
	bgColor: '#333',
	ajax: {url: '3d/3d_view.php', data: 'reference='+ref+'&pdt_name='+nom, type: 'POST'}
	});
}

function showModalImplantation() {
jQuery.nyroModalManual({
	debug: false,
	type: 'ajax',
	selIndicator: true,
	bgColor: '#333',
	ajax: {url: 'implantation_lb.html', data: '', type: 'POST'}
	});
}

function showModalNouvelleGamme() {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	url: 'nouvelle_gamme.html'
	});
}

function showModalSelPoignees(idcat, sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: 'S&eacute;lectionner votre mod&egrave;le de poign&eacute;e',
	ajax: {url: 'selecteur_poignees.php', data: 'Categorie='+idcat+'&osCsid='+sessionid, type: 'POST'},
	endRemove: function() { document.getElementById('bulle').innerHTML=''; }
	});
}

function showModalGACuisine(fonction, sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: '',
	ajax: {url: 'guide_cuisine_ajax.php', data: 'Fonction='+fonction+'&Param1='+sessionid, type: 'POST'}
	});
}

function showModalGABPorte(fonction, sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: '',
	ajax: {url: 'guide_bporte_ajax.php', data: 'Fonction='+fonction+'&Param1='+sessionid, type: 'POST'}
	});
}

function showModalGAPlacard(fonction, sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: '',
	ajax: {url: 'guide_placard_ajax.php', data: 'Fonction='+fonction+'&Param1='+sessionid, type: 'POST'}
	});
}

function showModalGAElectro(fonction, sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: '',
	ajax: {url: 'guide_electro_ajax.php', data: 'Fonction='+fonction+'&Param1='+sessionid, type: 'POST'}
	});
}

function showModalImplantation(sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: '',
	ajax: {url: 'implantation_lb.php', data: '', type: 'POST'}
	});
}

function showModalImplantationDesign(sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	title: '',
	ajax: {url: 'implantation_lb_design.php', data: '', type: 'POST'}
	});
}

function showModalCGV(sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	height: 425,
	width: 630,
	title: '',
	ajax: {url: 'cgv_lb.php', data: '', type: 'POST'}
	});
}

function showModalFichePdt(catid, sessionid) {
jQuery.nyroModalManual({
	debug: false,
	bgColor: '#333',
	height: 425,
	width: 630,
	title: '',
	ajax: {url: 'fichePdt.php', data: 'Param1='+catid+'&Param2='+sessionid, type: 'POST'}
	});
}
