	// Global variables
	var moveReady = false;
	var activeDiv = null;
	var activeDivColor = null;
	
	var allDivs = new Array('local', 'sports', 'finance', 'news', 'development', 'privateHP', 'stuff', 'myBV', 'temp', 'BVSites', 'search');
	
	function clock(){
		var dayArray = new Array("Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai", "Sunnuntai");
		var timeNow = new Date();
		hour = timeNow.getHours().toString();
		minute = timeNow.getMinutes().toString();
		second = timeNow.getSeconds().toString();
		showClock.innerHTML = "&nbsp;&nbsp;" + dayArray[timeNow.getDay()-1] + "&nbsp;" + timeNow.getDate() + "/" + (timeNow.getMonth()+1) + "<br>&nbsp;&nbsp;" + ((hour.length == 1) ? "0" + hour : hour) + ":" + ((minute.length == 1) ? "0" + minute : minute) + ":" + ((second.length == 1) ? "0" + second : second) + "&nbsp;&nbsp;";
		setTimeout("clock()", 1000)
	}
	
	function showClick(showORhide){
		clickDiv.style.visibility = ((showORhide) ? "visible" : "hidden");
		//changeBG(false);
	}
	
	function mousePos(divText){
		if (!moveReady){
			clickDiv.style.top = parseInt(event.y) + 3;
			clickDiv.style.left = parseInt(event.x) + 12;
			clickDiv.style.visibility = "visible";
			message.innerHTML = divText;
		}
	}


// MOVE DIV FUNCTIONS
	function _moveSomeDiv(divName, eX, eY) {
		if (moveReady == true) {
			eval(divName + 'Div.style.left = parseInt(event.x) - 120');
			eval(divName + 'Div.style.top = parseInt(event.y) - 23');
		}
	}
	
	function setMoveReady(divName){
		if (!moveReady && !activeDiv) {
			moveReady = true;
			activeDivColor = eval(divName + 'Table.bgColor');
			eval(divName + 'Table.bgColor = "OrangeRed"');
			activeDiv = divName;
		} else {
			moveReady = false;
			if (activeDivColor)
				eval(divName + 'Table.bgColor = "' + activeDivColor + '"');
			else
				eval(divName + 'Table.bgColor = "DarkGreen"');
			activeDiv = null;
			activeDivColor = null;
		}
		
		setCurrentDivToActive(divName);
	}

	function restoreMoveReady(){
		if (moveReady && activeDiv) {
			_moveSomeDiv(activeDiv);
		}
	}
	
	function setCurrentDivToActive(divName){
		for (i=0; i < allDivs.length; i++){
			if (allDivs[i] == divName)
				eval(allDivs[i] + 'Div.style.zIndex = 99');
			else
				eval(allDivs[i] + 'Div.style.zIndex = 0');
		}
	}

	function goSomewhere(){
		goTo = Math.round(Math.random() * document.links.length);
		//location.href = document.links[0].href;
		document.links[goTo].click();
	}

	function openWindow(url){
		screen.height
		screen.width
		open(url,"","");
	}
