
if(document.getElementById) {
	
	/*
	document.write('<style type="text/css">');

	document.write('div.yahoo {');
	
	document.write('  background-color: transparent;');
	if(navigator.appName.indexOf("Explorer") != -1) {
		//document.write('  background-image: none;');
		document.write('  filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/images/tbg32.png\',sizingMethod=\'scale\')"');
	} else {
		document.write('  background-image: url(/images/tbg32.png);');
	}
	
	document.write('}');

	document.write('</style>');
	*/
}

function openForm(url, nimi) {
	url = url.replace(/&amp;/,"&");
	var handle = window.open(url, nimi, "width=750,height=450,resizable=no,toolbar=no,status=no,location=no,titlebar=no");
	if (!handle.opener) handle.opener = self;
	childHandle = handle;
	handle.focus();
	return false;
}

function openResizableForm(url, nimi) {
	var handle = window.open(url, nimi, "width=750,height=450,resizable=yes,toolbar=no,status=no,location=no,titlebar=no");
	if (!handle.opener) handle.opener = self;
	childHandle = handle;
	handle.focus();
	return false;
}

function show(id) {

	var yOffset = 13;

	if(navigator.appName.indexOf("Opera") != -1)
		yOffset = 12;
	else if(navigator.product == "Gecko")
		yOffset = 12;
		
	if (document.getElementById) {

		var x             = 0;
		var y             = 0;
		var o             = document.getElementById('PDIV' + id);
		var tempElementti = o.offsetParent;
		x                 = o.offsetLeft;
		

		while (tempElementti != null) {
			x             += tempElementti.offsetLeft;
			tempElementti  = tempElementti.offsetParent;
		} 

		y             = o.offsetTop;
		tempElementti = o.offsetParent;
		
		while (tempElementti != null) {
			y             += tempElementti.offsetTop;
			tempElementti  = tempElementti.offsetParent;
		}
	
		var elementti = document.getElementById('C' + id);
		
		if(elementti) {
			elementti.style.visibility = "visible";
			elementti.style.left       = (x + 18);
			elementti.style.top        = (y + yOffset);
		}
			
	} else if (document.all) {

		var x = 0;
		var y = 0;
		var o = document.all('PDIV' + id);
		x     = o.offsetLeft;
		
		tempElementti = o.offsetParent;
		
		while (tempElementti != null) {
			x             += tempElementti.offsetLeft;
			tempElementti  = tempElementti.offsetParent;
		}    
		
		y             = o.offsetTop;
		tempElementti = o.offsetParent;
		
		while (tempElementti != null) {
			y             += tempElementti.offsetTop;
			tempElementti  = tempElementti.offsetParent;
		}
		
		document.all('C' + id).style.visibility = "visible";
		document.all('C' + id).style.left       = x;
		document.all('C' + id).style.top        = (y+yOffset);

	} else if (document.layers) {

		var x  = 0;
		var y  = 0;
		
		x      = document.anchors['P' + id].x;
		y      = document.anchors['P' + id].y;
		
		document.layers['C' + id].visibility = "show";
		document.layers['C' + id].left       = x;
		document.layers['C' + id].top        = (y+yOffset);
		
	}

}
	

function hide(id) {

	if (document.getElementById) {
		elementti = document.getElementById("C" + id); 
		if(elementti)
			elementti.style.visibility = "hidden";
	}
	
	if (document.all) {
		elementti = document.all("C" + id); 
		if(elementti)
			elementti.style.visibility = "hidden";
	}
	
	if (document.layers){
		document.layers["C" + id].visibility = "hide";
	}

}

function SetImago(url) {

	if(document.getElementById && url) {

		var imagoTop    = document.getElementById("imagoTop");
		var imagoBottom = document.getElementById("imagoBottom");

		if(imagoTop && imagoTop) {
		
			var newDate   = new Date();
			var thisMonth = newDate.getMonth() + 1;
			    
			imagoTop.style["backgroundImage"]    = 'URL(' + url + '/images/imago/imagotop' + thisMonth + '.jpg)';
			imagoBottom.style["backgroundImage"] = 'URL(' + url + '/images/imago/imagobottom' + thisMonth + '.jpg)';
			
		}

	}
			
}

function openEventEdit(url, nimi) {
	var handle = window.open(url, nimi, "width=850,height=560,resizable=no,toolbar=no,status=no,location=no,titlebar=no");
	if (!handle.opener) handle.opener = self;
	childHandle = handle;
	handle.focus();
	return false;
}