
function popupnr(mylink, windowname, refocus) {

	var mywin, href;

	if (typeof(mylink) == 'string')
		href = mylink;
	else
		href = mylink.href;

	mywin = window.open('', windowname, 'width=800,height=520,toolbar=0,scrollbars=0,screenX=200,screenY=200,left=200,top=200');

	// if we just opened the window
	if (mywin.closed || (! mywin.document.URL) || (mywin.document.URL.indexOf("about") == 0))
		mywin.location = href;
	else
	if (refocus)
		mywin.focus();

	return false;

} // end popupnr



function toSt(n) {
	
	s=""
	
	if (n < 10) {
		s += "0"
	} //end if

	return s + n.toString();

} // end toSt

function countdown() {

	if (!document.all&&!document.getElementById) {
		return;
	} 

	thelement=document.getElementById? document.getElementById("clock"): document.all.clock;

	var cl = document.clock;
	var d = new Date();
	var msec = d.getMilliseconds();

	if ((msec < 100) & (msec >= 10)) {
		msec = "0" + msec;
	} // end if
	else
	if (msec < 10) {
		msec = "00" + msec;
	} // end if

	hours = d.getHours();
	mins = d.getMinutes();
	secs = d.getSeconds();

	if (hours > 12) {
		hours = hours - 12;
	} // end if

	if (mins < 10) {
		mins = '0' + mins;
	} // end if

	if (secs < 10) {
		secs = '0' + secs;
	} // end if

	thelement.innerHTML = "<font color=#FFCC00><b>+" + hours + ":" + mins + ":" + secs + "." + msec + "</b></font>";

	setTimeout("countdown()",100);

} // end countdown



$( document ).ready( function () {
	
	// countdown timer
	countdown();

	// cluetip
	$('a.tips').cluetip({width: '560px', dropShadow: false, hoverIntent: true, tracking: false, sticky: true, closePosition: 'title', closeText: '<img src="js/cluetip/cross.png" alt="" />', mouseOutClose: true, arrows: true});
	$('a.tips2').cluetip({width: '450px', dropShadow: false, hoverIntent: true, tracking: false, arrows: true});

});
