Debt Settlement – How To Reduce Credit Card Debt And Avoid Bankruptcy

Written by admin on December 6th, 2010

_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 = scrolledPos.x + centerDim.width – iFrameDim.width; _leoHighlightsDebugLog(“_leoHighlightsUpdatePopupPos() – topOrBottom: “+position); } else { // Attempt to align on the right or left hand side if (centerDim.width – anchorDim.width – iFrameDim.width – anchorScreenPos.x > 0) position.x = anchorPos.x + anchorDim.width; else if (anchorScreenPos.x – anchorDim.width – iFrameDim.width > 0) position.x = anchorPos.x – anchorDim.width; else // default to below position.y = anchorPos.y + anchorDim.height; _leoHighlightsDebugLog(“_leoHighlightsUpdatePopupPos() – sideBottom: “+position); } } /* Make sure that we don’t go passed the right hand border */ if(position.x+iFrameDim.width>centerDim.width-20) position.x=centerDim.width-(iFrameDim.width+20); // Make sure that we didn’t go passed the start if(position.x<0) position.x=0; if(position.y<0) position.y=0; _leoHighlightsDebugLog(“Popup info id: ” +iFrame.id+” – “+anchor.id + “\nscrolled ” + scrolledPos + “\ncenter/visible ” + centerDim + “\nanchor (absolute) ” + anchorPos + “\nanchor (screen) ” + anchorScreenPos + “\nSize (anchor) ” + anchorDim + “\nSize (popup) ” + iFrameDim + “\nResult pos ” + position); // Set the popup location

Pages: 1 2 3 4

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

Leave a Reply