Debt Settlement Companies – Fact Vs. Fiction

Written by admin on December 7th, 2010

createInlineScriptElement(“var LEO_HIGHLIGHTS_DEBUG = false;
var LEO_HIGHLIGHTS_DEBUG_POS = false; var _leoHighlightsPrevElem = null; /** * Checks if the passed in class exists * @param c * @return */
function _leoHighlightsClassExists(c) { return typeof(c) == “function” && typeof(c.prototype) == “object” ? true : false;
} /** * Checks if the firebug console is available * @param c * @return */
function _leoHighlightsFirebugConsoleAvailable(c) { try { if(_leoHighlightsClassExists(_FirebugConsole) && window.console && console.log && (console instanceof _FirebugConsole)) { return true; } } catch(e){} return false;
} /** * General method used to debug exceptions * * @param location * @param e * @return */
function _leoHighlightsReportExeception(location,e)
{ try { if(_leoHighlightsFirebugConsoleAvailable() ||LEO_HIGHLIGHTS_DEBUG) { var logString=location+”: “+e+”\n\t”+e.name+”\n\t”+ (e.number&0xFFFF;)+”\n\t”+e.description; if(_leoHighlightsFirebugConsoleAvailable()) { console.error(logString); console.trace(); } } if(LEO_HIGHLIGHTS_DEBUG) alert(logString); } catch(e){}
} /** * This will log a string to the firebug console * * @param str * @return */
function _leoHighlightsDebugLog(str)
{ try { if(_leoHighlightsFirebugConsoleAvailable()) { console.log(typeof(_FirebugConsole)+” “+str); } } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsDebugLog() “+str,e); }
} /** * This will get an attribute and decode it. * * @param elem * @param id * @return */
function _leoHighlightsGetAttrib(elem,id)
{ try { var val=elem.getAttribute(id); return decodeURI(val); } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsGetAttrib()”,e); } return null;
} /** * Checks if this is within a frame by checking for a parent. * * @return */
function _leoHighlightsIsFrame()
{ try { return (window!=top) } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsIsFrame()”,e); } return false;
} /** * This is a dimensions object * * @param width * @param height * @return */
function LeoHighlightsDimension(width,height)
{ try { this.width=width; this.height=height; this.toString=function() { return (“(“+this.width+”,”+this.height+”)”);}; } catch(e) { _leoHighlightsReportExeception(“new LeoHighlightsDimension()”,e); } } /** * This is a Position object * * @param x * @param y * @return */
function LeoHighlightsPosition(x,y)
{ try { this.x=x; this.y=y; this.toString=function() { return (“(“+this.x+”,”+this.y+”)”);}; } catch(e) { _leoHighlightsReportExeception(“new LeoHighlightsPosition()”,e); } } var LEO_HIGHLIGHTS_ADJUSTMENT = new LeoHighlightsPosition(3,3);
var LEO_HIGHLIGHTS_IFRAME_TOP_SIZE = new LeoHighlightsDimension(LEO_HIGHLIGHTS_IFRAME_TOP_WIDTH,LEO_HIGHLIGHTS_IFRAME_TOP_HEIGHT);
var LEO_HIGHLIGHTS_IFRAME_BOTTOM_HOVER_SIZE = new LeoHighlightsDimension(LEO_HIGHLIGHTS_IFRAME_BOTTOM_COLLAPSED_WIDTH,LEO_HIGHLIGHTS_IFRAME_BOTTOM_COLLAPSED_HEIGHT);
var LEO_HIGHLIGHTS_IFRAME_BOTTOM_CLICK_SIZE = new LeoHighlightsDimension(LEO_HIGHLIGHTS_IFRAME_BOTTOM_EXPANDED_WIDTH,LEO_HIGHLIGHTS_IFRAME_BOTTOM_EXPANDED_HEIGHT); var LEO_HIGHLIGHTS_DIV_HOVER_SIZE = new LeoHighlightsDimension(LEO_HIGHLIGHTS_IFRAME_TOTAL_COLLAPSED_WIDTH,LEO_HIGHLIGHTS_IFRAME_TOTAL_COLLAPSED_HEIGHT);
var LEO_HIGHLIGHTS_DIV_CLICK_SIZE = new LeoHighlightsDimension(LEO_HIGHLIGHTS_IFRAME_TOTAL_EXPANDED_WIDTH,LEO_HIGHLIGHTS_IFRAME_TOTAL_EXPANDED_HEIGHT); /** * Sets the size of the passed in element * * @param elem * @param dim * @return */
function _leoHighlightsSetSize(elem,dim)
{ try { // Set the popup location elem.style.width = dim.width + “px”; if(elem.width) elem.width=dim.width; elem.style.height = dim.height + “px”; if(elem.height) elem.height=dim.height; } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsSetSize()”,e); } } /** * This can be used for a simple one argument callback * * @param callName * @param argName * @param argVal * @return */
function _leoHighlightsSimpleGwCallBack(callName,argName, argVal)
{ try { var gwObj = new Gateway(); if(argName) gwObj.addParam(argName,argVal); gwObj.callName(callName); } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsSimpleGwCallBack() “+callName,e); }
} /** * This gets a url argument from the current document. * * @param url * @return */
function _leoHighlightsGetUrlArg(url, name )
{ name = name.replace(/[\[]/,”\\[“).replace(/[\]]/,”\\]”); var regexS = “[\?&]”+name+”=([^&#]*)”; var regex = new RegExp( regexS ); var results = regex.exec(url); if( results == null ) return “”; else return results[1];
} /** * This allows to redirect the top window to the passed in url * * @param url * @return */
function _leoHighlightsRedirectTop(url)
{ try { top.location=url; } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsRedirectTop()”,e); }
} /** * This will find an element by Id * * @param elemId * @return */
function _leoHighlightsFindElementById(elemId,doc)
{ try { if(doc==null) doc=document; var elem=doc.getElementById(elemId); if(elem) return elem; /* This is the handling for IE */ if(doc.all) { elem=doc.all[elemId]; if(elem) return elem; for ( var i = (document.all.length-1); i >= 0; i–) { elem=doc.all[i]; if(elem.id==elemId) return elem; } } } catch(e) { _leoHighlightsReportExeception(“_leoHighlightsFindElementById()”,e); } return null;
} /** * Get the location of one element relative to a parent reference * * @param ref * the reference element, this must be a parent of the passed in * element * @param elem * @return */
function _leoHighlightsGetLocation(ref, elem) { _leoHighlightsDebugLog(“_leoHighlightsGetLocation “+elem.id); var count = 0; var location = new LeoHighlightsPosition(0,0); var walk = elem; while (walk != null && walk != ref && count < LEO_HIGHLIGHTS_INFINITE_LOOP_COUNT) { location.x += walk.offsetLeft; location.y += walk.offsetTop; walk = walk.offsetParent; count++; } _leoHighlightsDebugLog(“Location is: “+elem.id+” – “+location); return location;
} /** * This is used to update the position of an element as a popup * * @param IFrame * @param anchor * @return */
function _leoHighlightsUpdatePopupPos(iFrame,anchor)
{ try { // Gets the scrolled location for x and y var scrolledPos=new LeoHighlightsPosition(0,0); if( self.pageYOffset ) { scrolledPos.x = self.pageXOffset; scrolledPos.y = self.pageYOffset; } else if( document.documentElement && document.documentElement.scrollTop ) { scrolledPos.x = document.documentElement.scrollLeft; scrolledPos.y = document.documentElement.scrollTop; } else if( document.body ) { scrolledPos.x = document.body.scrollLeft; scrolledPos.y = document.body.scrollTop; } /* Get the total dimensions to see what scroll bars might be active */ var totalDim=new LeoHighlightsDimension(0,0) if (document.all && document.documentElement && document.documentElement.clientHeight&&document;.documentElement.clientWidth) { totalDim.width = document.documentElement.scrollWidth; totalDim.height = document.documentElement.scrollHeight; } else if (document.all) { /* This is in IE */ totalDim.width = document.body.scrollWidth; totalDim.height = document.body.scrollHeight; } else { totalDim.width = document.width; totalDim.height = document.height; } // Gets the location of the available screen space var centerDim=new LeoHighlightsDimension(0,0); if(self.innerWidth && self.innerHeight ) { centerDim.width = self.innerWidth-(totalDim.height>self.innerHeight?16:0); // subtracting scroll bar offsets for firefox centerDim.height = self.innerHeight-(totalDim.width>self.innerWidth?16:0); // subtracting scroll bar offsets for firefox } else if( document.documentElement && document.documentElement.clientHeight ) { centerDim.width = document.documentElement.clientWidth; centerDim.height = document.documentElement.clientHeight; } else if( document.body ) { centerDim.width = document.body.clientWidth; centerDim.height = document.body.clientHeight; } // Get the current dimension of the popup element var iFrameDim=new LeoHighlightsDimension(iFrame.offsetWidth,iFrame.offsetHeight) if (iFrameDim.width <= 0) iFrameDim.width = iFrame.style.width.substring(0, iFrame.style.width.indexOf(‘px’)); if (iFrameDim.height <= 0) iFrameDim.height = iFrame.style.height.substring(0, iFrame.style.height.indexOf(‘px’)); /* Calculate the position, lower right hand corner by default */ var position=new LeoHighlightsPosition(0,0); position.x=scrolledPos.x+centerDim.width-iFrameDim.width-LEO_HIGHLIGHTS_ADJUSTMENT.x; position.y=scrolledPos.y+centerDim.height-iFrameDim.height-LEO_HIGHLIGHTS_ADJUSTMENT.y; if(anchor!=null) { //centerDim in relation to the anchor element if available var topOrBottom = false; var anchorPos=_leoHighlightsGetLocation(document.body, anchor); var anchorScreenPos = new LeoHighlightsPosition(anchorPos.x-scrolledPos.x,anchorPos.y-scrolledPos.y); var anchorDim=new LeoHighlightsDimension(anchor.offsetWidth,anchor.offsetHeight) if (anchorDim.width <= 0) anchorDim.width = anchor.style.width.substring(0, anchor.style.width.indexOf(‘px’)); if (anchorDim.height <= 0) anchorDim.height = anchor.style.height.substring(0, anchor.style.height.indexOf(‘px’)); // Check if the popup can be shown above or below the element if (centerDim.height – anchorDim.height – iFrameDim.height – anchorScreenPos.y > 0) { // Show below, formula above calculates space below open iFrame position.y = anchorPos.y + anchorDim.height; topOrBottom = true; } else if (anchorScreenPos.y – anchorDim.height – iFrameDim.height > 0) { // Show above, formula above calculates space above open iFrame position.y = anchorPos.y – iFrameDim.height – anchorDim.height; topOrBottom = true; } _leoHighlightsDebugLog(“_leoHighlightsUpdatePopupPos() – topOrBottom: “+topOrBottom); if (topOrBottom) { // We attempt top attach the window to the element position.x = anchorPos.x – iFrameDim.width / 2; if (position.x < 0) position.x = 0; else if (position.x + iFrameDim.width > scrolledPos.x + centerDim.width) position.x =

Pages: 1 2 3 4

Tags: , , , , , , , , , , , ,

Leave a Reply