function ScrollToAnchor(to)
{
   if (to!=undefined)
   { 
      destination = jQuery(to).offset().top;
      $("html").animate({ scrollTop: destination-50}, 1100 );
   }
}
function delay(time,func)
{
  setTimeout(func, time);  
}
function redirect(link)
{
  window.location = link;
}
// utility functions
function convertEntities(o) {
	var c, v;
	c = function(s) {
		if (/&[^;]+;/.test(s)) {
			var e = document.createElement("div");
			e.innerHTML = s;
			return !e.firstChild ? s : e.firstChild.nodeValue;
		}
		return s;
	}

	if ( typeof o === 'string' ) {
		return c(o);
	} else if ( typeof o === 'object' ) {
		for (v in o) {
			if ( typeof o[v] === 'string' ) {
				o[v] = c(o[v]);
			}
		}
	}
	return o;
}
function getProgress(id)
{
	return '<center><img id="'+id+'" src="'+URL_BASE+'themes/admin/images/progress-wheel.gif" /></center>';
}

