<!-- Original:  Eric King (eric_andrew_king@hotmail.com) -->
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',statusbar=no,resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//  End -->



<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//  End -->



<!-- Original: wsabstract.com -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,4)=="req_") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(4,30).toUpperCase();
alert("Taisi jäädä "+shortFieldName+"-kenttä täyttämättä.");
return false;
}
else return true;
}


var state = 'none';
function showhide(layer_ref) {

	if (state == 'block') {
	state = 'none';
	}
	else {
	state = 'block';
	}
	/*if (document.all) { //IS IE 4 or 5 (or 6 beta)
	eval( "document.all." + layer_ref + ".style.display = state");
	
	
	}
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {*/
	hza = document.getElementById(layer_ref);
	hza.style.display = state;
	//}
}

//var state = 'none';
function shower(layer_ref) {

	if (state == 'block') {
	state = 'none';
	}
	else {
	state = 'block';
	}
	/*
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
	eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
	document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {*/
	hza = document.getElementById(layer_ref);
	hza.style.display = state;
	$(hza).appear();
	//}
}


/*
   Event.observe(document, 'dom:loaded', function() {
          myCustomLL = new JS_BRAMUS.lazierLoad({treshold : 150, extensions : ['jpg','jpeg'], replaceImage : "/imgs/lataa.gif", loadingImage : "/imgs/loading.gif", minWidth : 200,  minHeight : 200}); // Override all options.

      }, false);*/
   


	  
function showStuff(layer_ref,content,cookieval) {
//alert('pillu');
hza = document.getElementById(layer_ref);	
	//hza.style.display = state;
	//document.getElementById(layer_ref)
	//$('layer_ref').innerHTML = 'w0q'; 
	if(hza.innerHTML != '') hza.innerHTML = ''; 
	else hza.innerHTML = content;
	//if(cookieval == 1) startLoading();
//name = showStuff;|| GetCookie("showStuff") != cookieval
	if(GetStuffCookie("showStuff") == '' ){
	SetStuffCookie("showStuff",cookieval);
	}
}



//http://javascript.internet.com/cookies/cookie-redirect.html
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function getStuffCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}


function GetStuffCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getStuffCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}


function SetStuffCookie(name, value) {
var argv = SetStuffCookie.arguments;
var argc = SetStuffCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
//var path = (argc > 3) ? argv[3] : null;
var path = '/';
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function DeleteStuffCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetStuffCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


function clearHakuField(){	
	if(document.blok_haku.query.value == 'etsi...') document.blok_haku.query.value = '';	
	//else alert("hah:" + document.blok_haku.query.value);
}


function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
	thisfield.value = "";
	}
}
function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
	thisfield.value = defaulttext;
	}
}

// -->
