 e = ' &euro;';
 nb = '&nbsp;';
 kurVal = 0;
 g2Val = 0;

 
function setRes(rId) {
  kp = trackbar.getObject('kunPerc').leftValue*0.01;
  
  if (rId == 'kun') {
   ih('kunPercIdVal', dl(trackbar.getObject('kunPerc').leftValue)+' %');
//   setRes('verm');
//   setRes('gold');
   setRes('inv');
   setRes('kur');
   setRes('g2');
  }
  else if (rId == 'kur') {
	v1 = trackbar.getObject(rId).leftValue;
	var ar1 = new Array(100,200,280,350,420,500,575,650);
	kurVal = ch('kur')*ar1[v1];
//	ih(rId+'IdVal', dl(kurVal+e));
	ih(rId+'4IdVal', dl(kurVal));
  }
  else if (rId == 'g2') {
	g2Val = ch('g2')*50;
	ih(rId+'IdVal', dl(g2Val+e));
	ih(rId+'4IdVal', dl(g2Val));
  }

  else if ((rId != '')) {
   v1 = trackbar.getObject(rId).leftValue;
   if (rId != 'sumPerc') { ih(rId+'IdVal', dl(ch(rId)*v1)+e); }

   if ((rId == 'sum') || (rId == 'bet')) {
	spv0 = trackbar.getObject(rId+'Perc').leftValue;
	sp0 = spv0*0.01;

	ih(rId+'4IdVal', dl(ch(rId)*Math.round(v1*sp0))+e);
	ih(rId+'PercIdVal', dl(ch(rId)*spv0)+' %');
//	ih(rId+'PercIdVal2', dl(ch(rId)*spv0)+' %');
   }
   else {
    v2 = trackbar.getObject(rId+'Y').leftValue;
//	ih(rId+'1IdVal', dl(ch(rId)*Math.round(v1*v2*12*0.01)));
	ih(rId+'YIdVal', nb + dl(ch(rId)*v2));
	ih(rId+'4IdVal', dl(ch(rId)*Math.round(v1*v2*12*kp)));
   }
  }

/*
  p1 = Math.round(ch('verm')*trackbar.getObject('verm').leftValue*trackbar.getObject('vermY').leftValue*12*0.01)+
		Math.round(ch('gold')*trackbar.getObject('gold').leftValue*trackbar.getObject('goldY').leftValue*12*0.01)+
		Math.round(ch('inv')*trackbar.getObject('inv').leftValue*trackbar.getObject('invY').leftValue*12*0.01)+
		Math.round(ch('bet')*trackbar.getObject('bet').leftValue*trackbar.getObject('betPerc').leftValue*0.01)+
		Math.round(ch('sum')*trackbar.getObject('sum').leftValue*sp);
  ih('tot1IdVal', dl(p1));
*/

  p4 = //Math.round(ch('verm')*trackbar.getObject('verm').leftValue*trackbar.getObject('vermY').leftValue*12*kp)+
//		Math.round(ch('gold')*trackbar.getObject('gold').leftValue*trackbar.getObject('goldY').leftValue*12*kp)+
		Math.round(ch('inv')*trackbar.getObject('inv').leftValue*trackbar.getObject('invY').leftValue*12*kp)+
		kurVal + g2Val +
		Math.round(ch('bet')*trackbar.getObject('bet').leftValue*trackbar.getObject('betPerc').leftValue*0.01)+
		Math.round(ch('sum')*trackbar.getObject('sum').leftValue*trackbar.getObject('sumPerc').leftValue*0.01);
  ih('tot4IdVal', dl(p4));
}
 
function ch(chId) {
  if (eval('document.form1.'+chId+'Check.checked')) { return 1; }
  else { return 0; }
}
 
