// Utilityfunctionen fuer die Bewegung
//
// setCursorType
// cOn   / cOut
// cOnV  / cOutV
// cOnVw / cOutVw
// cOnVg / cOutVg
// cOn1  / cOut1
// cOn2  / cOut2

function setCursorType(elem) {
  if(MS) { elem.style.cursor ="hand";}
  else { elem.style.cursor ="pointer"; }
 }
 function setCursorTypeIn(elem) {
  if(MS) { elem.style.cursor ="hand";
   elem.style.color="#663333";
  }
  else { elem.style.cursor ="pointer";
     elem.style.color="#663333";
  }
 }
  function setCursorTypeOut(elem) {
   elem.style.color="#cc0000";
 }
function resetCursorType(elem) { elem.style.cursor ="auto"; }
/*----------------------------------------------------------------------------*/
var cBaseColor;
var cForeColor;
function cOn(td){
 setCursorType(td);
 cBaseColor=td.style.backgroundColor;
 cForeColor=td.style.color;
 td.style.backgroundColor="#999999";
 td.style.color="#ffffff";

}

function cOut(td){
 td.style.backgroundColor=cBaseColor;
 td.style.color=cForeColor;
}

/*----------------------------------------------------------------------------*/
var cOnBaseColor;
function cOnV(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     setCursorType(elem);
     cOnBaseColor=elem.style.backgroundColor;
	 cOnTextColorw=elem.style.color;
     elem.style.backgroundColor="#ffffff";
	 elem.style.color = "#808080";
    }
  }
}
function cOutV(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     elem.style.backgroundColor=cOnBaseColor;
	 elem.style.color=cOnTextColorw;
    }
  }
}
/*----------------------------------------------------------------------------*/
var cOnBaseColorw;
var cOnTextColorw;
function cOnVw(name, anz){
var nameZ = "";
var elem = "";

  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     setCursorType(elem);
     cOnBaseColorw=elem.style.backgroundColor;
     cOnTextColorw=elem.style.color;
     elem.style.backgroundColor = "#ffffff";
     elem.style.color = "#808080";
    }
  }
}
function cOutVw(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     elem.style.backgroundColor=cOnBaseColorw;
     elem.style.color=cOnTextColorw;
    }
  }
}


var cOnBaseColorg;
var cOnTextColorg;
function cOnGw(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     setCursorType(elem);
     cOnBaseColorg=elem.style.backgroundColor;
     cOnForeColorg=elem.style.color;
     elem.style.backgroundColor="#999999";
     elem.style.color="#ffffff";

    }
  }
}

function cOutGw(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     elem.style.backgroundColor=cOnBaseColorg;
     elem.style.color=cOnForeColorg;
    }
  }
}
/*----------------------------------------------------------------------------*/
var cOnBaseColorg;
var cOnTextColorg;
function cOnVg(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     setCursorType(elem);
     cOnBaseColorg=elem.style.backgroundColor;
     cOnTextColorg=elem.style.color;
     elem.style.backgroundColor = "#e8e8e8";
     elem.style.color = "#808080";
    }
  }
}
function cOutVg(name, anz){
var nameZ = "";
var elem = "";
  for(i=0;i<anz;i++) {
    nameZ = name + "_" + i;
    elem = getElem("id", nameZ, null);
    if(elem != null) {
     elem.style.backgroundColor=cOnBaseColorg;
     elem.style.color=cOnTextColorg;
    }
  }
}
/*----------------------------------------------------------------------------*/
function cOn1(img){
var num = img.id.substring(2);
var td = '';
 if(typeof(num) == 'string') {
  if(num.length > 0 ) {
   td = getElem("id","te" + num,null);
   td.style.backgroundColor="#999999";
   td.style.color="#ffffff";
  }
 }
 img.src ="gif/sch_1.gif";
 img.style.cursor ="hand";
 window.status = getMess(td);
 return true;
}
function cOut1(img){
var num = img.id.substring(2);
var td = '';
 if(typeof(num) == 'string') {
  if(num.length > 0 ) {
   td = getElem("id","te" + num,null);
   td.style.backgroundColor="#ffffff";
   td.style.color="#333333";
  }
 }
 img.src="gif/sch_0.gif";
 window.status = ""
 return true;
}
/*----------------------------------------------------------------------------*/
function cOn2(td){
 td.style.backgroundColor="#999999";
 td.style.color="#cc0000";
 window.status = getMess(td);
 return true;
}
function cOut2(td){
 td.style.backgroundColor="#ffffff";
 td.style.color="#000000";
 window.status = ""
 return true;
}
/*----------------------------------------------------------------------------*/
function cOnBlack(td) {
 setCursorType(td);
 td.style.color = "#663333";
}
function cOutBlack(td) {
 td.style.color = "#cc0000";
}
/*----------------------------------------------------------------------------*/
function cOnlm(td){
var num = td.id.substring(2);
var img = '';
 if(typeof(num) == 'string') {
  if(num.length > 0 ) {
   img = getElem("id","im" + num,null);
   img.src ="gif/sch_1.gif";
   setCursorType(img);
  }
 }
 td.style.backgroundColor="#999999";
 td.style.color="#ffffff";
 setCursorType(td);
 window.status = getMess(td);
 return true;
}
function cOutlm(td){
var num = td.id.substring(2);
var img = '';
 if(typeof(num) == 'string') {
  if(num.length > 0 ) {
   img = getElem("id","im" + num,null);
   img.src ="gif/sch_0.gif";
  }
 }
 td.style.backgroundColor="#ffffff";
 td.style.color="#333333";
 window.status = ""
 return true;
}
function cOnlm1(img){
var num = img.id.substring(2);
var td = '';
 if(typeof(num) == 'string') {
  if(num.length > 0 ) {
   td = getElem("id","te" + num,null);
   td.style.backgroundColor="#999999";
   td.style.color="#ffffff";
  }
 }
 img.src ="gif/sch_1.gif";
 setCursorType(img);
 window.status = getMess(td);
 return true;
}
function cOutlm1(img){
var num = img.id.substring(2);
var td = '';
 if(typeof(num) == 'string') {
  if(num.length > 0 ) {
   td = getElem("id","te" + num,null);
   td.style.backgroundColor="#ffffff";
   td.style.color="#333333";
  }
 }
 img.src="gif/sch_0.gif";
 window.status = ""
 return true;
}
function cOnlm2(td){
 td.style.backgroundColor="#999999";
 td.style.color="#cc0000";
 window.status = getMess(td);
 return true;
}
function cOutlm2(td){
 td.style.backgroundColor="#ffffff";
 td.style.color="#000000";
 window.status = ""
 return true;
}
/*----------------------------------------------------------------------------*/



