/*
  CLASS LIST:

	* LIHtmlApi
*/
/*############################################################
	Liquid Intelligence:
	 Html Api
 ############################################################*/
/*==========================
 Constructor
 ==========================*/ 
function LIHtmlApi()
{
}

/*==========================================
 Add a url to IE Favorites
 ==========================================*/
LIHtmlApi.prototype.AddFavorite = function LIHtmlApi_AddFavorite(win, url, title)
{
		if(!Application.HasStringValue(url)){url = win.location;}
		if(!Application.HasStringValue(title)){title = win.document.title;}
		win.external.AddFavorite(url, title);
}

/*==========================================
 Get first parent that contains given Attribute
 ==========================================*/
 LIHtmlApi.prototype.GetParentWithAttribute = function LIHtmlApi_GetParentWithAttribute(n_el, n_attribute)
 {
 	var el = n_el;
	while (el != null && el.getAttribute(n_attribute) == null){el = el.parentElement;} 
	return el;
 }

/*==========================================
 Get first parent of given tag
 ==========================================*/
  LIHtmlApi.prototype.GetParentWithTagName = function LIHtmlApi_GetParentWithTagName(n_el, n_tagName)
 {
 	var el = n_el;
	while (el != null && el.tagName.toUpperCase() != n_tagName.toUpperCase()){el = el.parentElement;} 
	return el;
 }
 
/*==========================================
 Check Tag Name
 Advantage...won't puke if parameters are null
 ==========================================*/
 LIHtmlApi.prototype.CheckTagName = function LIHtmlApi_CheckTagName(n_el, n_tagName)
 {
	if (n_el == null && n_tagNam == null) {return true;}
	return (n_el.tagName.toUpperCase() == n_tagName.toUpperCase());
 }
 
/*==========================================
 Cancel event
 ==========================================*/
LIHtmlApi.prototype.CancelEvent = function LIHtmlApi_CancelEvent(n_event)
{
	if ("object" == typeof(n_event) && null != n_event) {
		n_event.returnValue = false;
		n_event.cancelBubble = true;
	}
}
 
/*==========================================
 Get Real Position
 ' which = "Left" | "Top"
 ==========================================*/ 
 LIHtmlApi.prototype.GetRealPosition = function LIHtmlApi_GetRealPosition(n_el, n_which) 
 {
	var iPos = 0;
	while (n_el!=null) {
	 	iPos += n_el["offset" + n_which];
		n_el = n_el.offsetParent;
	}
	return iPos
}


/*############################################################
	Liquid Intelligence:
	 LIWebPage
 ############################################################*/
function LIWebPage(url, width, height)
{
	this.Url = url;
	this.Width = width;
	this.Height = height;
}
LIWebPage.prototype.SysName = "LIWebPage";