Giovanni Rena: Calender-Script gibt keinen Rückgabewert

Beitrag lesen

3. Teil

function selChange ()
{
 if (selectionType.indexOf ("month") != -1)
  showMonth = document.getElementById ("selection").value * 1;
 else
  showYear = document.getElementById ("selection").value * 1;
 document.getElementById ("calendarSelect").innerHTML = "";
 captureCtrl = true;
 makecal ();
}

function setCap(id)
{
 if (captureCtrl && document.getElementById ("calendar").setCapture)
  document.getElementById ("calendar").setCapture(false);

var obj = document.getElementById(id);

obj.style.border= "1px solid #FFFFFF";
 obj.style.backgroundColor = "#FFFFFF";
}

function releaseCap(id, param)
{
 if(param == false && document.getElementById ("calendar").releaseCapture)
 {
  document.getElementById ("calendar").releaseCapture();
 }
 else
 {
  var obj = document.getElementById(id);
  obj.style.border= "1px solid #4E5166";
  obj.style.backgroundColor = "#C7CCF2";
    if (document.getElementById ("calendar").releaseCapture)
    document.getElementById ("calendar").releaseCapture();
 }
}

function calout(daynr, minc)
{
 var tempint = showMonth + 1 + minc;
 var tempyear = showYear;
 if(tempint == 13) {tempint = 1; showYear++; tempyear++; showMonth = -1;}
 if(tempint == 0) {tempint = 12; tempyear--;}
 if(minc > 0) showMonth++;
 dateStr = daynr + "." + tempint + "." + tempyear;
 dateobj.value = dateStr;

//korrektur für wiederholten start
 showYear = thisYear;
 showMonth = thisMonth;

clearCal ();
}

function CalClick()
{
 if( window.event.srcElement.tagName != "SELECT")
 {
  if(window.event.srcElement.tagName != "TD" )
   clearCal();
  clearCal ();
 }
}

function keyHandler()
{
 if(window.event.keyCode == 27) clearCal();
}

function clearCal()
{
  if (!captureCtrl)
  {
    selChange ();
    return;
  }
  document.getElementById ("calendar").innerHTML=" ";
  if (document.getElementById ("calendar").releaseCapture)
    document.getElementById ("calendar").releaseCapture();
  document.body.onkeydown = document.getElementById ("calendar").onkeydown;
  extFunc();
}

function extFunc()
{
 return;
}

function debAltr (debStr)
{
 if (debugCal)
  alert (debStr);
}

var calxPos = 0;
var calyPos = 0;
function showCal(target, xpos, ypos, selType, _debug, hideholiday)
{
  var clientWidth = document.body.clientWidth;
  var xOffset     = Math.floor ((clientWidth - 752) / 2) - 300;

xOffset = 0;

if (!selType)
  selType = "year-";
 if (_debug)
  debugCal = true;
 if (hideholiday)
   holnoclick = true;

dateobj=eval(target);
 document.getElementById ("calendar").onKeyDown = document.body.onkeydown;
 document.body.onkeydown = keyHandler;

if (document.getElementById ("calendar").setCapture)
   document.getElementById ("calendar").setCapture(false);

if (document.getElementById ("calendar").innerHTML != " " && document.getElementById ("calendar").innerHTML != "")
   clearCal();
 else
 {
  calxPos = xpos;
  calyPos = ypos;
  document.getElementById ("calendar").style.left = xpos + xOffset + "px";
  document.getElementById ("calendar").style.top  = ypos + "px";
  makecal (selType);
 }
}
// -->
</script>
</head>
<div id="calendar" onClick="CalClick()" style="position:absolute; z-index:50;"> </div>
<div id="calendarSelect" style="position:absolute; z-index:99;"></div>

<script language="JavaScript" src="/include/Datefunctions.js" type="text/javascript"></script>
<head>

<style>
<!--
 .tdTitle   {background-color:#a0a0a0; font-family:"TAHOMA, HELVETICA, SANS-SERIF"; font-size:8pt; color:#000000; font-weight:bold}
 .tdDefault {background-color:#e4e4e4; font-family:"TAHOMA, HELVETICA, SANS-SERIF"; font-size:8pt; color:#000000}
 .tdDefault2{background-color:#f0f0f0; font-family:"TAHOMA, HELVETICA, SANS-SERIF"; font-size:8pt; color:#000000}
 .tdWhite   {background-color:#ffffff; font-family:"TAHOMA, HELVETICA, SANS-SERIF"; font-size:8pt; color:#000000; text-align=right}
-->
</style>

<script language="JavaScript" type="text/javascript">

function chkselect ()
{
  if (document.SupCallData.callhour.selectedIndex == 0)
    document.SupCallData.callminute.selectedIndex = 1;
}

function extFunc()
{
 document.SupCallData.CalltimeDisplay.value = FormatDate( parseGermanDate(document.SupCallData.CallDatetime.value) ,"#dd#-#monthshort#-#yyyy#", "ger");
}

</script>

<script language="JavaScript" type="text/javascript">
<!--
var selectedPoint = "";

function chgBorder (tdID, statusID, title)
{
  if (statusID == 1)
  {
    document.getElementById (tdID).style.border = "1px solid #4E5166";
    document.getElementById (tdID).style.backgroundColor = "#C7CCF2";
    document.getElementById (tdID).style.backgroundImage = "url(/graphic/Club-Menue-Background.gif)";

document.getElementById ("lnk_" + tdID).className = "MenuLinkSelect";
    top.status = title;
    return true;
  }
  else
  {
    document.getElementById (tdID).style.border = "1px solid white";
    document.getElementById (tdID).style.backgroundColor = "white";
    document.getElementById (tdID).style.backgroundImage = "";
    if (tdID != selectedPoint)
      document.getElementById ("lnk_" + tdID).className = "MenuLink";
    top.status = "Tobit Software";
  }

}

function setMenuPoint (tdID)
{
  if (selectedPoint != "")
  {
    document.getElementById (selectedPoint).style.border = "1px solid white";
    document.getElementById (selectedPoint).style.backgroundColor = "white";
    document.getElementById ("lnk_" + selectedPoint).className = "MenuLink";
  }
  selectedPoint = tdID;
  document.getElementById (tdID).style.border = "1px solid white";
  document.getElementById (tdID).style.backgroundColor = "white";
  document.getElementById ("lnk_" + tdID).className = "MenuLinkSelect";
}

//-->
</script>

<p>  </p>
<form action="RequestSupportCall_Save.asp" method="post" name="SupCallData" id="SupCallData">

Zeitpunkt 
         <input type="hidden" name="CallDatetime" value="19.02.2004" />
         <input readonly"readonly" class="inputfld" type="text" name="CalltimeDisplay" size="9" value="" />
  
         <img src="/graphic/calendar.gif" width="14" height="14" border="0" alt="calendar" onclick="showCal(document.SupCallData.CallDatetime,200,10, null, null, false)" style="cursor:hand;" />
</form>

</body>
</html>