//function sc_init() {
 trackbar.getObject('sum').init({
	onMove : function() {
	 setRes('sum');
	},
	dual : false, // two intervals
	width : 320, // px
	leftLimit : 1000, // unit of value
	leftValue : 10000, // unit of value
	rightLimit : 50000, // unit of value
	rightValue : 0, // unit of value
	roundUp: 100,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "sumId");
 
 trackbar.getObject('sumPerc').init({
	onMove : function() {
	 setRes('sum');
	},
	dual : false, // two intervals
	width : 320, // px
	leftLimit : 2, // unit of value
	leftValue : 5, // unit of value
	rightLimit : 6, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "sumPercId");

 trackbar.getObject('kur').init({
	onMove : function() { 
	 setRes('kur');
	},
	dual : false, // two intervals
	width : 200, // px
	leftLimit : 0, // unit of value
	leftValue : 7, // unit of value
	rightLimit : 7, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "kurId");

/*
 trackbar.getObject('verm').init({
	onMove : function() { 
	 setRes('verm');
	},
	dual : false, // two intervals
	width : 200, // px
	leftLimit : 34, // unit of value
	leftValue : 50, // unit of value
	rightLimit : 74, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "vermId");


 trackbar.getObject('vermY').init({
	onMove : function() {
	 setRes('verm');
	},
	dual : false, // two intervals
	width : 70, // px
	leftLimit : 7, // unit of value
	leftValue : 20, // unit of value
	rightLimit : 31, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "vermYId");
*/
/*
 trackbar.getObject('gold').init({
	onMove : function() {
	 setRes('gold');
	},
	dual : false, // two intervals
	width : 200, // px
	leftLimit : 50, // unit of value
	leftValue : 100, // unit of value
	rightLimit : 500, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "goldId");
 
 trackbar.getObject('goldY').init({
	onMove : function() {
	 setRes('gold');
	},
	dual : false, // two intervals
	width : 70, // px
	leftLimit : 10, // unit of value
	leftValue : 20, // unit of value
	rightLimit : 35, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "goldYId");
*/
 
 trackbar.getObject('inv').init({
	onMove : function() {
	 setRes('inv');
	},
	dual : false, 
	width : 200,
	leftLimit : 50,
	leftValue : 100,
	rightLimit : 500,
	rightValue : 0,
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "invId");
 
 trackbar.getObject('invY').init({
	onMove : function() { 
	 setRes('inv');
	},
	dual : false,
	width : 70,
	leftLimit : 10,
	leftValue : 20,
	rightLimit : 35,
	rightValue : 0,
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "invYId");

//function sc_init() {
 trackbar.getObject('bet').init({
	onMove : function() {
	 setRes('bet');
	},
	dual : false, // two intervals
	width : 320, // px
	leftLimit : 50000, // unit of value
	leftValue : 100000, // unit of value
	rightLimit : 200000, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1000,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "betId");
 
 trackbar.getObject('betPerc').init({
	onMove : function() {
	 setRes('bet');
	},
	dual : false, // two intervals
	width : 320, // px
	leftLimit : 1, // unit of value
	leftValue : 5, // unit of value
	rightLimit : 6, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "betPercId");

 trackbar.getObject('kunPerc').init({
	onMove : function() {
	 setRes('kun');
	},
	dual : false, // two intervals
	width : 320, // px
	leftLimit : 1, // unit of value
	leftValue : 2, // unit of value
	rightLimit : 4, // unit of value
	rightValue : 0, // unit of value
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "kunPercId");


/*
 trackbar.getObject('sach').init({
	onMove : function() {
	 setRes('sach');
	},
	dual : false, 
	width : 200,
	leftLimit : 50,
	leftValue : 100,
	rightLimit : 500,
	rightValue : 0,
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "sachId");
 
 trackbar.getObject('sachY').init({
	onMove : function() { 
	 setRes('sach');
	},
	dual : false,
	width : 70,
	leftLimit : 10,
	leftValue : 20,
	rightLimit : 30,
	rightValue : 0,
	roundUp: 1,
	clearLimits : true,
	clearValues : true,
	hehe : ":-)"
 }, 
 "sachYId");
*/