
var inCalendarSelect=false;
function CalendarMouseOver()
{
 inCalendarSelect=false;
 if(ppcTI)
 {
   clearTimeout(ppcTI);
   ppcTI=false;
 }
}
function CalendarSelect()
{
   inCalendarSelect=true;
   clearTimeout(ppcTI);
   ppcTI=false;
}

function CalendarMouseOut()
{
 if (! inCalendarSelect)
 {
  ppcTI=setTimeout('hideCalendar()',500);
 }
}

var zindex=100;

if (ppcIE) 
{
 document.writeln("<div id=\"PopUpCalendar\" style=\"position:absolute; left:0px; top:0px; z-index:"+zindex+"; width:200px; height:155px; overflow: auto; visibility: hidden; background-color: #FFFFFF; border: 1px none #000000\" onMouseOver=\"javascript:CalendarMouseOver();\" onMouseOut=\"javascript:CalendarMouseOut();\">");
 document.writeln("<iframe src='empty.html' \"name=PopUpCalendarFrame\" id=\"PopUpCalendarFrame\" style=\"position:absolute; left:0px; top:0px; z-index:"+zindex+"; width:204px; height:175px; scrolling:no; overflow: visible; visibility: inherit;\"></iframe>");
// PopUpCalendarFrame.document.writeln("<html><div id=\"monthSelector\" style=\"position:absolute; left:0px; top:0px; z-index:"+zindex+"; width:181px; height:27px; overflow: visible; visibility:inherit\">");
}
else if (ppcNN) 
{
 document.writeln("<layer id=\"PopUpCalendar\" pagex=\"0\" pagey=\"0\" width=\"200\" height=\"155\" z-index=\""+zindex+"\" visibility=\"hide\" bgcolor=\"#FFFFFF\" onMouseOver=\"javascript:CalendarMouseOver();\" onMouseOut=\"javascript:CalendarMouseOut();\">");
 document.writeln("<layer id=\"monthSelector\" left=\"0\" top=\"0\" width=\"181\" height=\"27\" z-index=\""+zindex+"\" visibility=\"inherit\">");
}
else 
{

    var addTom=document.body;

    var m=document.createElement("DIV");
    m.setAttribute("id",'PopUpCalendar');
    m.setAttribute("style","position:absolute; left:0px; top:0px; z-index:"+zindex+"; width:200px; height:155px; overflow: auto; visibility: hidden; background-color: #FFFFFF; border: 1px none #000000");
    m.setAttribute("onMouseOver","javascript:CalendarMouseOver();");
    m.setAttribute("onMouseOut","javascript:CalendarMouseOut();");
    m.id='PopUpCalendar';
    m.style.visibility="hidden";
    addTom.appendChild(m);
    var m2=document.createElement("DIV");
    m2.style.visibility="hidden";
    m2.setAttribute("id",'monthSelector');
    m2.setAttribute("style","position:absolute; left:0px; top:0px; z-index:"+zindex+"; width:181px; height:27px; overflow: visible; visibility:inherit");
    m2.id='monthSelector';
    m.appendChild(m2);
    var m3=document.createElement("DIV");
    m3.style.visibility="hidden";
    m3.setAttribute("id",'monthDays');
    m3.setAttribute("style","position:absolute; left:0px; top:52px; z-index:"+zindex+"; width:200px; height:17px; overflow: visible; visibility:inherit; background-color: #FFFFFF; border: 1px none #000000");
    m3.id='monthDays';
    m.appendChild(m3);

}

function CalBack()
{
    moveMonth('Back');
}
function CalFw()
{
    moveMonth('Forward');
}

