document.getElementById("slider").oninput = function() { if (js_vars.role == "agent"){ if (js_vars.visibility == "visible"){ document.getElementById("visible_cut").value = this.value document.getElementById("slim_visible").style.left = (this.value - 1).toString().concat("px"); document.getElementById("rectangle_not_transparent").style.width = this.value.toString().concat("px"); document.getElementById("value_visible").innerHTML = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; document.getElementById("visible_bid").value = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; } else if (js_vars.visibility == "secret"){ document.getElementById("secret_cut").value = this.value document.getElementById("slim_secret").style.left = (this.value - 1).toString().concat("px"); document.getElementById("rectangle_transparent").style.width = this.value.toString().concat("px"); document.getElementById("value_secret").innerHTML = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; document.getElementById("secret_bid").value = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; } } else if (js_vars.role == "principal"){ if (js_vars.visibility == "visible"){ document.getElementById("visible_cut").value = this.value document.getElementById("slim_visible").style.left = (this.value - 1).toString().concat("px"); document.getElementById("value_visible").innerHTML = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; document.getElementById("visible_bid").value = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; document.getElementById("rectangle_not_transparent").style.left = this.value.toString().concat("px"); document.getElementById("rectangle_not_transparent").style.width = (js_vars.cake_width - this.value + 1).toString().concat("px"); } else if (js_vars.visibility == "secret"){ document.getElementById("secret_cut").value = this.value document.getElementById("slim_secret").style.left = (this.value - 1).toString().concat("px"); document.getElementById("value_secret").innerHTML = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; document.getElementById("secret_bid").value = js_vars.first_bid_agent + Math.round( this.value/js_vars.cake_width*js_vars.initial_spectrum*10)/10; document.getElementById("rectangle_transparent").style.left = this.value.toString().concat("px"); document.getElementById("rectangle_transparent").style.width = (js_vars.cake_width - this.value + 1).toString().concat("px"); } } }