function createSliders (object) {
			slidersOn = true;
			var sf = {name: object.fName, fId: object.fId, args: object.argsValues }
			sliderFunctions.push (sf);
			sliderFunctionId = sf.fId;
			var fId = object.fId;
			var fname = object.fName;
			var argsName = object.argsNames;
			var number = argsName.length;
			var argsValue = object.argsValues;
			if(oldNum > 0)
				removeSliders (oldNum);
				//sliderDiv =  document.getElementById("sliders_output");
			sliderHead = document.getElementById("slidersGrabBar")

			if (language == "Gr"){
			var html = 'Μεταβολείς της συνάρτησης '+fname ;
			}
			else {var html = 'Sliders of '+fname + ' function'; }
			divid = document.getElementById("sliders");
			sliderHead.innerHTML = html;
			if (language == "Gr")
			divid.innerHTML =' <table id="sliderTable" style="width:100%"><tr><th>Όνομα</th><th align="left">Από</th><th style= "width: 80%" >  </th><th align = "right">Έως</th><th>Βήμα</th></tr> </table> ';
  			else
			divid.innerHTML =' <table id="sliderTable" style="width:100%"><tr><th>Name</th><th align="left">From</th><th style= "width: 80%" >  </th><th align = "right">To</th><th>Step</th></tr> </table> ';

			for (j=0; j<number; j++) {

			var brel = document.createElement('br');
			divid.appendChild(brel);
			var axisY = document.createElement('input');
			axisY.setAttribute('type', "image");
			axisY.style.width = "2%";
			axisY.style.zIndex="90";
			axisY.style.height = "9%";
			axisY.style.cursor = "pointer"
			axisY.style.position = "absolute"
			//axisX.style.marginLeft = "10px"
			axisY.setAttribute ('src' , ".//icons/axisYgrey.png");
			axisY.setAttribute('id', j+"_axisY");
			axisY.onclick=function(){if (this.src.match(".//icons/axisYgrey.png")){
				if (!tdactive)
					tdactive = true;
				if(document.getElementById("twoDVT").style.visibility=="hidden")
					document.getElementById("twoDVT").style.visibility="visible";
				for (var i = 0; i < oldNum; i++){
					if(document.getElementById(i+"_axisY").src.match(".//icons/axisYgreen.png"))
					{document.getElementById(i+"_axisY").src=".//icons/axisYgrey.png" }
					}

				 this.src = ".//icons/axisYgreen.png";

				xid = $(this).attr("id"); splt = xid.split("_");
				tdaxisY = splt[0];
				if(document.getElementById(splt[0]+"_axisX").src.match(".//icons/axisYgreen.png")){
					document.getElementById(splt[0]+"_axisX").src=".//icons/axisYgrey.png" }

			 }
			else {this.src = ".//icons/axisYgrey.png"  ; tdaxisY = null;}};
			var axisX = document.createElement('input');
			axisX.setAttribute('type', "image");

			axisX.style.width = "20px";
			axisX.style.height = "3%";
			axisX.style.zIndex="100";
			axisY.style.cursor = "pointer"
			axisX.style.position = "absolute"
			axisX.style.marginTop = "20px"
			axisX.style.marginLeft = "2px"
			axisX.setAttribute ('src' , ".//icons/axisYgrey.png");
			axisX.setAttribute('id', j+"_axisX");
			axisX.onclick=function(){if (this.src.match(".//icons/axisYgrey.png")){
			if (!tdactive)
					tdactive = true;
			if(document.getElementById("twoDVT").style.visibility=="hidden")
					document.getElementById("twoDVT").style.visibility="visible";
			for (var i = 0; i < oldNum; i++){
					if(document.getElementById(i+"_axisX").src.match(".//icons/axisYgreen.png"))
					{document.getElementById(i+"_axisX").src=".//icons/axisYgrey.png" }
					}

				this.src = ".//icons/axisYgreen.png";
			xid = $(this).attr("id"); splt = xid.split("_");
			tdaxisX = splt[0];
				if(document.getElementById(splt[0]+"_axisY").src.match(".//icons/axisYgreen.png"))
					{document.getElementById(splt[	0]+"_axisY").src=".//icons/axisYgrey.png" }




			 }
				else {this.src = ".//icons/axisYgrey.png"  ; tdaxisX = null ;}};
			var minim = document.createElement('input');
			minim.setAttribute('type', "text");
			minim.setAttribute('id', j+"_min");
			//minim.style.position = "absolute";


			if(j!=0)
			minim.style.marginTop = "4%";
			minim.onchange = function () {var id = $(this).attr("id"); splt = id.split("_");
			 var minvalue = this.value.substring();
			$( "#"+splt[0] ).slider("option", "min", parseFloat(minvalue));
			 };
			 if (argsValue[j].args!=null){
				 minV = Math.floor(-argsValue[j].args[0].data*2)
				minim.setAttribute('value',minV);

				}
				else{
					minV = Math.floor(argsValue[j].data/2)
				minim.setAttribute('value',minV);}

			var maxim = document.createElement('input');
			maxim.setAttribute('type', "text");
			maxim.setAttribute('id', j+"_max");
			maxim.setAttribute('align', "right");
			//maxim.style.position = "absolute";

			maxim.style.marginLeft = "81%";
			maxim.style.marginTop = "-5%";
			maxim.onclick = function () { this.value='';}
			 if (argsValue[j].args!=null){

				maxV = -argsValue[j].args[0].data/2

				maxim.setAttribute('value',maxV );

				}
				else{
			if (argsValue[j].data!=0)
				maxV = argsValue[j].data*2
				else maxV = 10;
				maxim.setAttribute('value',maxV );}
			maxim.onchange = function () {var id = $(this).attr("id"); splt = id.split("_");
			 var maxvalue = this.value.substring();
			$( "#"+splt[0] ).slider("option", "max", parseFloat(maxvalue));
			 }

			 var step = document.createElement('input');
			step.setAttribute('type', "text");
			step.setAttribute('id', j+"_step");
			//step.style.position = "absolute";
			step.style.marginLeft = "89%";
			step.style.marginTop = "-5%";
			step.setAttribute('onChange', function () {});
			step.setAttribute('value',1);
			step.onchange = function () {var id = $(this).attr("id"); splt = id.split("_");
			 var stepvalue = this.value.substring();
			$( "#"+splt[0] ).slider("option", "step", parseFloat(stepvalue));
			 };

			var variable = document.createElement('span');
			variable.setAttribute("id","variable");
			if(j!=0)
			variable.style.marginTop = "9%";

			variable.style.marginLeft = "30px";
			variable.style.width = "40px";
			variable.style.fontSize = "8 px";
			variable.style.color = "black";

			variable.innerHTML = argsName[j].data + "   ";


		var sliderValue = document.createElement('input');
			sliderValue.setAttribute('type',"text");
			sliderValue.setAttribute('id',j+"_amount");
			sliderValue.style.position = "relative";
			sliderValue.style.fontSize = "9 px";
			sliderValue.style.marginLeft = "22%";
			//sliderValue.style.marginTop = "2%";
			sliderValue.style.color = "black";
			sliderValue.style.backgroundColor = "transparent";
			sliderValue.style.border = "none";
			sliderValue.readOnly = true;

			var newDiv = document.createElement('div');
  			var divIdName = j;
			newDiv.setAttribute('id',divIdName);
			newDiv.setAttribute('width',"40%");

			divid.appendChild(axisY);
			divid.appendChild(axisX);
			if (argsName[j].data.length > 7){
			 var br = document.createElement('br');
			 divid.appendChild(br);
			 newDiv.style.marginLeft = "30%";
			 sliderValue.style.marginLeft = "30%";
			 }
			divid.appendChild(variable);
			divid.appendChild(minim);
			divid.appendChild(newDiv);

			divid.appendChild(maxim);
			divid.appendChild(step);
			divid.appendChild(sliderValue);
			if (argsValue[j].args!=null){svalue = -argsValue[j].args[0].data}
			else
				svalue = argsValue[j].data
			$("#"+divIdName).slider({
				value: svalue,
				min:  minV ,
				max: maxV,
				step: 1,
			orientation: "horizontal",

			animate: true,
			slide: function (event, ui) {
			changeSliderValue(this,ui);


			},
			change: function (event, ui) {
			changeSliderValue(this,ui);

			},
			create: function( event, ui ) {
				var id = $(this).attr("id");
				if (argsValue[j].args!=null)
							$( "#"+id+"_amount" ).val(-argsValue[j].args[0].data);
				else $( "#"+id+"_amount" ).val( argsValue[j].data);
				thumb1 = $($( "#"+id).children('.ui-slider-handle'));
					 slValue = $("#"+id+"_amount");
				setLabelPosition (slValue, thumb1);

			}

			});



			//newDiv.appendChild(newSpan);

			}
			oldNum = number;
	 function changeSliderValue (slider,ui) {
				fromSliders = true;
				var code = "";
				var functFound = false;
				var id = $(slider).attr("id");
				//console.log (ui.value)
				$( "#"+id+"_amount" ).val( ui.value );

				newCode = fname ;
						for(var i=0; i<argsValue.length; i++) {
					argsValue[i].data = $( "#" + i+"_amount" ).val();
					newCode = newCode + " " + argsValue[i].data;
					}

					//console.log ("fid: " + fId);
					var historyCommand = logo.usedFunctions;
					//console.log (historyCommand);
					clean ();
					reset_turtle(turtle);
					$("body").css("cursor", "wait");
					for (i=0; i<historyCommand.length; i++)
					{
					code = "";
						if ((!fromOpenFile) || (fromOpenFile && !functFound)){

						turtle.setpos (historyCommand[i].turtlePosition.x,historyCommand[i].turtlePosition.y,historyCommand[i].turtlePosition.z);//console.log ("notFoundYet");

						}
						turtle.setDirection (historyCommand[i].turtleDirection);
						turtle.setUp (historyCommand[i].turtleUp);
						// turtle.up = historyCommand[i].up;
						if (i != fId){
							turtle.color = new THREE.Color(defaultColor);
						//code = code + " "+ historyCommand[i].name;
						//console.log (logo.usedFunctions[i]);
							command =historyCommand[i].name;
						for(j=0; j< historyCommand[i].argsVal.length; j++) {
							var commandArg = historyCommand[i].argsVal[j];
								command = command + " " + commandArg.data
							if (commandArg.type != "num"){

								var tokenArgsArray = retrieveArgs (commandArg)
								//console.log (tokenArgsArray);

								for (var l =0; l<tokenArgsArray.length; l++){
								 command = command+ " " + tokenArgsArray[l];
								}
								if (commandArg.type == "lst")
									command = command + "]"

							}
						}
							//console.log (code);
							code = code +" " + command;	
							run (code,false);
							//turtle.setDirection (historyCommand[i].turtleDirection);



					}	else { //console.log (newCode);
					turtle.color = new THREE.Color(parameters.TURTLE_SELECT_COLOR);
					run (newCode,false);  lastPos=turtle.getPos();
					//console.log ("found");
					functFound = true;

					}

						//console.log (lastPos);



					}
					$("body").css("cursor", "default");

					turtle.setpos (lastPos.x,lastPos.y,lastPos.z);
					turtle.color = new THREE.Color(defaultColor);
					//console.log ("code : " + code);
					//redraw(code);
					thumb = $($( "#"+id).children('.ui-slider-handle'));
					slValue = $("#"+id+"_amount")
       			 	setLabelPosition(slValue,thumb);
					fromSliders = false;

			}


		}



		function setLabelPosition(idName, tm) {
      //  idName.css('top', tm.position().top + idName.outerHeight(true));
	//  console.log (tm.position().left);
       idName.css('left', tm.position().left);

		      //  idName.css('left', tm.position().left);
    }

function removeSliders (num) {


			for (k=0; k<num; k++) {
					$("#"+k).slider ("destroy");
				}
			$("#sliders").children().remove();
			document.getElementById("sliders").innerHTML = "&nbsp; ";
			sliderHead = document.getElementById("slidersGrabBar");
			sliderHead.innerHTML = " ";

		}

function resizeSlider (){
		for (k=0; k<num; k++) {
		 thumb = $($( "#"+k).children('.ui-slider-handle'));
					slValue = $("#"+k+"_amount")
       			 setLabelPosition(slValue,thumb);
		}
		}
	// JavaScript Document
