var brN     = navigator.appName.toLowerCase();
var isIE    = (brN.indexOf("explorer") > -1) ? true : false;
var isNS    = (brN.indexOf("netscape") > -1) ? true : false;
var isOpera = (brN.indexOf("opera") > -1) ? true : false;
var isGecko = (navigator.product == "Gecko") ? true : false;
var brV     = (isIE) ? parseFloat((navigator.appVersion.split("MSIE"))[1]) : parseFloat(navigator.appVersion);
var allGoes = ((isIE || isNS || isOpera || isGecko) && brV >= 5) ? true : false;

var del     = 0;
var can     = 0;

var fO      = null;
var fOS     = null;
var fC      = 0;
var fTimer  = null;


function OPop(url, w, h, s) {
	s = (!s) ? "no" : "yes";
	if(url == "popup.php?")
		return;
	window.open( url,'popup','scrollbars=' + s + ',status=no,resizable=no,width=' + w + ',height=' + h)
}

function CDel(url, opt) {
	if(url) {
		if(confirm("Poistetaanko " + opt + "?"))
			window.location.href=url;
	}
}

function Flash() {
	fC ++;
	if(fC < 5) {
		fO.className = (fO.className == "flash") ? fOS : "flash";
		fTimer       = setTimeout("Flash(fO)", 500);
	} else {
		fO.className = fOS;
		fO           = null;
		fOS          = null;
	}
}

function SFlash(o) {
	if(allGoes && o) {
		if(o != fO) {
			if(fO) {
				clearTimeout(fTimer);
				fO.className = fOS;
			}
			fO  = o;
			fOS = o.className;
			fC  = 0;
			Flash();
		}
	}
}
