/*
 * 
 * Copyright © 2012 All Rights Reserved, http://simpletrees.co.uk
 * 
 * NOTICE:  All information contained herein is, and remains the property 
 * of Simple Trees Ltd and its suppliers, if any. The intellectual and 
 * technical concepts contained herein are proprietary to Simple Trees Ltd 
 * and its suppliers and may be covered by UK, EU and Foreign Patents, 
 * patents in process, and are protected by copyright law. Dissemination of 
 * this information or reproduction of this material is strictly forbidden
 * unless prior written permission is obtained from Simple Trees Ltd. 
 *
 * This version of the product and all associated intellectual/technical
 * concepts are intended for demo purposes only and not for resale.
 *
 * Contact info@simpletrees.co.uk for license agreements or more details.
 *
 */
function createLights(a,b){var c="<div class='lighttransition'></div>";var d=0;if(b){sp=b;var e=sp.getOptions();for(i=0;i<e.length;i++){var f=i+1;c=c+"<li class='light'>"+"<div id='li"+f+"' class='bulb' onclick='onBulbClick(this);'>"+"<label class='bulb-text bulb-text-zindex'>"+f+"</label>"+"</div>"+"<div id='li"+f+"t' class='light-text'>"+e[i].text+"</div>"+"<div style='visibility: hidden; float: left; position: fixed;'><textarea id='li"+f+"v'>"+e[i].value+"</textarea></div>"+"</li>";d++}}else{c=c+"<li class='light'><div id='li1' class='bulb light-before'><label class='bulb-text bulb-text-zindex'>1</label></div><div class='light-text hidebulb'><label>Stage 1</label></div></li>"+"<li class='light'><div id='li2' class='bulb light-before'><label class='bulb-text bulb-text-zindex'>2</label></div><div class='light-text hidebulb'><label>Stage 2</label></div></li>"+"<li class='light'><div id='li3' class='bulb light-current'><label class='bulb-text bulb-text-zindex'>3</label></div><div class='light-text hidebulb'><label>Stage 3</label></div></li>"+"<li class='light'><div id='li4' class='bulb light-after'><label class='bulb-text bulb-text-zindex'>4</label></div><div class='light-text hidebulb'><label>Stage 4</label></div></li>";d=4}a.html(c);transitionEnd=$("#li"+d).offset().left+$("#li"+d).width();setTimeout("animate()",600)}function onBulbClick(a){var b="#"+$(a).attr("id")+"v";sp.setValue($(b).val());refreshLights()}function animate(){if($(".lighttransition").offset().left<transitionEnd){var a={};a.top=$(".lighttransition").offset().top;a.left=$(".lighttransition").offset().left+5;$(".lighttransition").offset(a);setTimeout("animate()",1)}else{$(".bulb-text-zindex").removeClass("bulb-text-zindex")}}function refreshLights(){var a=sp.getOptions();var b=sp.getOption(sp.getValue()).text;var c="light-before";for(i=0;i<a.length;i++){var d=i+1;$("#li"+d).removeClass("light-before");$("#li"+d).removeClass("light-current");$("#li"+d).removeClass("light-after");if(b!=null&&a[i].text==b){c="light-current"}else{if(c=="light-current"){c="light-after"}}$("#li"+d).addClass(c)}}var sp