/** * POPUP WINDOW CODE v1.3 * Used for displaying DHTML only popups instead of using buggy modal windows. * * By Seth Banks (webmaster at subimage dot com) * http://www.subimage.com/ * * Contributions by: * Eric Angel - tab index code * Scott - hiding/showing selects for IE users * Todd Huss - inserting modal dynamically and anchor classes * * Up to date code can be found at http://www.subimage.com/dhtml/subModal * * * This code is free for you to use anywhere, just keep this comment block. */ // src var src = '/portal/resources/subModal'; // Popup code var gPopupMask = null; var gPopupContainer = null; var gPopFrame = null; var gReturnFunc; var gPopupIsShown = false; var gHideSelects = false; var gHideFlashDivs = true; var gTabIndexes = new Array(); // Pre-defined list of tags we want to disable/enable tabbing into var gTabbableTags = new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME"); // If using Mozilla or Firefox, use Tab-key trap. if (!document.all) { document.onkeypress = keyDownHandler; } /** * Initializes popup code on load. */ function initPopUp() { // Add the HTML to the body theBody = document.getElementsByTagName('BODY')[0]; popmask = document.createElement('div'); popmask.id = 'popupMask'; popcont = document.createElement('div'); popcont.id = 'popupContainer'; popcont.innerHTML = '' + '
' + '
' + '
  Yo soy Telcel
' + '
' + '' + '
' + '
' + '' + '
'; theBody.appendChild(popmask); theBody.appendChild(popcont); gPopupMask = document.getElementById("popupMask"); gPopupContainer = document.getElementById("popupContainer"); gPopFrame = document.getElementById("popupFrame"); // check to see if this is IE version 6 or lower. hide select boxes if so // maybe they'll fix this in version 7? var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) { gHideSelects = true; } // Add onclick handlers to 'a' elements of class submodal or submodal-width-height var elms = document.getElementsByTagName('a'); for (i = 0; i < elms.length; i++) { if (elms[i].className.indexOf("submodal") == 0) { // var onclick = 'function (){showPopWin(\''+elms[i].href+'\','+width+', '+height+', null);return false;};'; // elms[i].onclick = eval(onclick); elms[i].onclick = function(){ // default width and height var width = 400; var height = 200; // Parse out optional width and height from className params = this.className.split('-'); if (params.length == 3) { width = parseInt(params[1]); height = parseInt(params[2]); } showPopWin(this.href,width,height,null); return false; } } } } //addEvent(window, "load", initPopUp); /** * @argument width - int in pixels * @argument height - int in pixels * @argument url - url to display * @argument returnFunc - function to call when returning true from the window. */ function showPopWin(url, width, height, returnFunc) { gPopupIsShown = true; disableTabIndexes(); gPopupMask.style.display = "block"; gPopupContainer.style.display = "block"; // calculate where to place the window on screen centerPopWin(width, height); var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); gPopupContainer.style.width = width + "px"; gPopupContainer.style.height = (height+titleBarHeight) + "px"; // need to set the width of the iframe to the title bar width because of the dropshadow // some oddness was occuring and causing the frame to poke outside the border in IE6 gPopFrame.style.width = parseInt(document.getElementById("popupTitleBar").offsetWidth, 10) + "px"; gPopFrame.style.height = (height) + "px"; // set the url gPopFrame.src = url; gReturnFunc = returnFunc; // for IE if (gHideSelects == true) { hideSelectBoxes(); } if(gHideFlashDivs == true){ hideFlashDivs(); } var oInp = document.getElementsByTagName('select'); for(var i=0;i