function getById(id) { if (document.getElementById) var returnVar = document.getElementById(id); else if (document.all) var returnVar = document.all[id]; else if (document.layers) var returnVar = document.layers[id]; return returnVar; } function getSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return [myWidth,myHeight]; } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } window.alert( 'Horizontal scrolling = ' + scrOfX + '\nVertical scrolling = ' + scrOfY ); } function daysInMonth(month,year) { var m = [31,28,31,30,31,30,31,31,30,31,30,31]; if (month != 2) return m[month - 1]; if (year%4 != 0) return m[1]; if (year%100 == 0 && year%400 != 0) return m[1]; return m[1] + 1; } function rebuild_date_select(name_rok,name_dzien,name_mc) { var month=daysInMonth(getById(String(name_mc)).value,getById(String(name_rok)).value); var days=getById(String(name_dzien)); var old_d=days.selectedIndex; if(days.childNodes.length!=month) { while (days.firstChild)days.removeChild(days.firstChild); for(var i=1;i<=month;i++) { days.options.add(new Option(i,i)); } } try { days.selectedIndex=old_d; }catch(err) { } } function tabbed_menu(name,index,max) { for(var i=1;i<=max;i++) { if(i!=index) { getById(name+String(i)).className="krok_off"; getById("div_"+name+String(i)).style.display="none"; } else { getById(name+String(i)).className="krok_on"; getById("div_"+name+String(i)).style.display="block"; } } }