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 */
} /** * 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; 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) 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
welcome to Insurances.net (https://www.insurances.net)