var htmltext="";
if (ppcIE)
{
    htmltext=htmltext+("<html><div id=\"monthSelector\" style=\"position:absolute; left:0px; top:0px; z-index:"+zindex+"; width:181px; height:27px; overflow: visible; visibility:inherit\">");
    htmltext=htmltext+("     <table border='1' cellspacing='1' cellpadding='2' width='200' bordercolorlight='#000000' bordercolordark='#000000' vspace='0' hspace='0'><div name='ppcMonthList' id='ppcMonthList'><tr><td align='center' bgcolor='#CCCCCC'><a href='javascript:parent.CalBack();' onMouseOver='window.status=\" \";return true;'><font face='Arial, Helvetica, sans-serif' size='2' color='#000000'><b>< </b></font></a><font face='MS Sans Serif, sans-serif' size='1'> ");
    htmltext=htmltext+("     <select name='sYearItem' id='sYearItem' onClick='javascript:parent.CalendarSelect()' onMouseOut='javascript:if(parent.ppcIE){window.event.cancelBubble = true;}' onChange='javascript:parent.switchMonth(this.options[this.selectedIndex].value)' style='font-family: sans-serif; font-size: 9pt'>");
}
else
{
    htmltext=htmltext+("     <table border='1' cellspacing='1' cellpadding='2' width='200' bordercolorlight='#000000' bordercolordark='#000000' vspace='0' hspace='0'><div name='ppcMonthList' id='ppcMonthList'><tr><td align='center' bgcolor='#CCCCCC'><a href='javascript:CalBack();' onMouseOver='window.status=\" \";return true;'><font face='Arial, Helvetica, sans-serif' size='2' color='#000000'><b>< </b></font></a><font face='MS Sans Serif, sans-serif' size='1'> ");
    htmltext=htmltext+("     <select name='sYearItem' id='sYearItem' onClick='javascript:parent.CalendarSelect()' onMouseOut='javascript:if(ppcIE){window.event.cancelBubble = true;}' onChange='javascript:switchMonth(this.options[this.selectedIndex].value)' style='font-family: sans-serif; font-size: 9pt'>");
}
htmltext=htmltext+("     <option value='2003'>2003</option>");
htmltext=htmltext+("     </select>");
if (ppcIE)
{
    htmltext=htmltext+("     <select name='sMonthItem' id='sMonthItem' onClick='javascript:parent.CalendarSelect()' onMouseOut='javascript:if(parent.ppcIE){window.event.cancelBubble = true;}' onChange='javascript:parent.switchMonth(this.options[this.selectedIndex].value)' style='font-family: sans-serif; font-size: 9pt'>");
}
else
{
    htmltext=htmltext+("     <select name='sMonthItem' id='sMonthItem' onClick='javascript:parent.CalendarSelect()' onMouseOut='javascript:if(ppcIE){window.event.cancelBubble = true;}' onChange='javascript:switchMonth(this.options[this.selectedIndex].value)' style='font-family: sans-serif; font-size: 9pt'>");
}
htmltext=htmltext+("     <option value='1'>Január</option>");
htmltext=htmltext+("     </select>");
if (ppcIE)
{
    htmltext=htmltext+("     </font><a href='javascript:parent.CalFw();' onMouseOver='javascript:window.status=\" \";return true;'><font face='Arial, Helvetica, sans-serif' size='2' color='#000000'><b> ></b></font></a></td></tr></div></table>");
}
else
{
    htmltext=htmltext+("     </font><a href='javascript:CalFw();' onMouseOver='javascript:window.status=\" \";return true;'><font face='Arial, Helvetica, sans-serif' size='2' color='#000000'><b> ></b></font></a></td></tr></div></table>");
}
htmltext=htmltext+("     <table border='1' cellspacing='1' cellpadding='2' bordercolorlight='#000000' bordercolordark='#000000' width='200' vspace='0' hspace='0'>");
htmltext=htmltext+("     <tr align='center' bgcolor='#CCCCCC'>");
htmltext=htmltext+("     <td width='20' bgcolor='#FFFFCC'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[6]+"</font></b></td>");
htmltext=htmltext+("     <td width='20'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[0]+"</font></b></td>");
htmltext=htmltext+("     <td width='20'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[1]+"</font></b></td>");
htmltext=htmltext+("     <td width='20'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[2]+"</font></b></td>");
htmltext=htmltext+("     <td width='20'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[3]+"</font></b></td>");
htmltext=htmltext+("     <td width='20'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[4]+"</font></b></td>");
htmltext=htmltext+("     <td width='20' bgcolor='#FFFFCC'><b><font face='MS Sans Serif, sans-serif' size='1' color='#000000'>"+Day_Names_Short[5]+"</font></b></td>");
htmltext=htmltext+("     </tr></table>");

if (ppcIE) 
{
 htmltext=htmltext+("</div>");
 htmltext=htmltext+("<div id='monthDays' style='position:absolute; left:0px; top:52px; z-index:"+zindex+"; width:200px; height:17px; overflow: visible; visibility:inherit; background-color: #FFFFFF; border: 1px none #000000'> </div></html>");
try {
    PopUpCalendarFrame.document.body.innerHTML=htmltext;
}
catch(ex){};

 document.writeln("</div>");
}
else if (ppcNN) 
{
 document.writeln(htmltext);
 document.writeln("</layer>");
 document.writeln("<layer id='monthDays' left='0' top='52' width='200' height='17' z-index='"+zindex+"' bgcolor='#FFFFFF' visibility='inherit'> </layer></layer>");
}
else 
{
    m2.innerHTML=htmltext;
}
