

function fiche_sticker_matiere(var_id_theme, var_id_ss_theme, var_id_sticker){
	
		
	
	jQuery(document).ready(function(){
 	
   		$.ajax({	
			
			type: "GET",
			url: "xml/theme"+var_id_theme+".xml",
			dataType: "xml",
			success: function(xml) {
		 	
		
		
			
			$(xml).find('stickers[id='+var_id_sticker+']').each(function(){	
							var id = $(this).attr('id');
							var nom_theme = $(this).attr('theme');
							var nom_sous_theme = $(this).attr('sous_theme');
							var id_theme = $(this).attr('id_theme');	
							var new_sticker = $(this).attr('new_sticker');
							
							var url_stickers = $(this).find('url_stickers').text();			
							var nom = $(this).find('nom').text();																
							var reference = $(this).find('reference').text();
							var nom_illustrateur = $(this).find('illustrateur').text();
							var id_illustrateur = $(this).find('illustrateur').attr('id');						
							var designation = $(this).find('designation').text();
																			 
					
					
				
					
					
					$(this).find('matiere').each(function(){
						var nom_matiere=$(this).find('nom_matiere2').text();
						
						
						if(nom_matiere!=""){
							var id_matiere=$(this).attr('id');	
							
							var designation_matiere="";
							
							
							if(id_matiere==1 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							
							if(id_matiere==2 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							
							if(id_matiere==3 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							if(id_matiere==6 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							if(id_matiere==8 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							if(id_matiere==5 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							if(id_matiere==7 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							if(id_matiere==4 && nom_matiere!=""){
								designation_matiere+=nom_matiere;	
							}
							
											
																		
																		
							
							
							
							var chemin="http://www.toostick.com/img/base/png/noir/"+reference+".png"; 
							
							
							//var iframe_modele='<div  style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+chemin+'\'); width:450px;height:450px; float:left;" id="color" class="color"><img src="'+chemin+'" alt="stickers '+nom+'" width="420" height="420" hspace="0" vspace="0" border="0" id="modele_sticker" style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" title="stickers '+nom+'"/></div>';
						
						//var picker_color='<div style=" background-color:#FFF; border: 1px solid #666; background-image:url(img/charte_graphique/fb_bouton2_grand.jpg); background-repeat:repeat; padding:4px; width:99%;"><strong>Changer couleur de fond</strong><br/><input size="7" class="color" onchange="document.getElementsByTagName(\"fieldset\")[0].style.backgroundColor = \"#'+this.color+'\" " value="" /><br/></div>';
						
						var picker_color='';
			
							
							var iframe_modele='<fieldset style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+chemin+'\');text-align:left; width:450px; float:left;" class="cadre"  id="color">';
							
							 iframe_modele+='<img src="'+chemin+'" width="420" height="420" style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0); position:absolute; z-index:4; padding:10px" id="move">';
							
							 //iframe_modele+='<img src="farbtastic/fauteuil.png"  style="margin-top:260px; margin-left:440px;position:absolute; z-index:6;" id="move2">';
							 
							 iframe_modele+='<img src="img/charte_graphique/mask.png" width="450" height="450" style="position:relative; z-index:1;">';
							 
							 iframe_modele+='</fieldset>';
							
				
							
							
							
							
//LES COULEURS DE STICKERS__________________________________________________________________________________________________________________________________________________________________________
//STICKERS BLANC IMPRIMES---------------------------------------------------------------------------------------------------------------

							var iframe_couleur1='';


//STICKERS BLANC IMPRIMES------------------------------------------------------------------------------------------------------------
							var iframe_couleur2='<div style="cursor:pointer;background-color:#ffffff;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif"  width="18" height="18"  border="1" style="border-color:#000000" alt="Sticker en vinyle blanc" title="Sticker en vinyle blanc" onclick="changecouleur(\''+id+'\', \'blanc\', \''+reference+'\', \''+nom+'\', \'blanc\', \'Stickers colorés\' )">';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor:pointer;background-color:#e8d7bd;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000" alt="Sticker en vinyle ivoire" title="Sticker en vinyle ivoire" onclick="changecouleur(\''+id+'\', \'ivoire\', \''+reference+'\', \''+nom+'\', \'ivoire\', \'Stickers colorés\' )">';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#fdda38;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Sticker en vinyle jaune" title="Sticker en vinyle jaune" onclick="changecouleur(\''+id+'\', \'jaune\', \''+reference+'\', \''+nom+'\', \'jaune\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#f5a905;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Sticker en vinyle orange" title="Sticker en vinyle orange" onclick="changecouleur(\''+id+'\', \'orange\', \''+reference+'\', \''+nom+'\', \'orange\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#e86a2f;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle orange foncé" title="Stickers en vinyle orange foncé" onclick="changecouleur(\''+id+'\', \'orange foncé\', \''+reference+'\', \''+nom+'\', \'orange_fonce\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#d01003;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle rouge" title="Stickers en vinyle rouge" onclick="changecouleur(\''+id+'\', \'rouge\', \''+reference+'\', \''+nom+'\', \'rouge\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#a40150;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle rouge foncé" title="Stickers en vinyle rouge foncé" onclick="changecouleur(\''+id+'\', \'rouge foncé\', \''+reference+'\', \''+nom+'\', \'rouge_fonce\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#2795c8;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle bleu" title="Stickers en vinyle bleu" onclick="changecouleur(\''+id+'\', \'bleu\', \''+reference+'\', \''+nom+'\', \'bleu\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#08166e;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle bleu foncé" title="Stickers en vinyle bleu foncé" onclick="changecouleur(\''+id+'\', \'bleu foncé\', \''+reference+'\', \''+nom+'\', \'bleu_fonce\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#00d140;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle vert" title="Stickers en vinyle vert" onclick="changecouleur(\''+id+'\', \'vert\', \''+reference+'\', \''+nom+'\', \'vert\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#157200;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle vert foncé" title="Stickers en vinyle vert foncé" onclick="changecouleur(\''+id+'\', \'vert foncé\', \''+reference+'\', \''+nom+'\', \'vert_fonce\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#482a06;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle marron" title="Stickers en vinyle marron" onclick="changecouleur(\''+id+'\', \'marron\', \''+reference+'\', \''+nom+'\', \'marron\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#797979;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle gris" title="Stickers en vinyle gris" onclick="changecouleur(\''+id+'\', \'gris\', \''+reference+'\', \''+nom+'\', \'gris\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#000000;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/shim.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle noir" title="Stickers en vinyle noir" onclick="changecouleur(\''+id+'\', \'noir\', \''+reference+'\', \''+nom+'\', \'noir\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#ffffff;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/fd_or.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle dorée mat" title="Stickers en vinyle dorée mat" onclick="changecouleur(\''+id+'\', \'dorée\', \''+reference+'\', \''+nom+'\', \'or\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<div style="cursor: pointer;background-color:#ffffff;float:left; margin:1px; padding:0px;">';
							iframe_couleur2+='<img src="img/fd_argent.gif" width="18" height="18"  border="1" style="border-color:#000000"  alt="Stickers en vinyle argent mat" title="Stickers en vinyle argent mat" onclick="changecouleur(\''+id+'\', \'argent\', \''+reference+'\', \''+nom+'\', \'argent\', \'Stickers colorés\' )" >';
							iframe_couleur2+='</div>';
							
							iframe_couleur2+='<br style="clear:both"/>';
							
							
							var iframe_couleur3='';
							var iframe_couleur4='';
							var iframe_couleur5='';
							var iframe_couleur6='';
							var iframe_couleur7='';
							var iframe_couleur8='';
							//var iframe='<div  style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+$chemin+'\'); width:450px;height:450px; float:left;" id="color"><img src="'+$chemin+'" alt="stickers '+nom+'" width="420" height="420" hspace="0" vspace="0" border="0" id="modele_sticker" style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" title="stickers '+nom+'"/></div><div style="width:120px;height:120px; float:left;"><div class="form-item"></div><div id="picker"></div></div><br style"clear:both"/>';
						
							//var iframe="<iframe src='fiche_sticker_modele.inc.php?reference="+reference+"' scrolling='no' style='width:450px; height:800px; border:0px; float:left;'></iframe><iframe src='fiche_sticker_colore.inc.php?id_matiere="+id_matiere+"&reference="+reference+"&nom="+nom+"&nom_matiere="+nom_matiere+"&id="+id+"' scrolling='no' style='width:450px; height:800px; border:0px; float:left;'>3</iframe>";
							
						
							
							if(id_matiere==1 && nom_matiere!=""){	
							$('<div  class="TabbedPanelsContent" id="TabbedPanelsContent1"></div>').html(iframe_modele+iframe_couleur1).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==2 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"  id="TabbedPanelsContent2"></div>').html(picker_color+iframe_modele+iframe_couleur2).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==3 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"></div>').html(iframe_modele+iframe_couleur3).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==4 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"></div>').html(iframe_modele+iframe_couleur4).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==5 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"></div>').html(iframe_modele+iframe_couleur5).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==6 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"></div>').html(iframe_modele+iframe_couleur6).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==7 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"></div>').html(iframe_modele+iframe_couleur7).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							if(id_matiere==8 && nom_matiere!=""){							
							$('<div  class="TabbedPanelsContent"></div>').html(iframe_modele+iframe_couleur8).appendTo('#TabbedPanelsContentGroup1');	
							}
							
							$(document).ready(function(){
								$("#move").draggable({containment:".article"}); 
								$("#move2").draggable({containment:".cadre"}); 
								
							});
												
					
		
							var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
							}
						 });		
														 
				});						
			} 
		});
	});
}