var now

var second
var minute
var hour

var degreeSecond
var degreeMinute
var degreeHour

var timer
var stepDegree=6
var stepDegreeHour=30

function checkTime() {
	if (document.all) {
		now=new Date()
		second=now.getSeconds()
		minute=now.getMinutes()
		hour=now.getHours()
		if (hour>=12) {hour=hour-12}
		spinIt()
		timer=setTimeout("checkTime()",200)
	}
}

function spinIt() {
	//window.status=hour
	secondObj.SetIdentity()
	minuteObj.SetIdentity()
	hourObj.SetIdentity()
	
	degreeSecond=180+stepDegree*second
	degreeMinute=180+stepDegree*minute
	degreeHour=180+stepDegreeHour*hour+(Math.floor(stepDegree*minute/12))
	
	secondObj.Rotate(0,0,degreeSecond)
	minuteObj.Rotate(0,0,degreeMinute)
	hourObj.Rotate(0,0,degreeHour)
}


function Ulubione()
{
var url="http://www.czestochowa.wita.pl";
var title=" --= Portal miejski CZĘSTOCHOWA =--";
 
 window.external.AddFavorite(url,title);
}


function OpenWindow(theURL,winName,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
  window.open(theURL,winName,settings);
}

function OpenFormatWindow(theURL,winName,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
pop = window.open(theURL,winName,settings);
pop.document.write('<title>GALERIA</title><body bgcolor="white" topmargin="0" leftmargin="0">');
pop.document.write('<a href="javascript:window.close();"><img src="'+theURL+'" alt="Zamknij okno" border=0></a>');
pop.document.write('</body>');
}


