
function fstr(s) {
	s=s.toLowerCase();
	s=s.replace(/ +\/>/," ");
	s=s.replace(/[\r\n\t]+/g, "");
	s=s.replace(/<br( )?\/>/i,"<br>");
	return s;
}
function procato_webwidget(i) {
	eval('a = procato_'+i+';');
	url = "http://" + a["whost"] + a["wbase"] + a["wapp"] + "/?widget=" + a["id"];
	for (k in a)
	{
		url += "&u[" + k + "]="	+ encodeURIComponent(a[k]);	
	}
	var h = fstr(document.getElementById('procato'+(a['wthis'])+'container').innerHTML);
	var t = fstr('<a href="http://'+a["shost"]+a["spath"]+'">'+a["wsitetitle"]+'</a><br/><a href="http://'+a["shost"]+a["spath"]+a["wapp"]+'/">'+a["wapptitle"]+'</a>');
	if (h == t) {
		document.getElementById('procato'+(a['wthis'])+'container').innerHTML = '<iframe  id="IF' + i +'f" name="IF' + i +'f" frameborder="0"  src="'+url+'" width="'+a['width']+'" height="'+a['wheight']+'" marginheight="0" marginwidth="0" scrolling="no" style="overflow:hidden;"></iframe>';
	} else {
//		alert(h+"\n\n"+t);
	}
}
procato_webwidget(procato_webwid);

