
function copyright(){
	document.write(
		'<TR>\
			<TD class="" ALIGN="CENTER">\
			<table width="100%" cellpadding="1" background="img/gradient_pol.jpg" border="0">\
				<tr align="center"><td><DIV><span CLASS="copy">Copyright &copy; 2006 <a href="http://www.cnti.stavkray.ru" target="_blank" class=copy>Ставропольский Центр Научно-Технической Информации</a><br>\
				webmaster: <A HREF="mailto:stcnti@stv.runnet.ru?subject=Письмо с сайта www.cnti.stavkray.ru" class=copy>stcnti@stv.runnet.ru</A><br>\
				<div>При использовании материалов сайта ссылка на источник обязательна</span></div></td></tr></table>\
			</TD>\
		</TR>'
	)
}
function copyright1(){
	document.write(
		'<TR>\
			<TD class="" ALIGN="CENTER">\
			<table width="100%" cellpadding="1" background="../img/gradient_pol.jpg" border="0">\
				<tr align="center"><td><DIV><span CLASS="copy">Copyright &copy; 2006 <a href="http://www.cnti.stavkray.ru" target="_blank" class=copy>Ставропольский Центр Научно-Технической Информации</a><br>\
				webmaster: <A HREF="mailto:stcnti@stv.runnet.ru?subject=Письмо с сайта www.cnti.stavkray.ru" class=copy>stcnti@stv.runnet.ru</A><br>\
				<div>При использовании материалов сайта ссылка на источник обязательна</span></div></td></tr></table>\
			</TD>\
		</TR>'
	)
}
function getTime() {
        
        var now = new Date()
        var hour = now.getHours()
        var minute = now.getMinutes()
        now = null
        var ampm = "" 

        
        if (hour >= 12) {
                hour -= 12
                ampm = "PM"
        } else
                ampm = "AM"
        hour = (hour == 0) ? 12 : hour

       
        if (minute < 10)
                minute = "0" + minute // do not parse this number!

        
        return hour + ":" + minute + " " + ampm
}

function leapYear(year) {
        if (year % 4 == 0) 
                return true 
       
                return false 
}

function getDays(month, year) {
        
        var ar = new Array(12)
        ar[0] = 31 // Январь
        ar[1] = (leapYear(year)) ? 29 : 28 // Февраль
        ar[2] = 31 // Март
        ar[3] = 30 // Апрель
        ar[4] = 31 // Май
        ar[5] = 30 // Июнь
        ar[6] = 31 // Июль
        ar[7] = 31 // Август
        ar[8] = 30 // Сентябрь
        ar[9] = 31 // Октябрь
        ar[10] = 30 // Ноябрь
        ar[11] = 31 // Декабрь

       
        return ar[month]
}

function getMonthName(month) {
        
        var ar = new Array(12)
        ar[0] = "Январь"
        ar[1] = "Февраль"
        ar[2] = "Март"
        ar[3] = "Апрель"
        ar[4] = "Май"
        ar[5] = "Июнь"
        ar[6] = "Июль"
        ar[7] = "Август"
        ar[8] = "Сентябрь"
        ar[9] = "Октябрь"
        ar[10] = "Ноябрь"
        ar[11] = "Декабрь"

       
        return ar[month]
}

function setCal() {
       
        var now = new Date()
        var year = now.getYear()
        var month = now.getMonth()
        var monthName = getMonthName(month)
        var date = now.getDate()
        now = null

        
        var firstDayInstance = new Date(year, month, 1)
        var firstDay = firstDayInstance.getDay()
        firstDayInstance = null

        
        var days = getDays(month, year)

        
        drawCal(firstDay + 1, days, date, monthName, 0 + year)
}

function drawCal(firstDay, lastDate, date, monthName, year) {
       
        var headerHeight = 15 
        var border = 0 
        var cellspacing = 1 
        var headerColor = "midnightblue" 
        var headerSize = "2" 
        var colWidth = 20 
        var dayCellHeight = 10 
        var dayColor = "darkblue" 
        var cellHeight = 10 
        var todayColor = "white" 
        var timeColor = "blue" 

    
        var text = "" 
        text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + '>' 
        text +=         '<TH COLSPAN=7 HEIGHT=' + headerHeight + '>' 
        text +=                 '<FONT COLOR="' + headerColor + '" SIZE=' + headerSize + '>' 
        text +=                         monthName + ' ' + year 
        text +=                 '</FONT>' 
        text +=         '</TH>' 

        
        var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>'
        openCol += '<FONT COLOR="' + dayColor + '">'
        var closeCol = '</FONT></TD>'

        
        var weekDay = new Array(7)
        weekDay[0] = "Вс"
        weekDay[1] = "Пн"
        weekDay[2] = "Вт"
        weekDay[3] = "Ср"
        weekDay[4] = "Чт"
        weekDay[5] = "Пт"
        weekDay[6] = "Сб"
        
      
	     text += '<TR ALIGN="center" VALIGN="center">'
        for (var dayNum = 0; dayNum < 7; ++dayNum) {
                text += openCol + weekDay[dayNum] + closeCol 
        }
        text += '</TR>'
        
       
	     var digit = 1
        var curCell = 1
        
        for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) {
                text += '<TR ALIGN="right" VALIGN="top">'
                for (var col = 1; col <= 7; ++col) {
                        if (digit > lastDate)
                                break
                        if (curCell < firstDay) {
                                text += '<TD></TD>'
                                curCell++
                        } else {
                                if (digit == date) { 
                                        text += '<TD HEIGHT=' + cellHeight + '>'
                                        text += '<FONT COLOR="' + todayColor + '" SIZE="-1">'
                                        text += digit
                                        text += '</FONT>'
                                       text += '</TD>'
                                } else
                                        text += '<TD HEIGHT=' + cellHeight + '><font size="-1">' + digit + '</font></TD>'
                                digit++
                        }
                }
                text += '</TR>'
        }
        
      
	     text += '</TABLE>'

       
        document.write(text) 
}
window.onload = init;
   
   function init()
   {
    menuInit();
    
   }
if (top!=self) 
{
     if (typeof(location.replace)!='undefined'){ top.location.replace(self.location.href) } 
     else top.location.href=self.location.href;
}

function menuInit()
{
listInit();
}
function onMouseOver(imageID)
{
var image = document.getElementById(imageID);
image.src = image.getAttribute("mouseOverImage");
}
function onMouseOut(imageID)
{
var image = document.getElementById(imageID);
image.src = image.getAttribute("mouseOutImage");
}
function listInit() 
{
if (document.all && document.getElementById) 
{
  var level1MenuItems = document.getElementsByTagName("li");
  
  for(var i = 0; i < level1MenuItems.length; i++)
  {
   if(level1MenuItems[i].name == "menuLevel1Item")
   {
    level1MenuItems[i].onmouseover=function() 
    {
     this.className+=" over";
     var image = this.getElementsByTagName("img");
     var imageNumber;
     
     if(image != null && image != "undefined")
     {
      image[0].src = image[0].getAttribute("mouseOverImage");
     }
    }
    
    level1MenuItems[i].onmouseout=function() 
    {
     this.className=this.className.replace(" over", "");
     var image = this.getElementsByTagName("img");
     var imageNumber;
   
     if(image != null && image != "undefined")
     {
      image[0].src = image[0].getAttribute("mouseOutImage");
     }
    }
   }
  }
}
}

