function getStyle(el,styleProp)
{
	var x = el
	if (x.currentStyle) {
		var y = x.currentStyle[styleProp];
	} else if (window.getComputedStyle) {
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	}
	return y;
}

function pir(selector,fontsize,fgcolor,bgcolor,width,height) {

	var elements = cssQuery(selector);
	for (i = 0; i != elements.length; i++) {
	   var e = elements[i];
	   replace(e,fontsize,fgcolor,bgcolor,width,height);
	}	
}

function pir_cleartext(selector) {

	var elements = cssQuery(selector);
	for (i = 0; i != elements.length; i++) {
	   var e = elements[i];
	   clearText(e);
	}	
}


function replace(e,fontsize,fgcolor,bgcolor,width,height) {
	  var contents = escape(e.innerHTML);
	  e.style.backgroundImage = 'url(\/system\/textimage\/frutiger?fontsize='+fontsize+'&fgcolor='+fgcolor+'&bgcolor='+bgcolor+'&width='+width+'&height='+height+'&text=' + contents + ')';
	  e.style.backgroundRepeat = 'no-repeat';
	  e.style.marginLeft = '-7px';
}

function clearText(e) {
	  e.innerHTML = '&nbsp;';
}

