/* Code by Gildas P. / www.gildasp.fr */  beList = new Array("Invisible", "Point", "Pixel", "RectS", "RectM", "RectL", "RectAll", "BlobS", "BlobM", "BlobL", "BlobAll", "CircleS", "CircleM", "CircleL", "CircleAll", "IsoTriangleS", "IsoTriangleM", "IsoTriangleL", "IsoTriangleAll", "LineH", "LineV", "Freestyle"); goList = new Array("Out", "Anywhere", "Up", "Down", "Left", "Right", "Line", "Nearby", "Windy", "GroupS", "GroupM", "GroupL", "Freestyle"); goList2 = new Array("NewAngle", "NoAngle"); thinkList = new Array("None", "RightStream", "LeftStream", "UpStream", "DownStream", "Dancing", "Frenetic", "Elliptic", "Claustrophobic", "GraviticCircles", "RandomGo", "Freestyle"); thinkList2 = new Array("None", "Rotative", "Tangencial", "ShapeShifter", "SolidShapeShifter", "Pulsing", "Epileptic", "Repulsive", "Attractive", "SolidCircles"); centerList = new Array("Middle", "Random", "Left", "Right", "BottomLeft", "BottomRight", "TopRight", "ContinuousRandom", "MouseDelay", "MouseNoDelay"); zoneList = new Array("XS", "S", "M", "L"); demoList = new Array("None", "GraphicFigure1", "GraphicFigure2", "GraphicFigure3", "GraphicFigure4", "GraphicFigure5", "GraphicFigure6", "GraphicFigure7", "Mosquitos", "TetsuoBlob", "BreakMyEyes1", "BreakMyEyes2", "SpaceJunk", "Spider", "Bacteria", "MagneticFlux", "Bubbles", "Claustrophobia1", "Claustrophobia2", "Claustrophobia3", "PlayBalls", "FallingVectors");  function createBtnGroup(textVal, famillePrefix, familleArray, id){ jQuery('#'+id).append('<input value="'+textVal+'" type="button" class="active" />'); for(i=0; i<familleArray.length; i++){ prefixe = toUpperCaseFirst(famillePrefix); jQuery('#'+id).append('<input name="'+famillePrefix+familleArray[i]+'" value="'+familleArray[i]+'" type="button" class="button '+famillePrefix+'Btn" onclick="active'+prefixe+'Effect(jQuery(this));" />'); } jQuery('#'+id).append('<br />'); }; function separateur(id){ jQuery('#'+id).append('<div class="separateur"></div>'); }; function createAdvancedMenu(){ createBtnGroup("Demo mode...", "demo", demoList, 'submenu'); separateur('submenu'); jQuery('#submenu').append('<input id="controlsBtn" value="Toggle Controls..." type="button" class="button" />'); jQuery('#submenu').append('<div id="controls" style="display:none;"></div>'); separateur('controls'); numbers = new Array(10, 30, 60 , 100, 200, 300, 400); jQuery('#controls').append('<input value="Particles..." type="button" class="active" />'); for(i=0; i<numbers.length; i++){ jQuery('#controls').append('<input name="numbers'+numbers[i]+'" value="'+numbers[i]+'" type="button" class="button pixelNb numbersBtn" onclick="activeParticlesNumber(jQuery(this));" />'); } jQuery('#controls').append('<br />'); jQuery('input[name="numbers60"]').addClass('active'); separateur('controls'); createBtnGroup("Be...", "be", beList, 'controls'); separateur('controls'); createBtnGroup("Go...", "go", goList, 'controls'); createBtnGroup("And...", "go2", goList2, 'controls'); separateur('controls'); createBtnGroup("Think...", "think", thinkList, 'controls'); createBtnGroup("And...", "think2", thinkList2, 'controls'); separateur('controls'); createBtnGroup("Center...", "center", centerList, 'controls'); separateur('controls'); createBtnGroup("Zone...", "zone", zoneList, 'controls'); jQuery('#controlsBtn').click(function(){ jQuery('#controls').toggle('slow'); }); jQuery('#controlsBtn').hide(); }; function activeBtnFromName(famille, nom){ activeBtnCommute(jQuery('input[name="'+famille+nom+'"]'), famille+'Btn'); }; function activeBtnCommute(JQobj, classe){ jQuery('input.'+classe).each(function(index){ $(this).removeClass('active'); }); JQobj.addClass('active'); }; function launchFunction(JQobj, classe, codeString){ jsPlayStatus = 0; $('#random').removeClass('active'); activeBtnCommute(JQobj, classe); for(i=0; i<nbPixels; i++){ eval(codeString); } }; function activeParticlesNumber(JQobj){ activeBtnCommute(JQobj, 'pixelNb'); p.changePixelsNumber(parseInt(JQobj.val())); }; function stopPlaylistOnClick(){ jsPlayerStop(); }; function activeBeEffect(JQobj){ launchFunction(JQobj, 'beBtn', 'listePixels[i].'+JQobj.attr('name')+'(0, 2);'); }; function activeGoEffect(JQobj){ launchFunction(JQobj, 'goBtn', 'listePixels[i].'+JQobj.attr('name')+'('+randFloat(0, 1)+', 2);'); }; function activeGo2Effect(JQobj){ launchFunction(JQobj, 'go2Btn', 'listePixels[i].'+JQobj.attr('name')+'('+randFloat(0, 1)+', 2);'); }; function activeThinkEffect(JQobj){ launchFunction(JQobj, 'thinkBtn', 'listePixels[i].'+JQobj.attr('name')+'();'); }; function activeThink2Effect(JQobj){ launchFunction(JQobj, 'think2Btn', 'listePixels[i].'+JQobj.attr('name')+'();'); }; function activeCenterEffect(JQobj){ launchFunction(JQobj, 'centerBtn', 'listePixels[i].'+JQobj.attr('name')+'('+randFloat(0, 1)+', 1);'); }; function activeZoneEffect(JQobj){ launchFunction(JQobj, 'zoneBtn', 'listePixels[i].'+JQobj.attr('name')+'('+randFloat(0, 1)+', 1);'); }; function activeDemoEffect(JQobj){ launchFunction(JQobj, 'demoBtn', 'stopPlaylistOnClick(); listePixels[i].'+JQobj.attr('name')+'('+randFloat(0, 1)+', 1);'); }; 
