Site hosted by Angelfire.com: Build your free website today!
// // common.js // // ------------------------------------------------------------- // cross-browser helper functions // ------------------------------------------------------------- // Global variables var isCSS = false; var isW3C = false; var isIE4 = false; var isNN4 = false; var isIE6 = false; var isGecko = false; var isOpera = false; var isDHTML = false; var suppressMenus = false; var legacyMode = false; var timerID = null; var subtimerID = null; var resetmain = null; var resetsub = null; var resetmenu = null; var tempEvent = null; var lastPopup = null; var resetTime = 500; var screenWidth = null; var m_anchorClicked = false; // initialize upon load to let all browsers establish content objects function autoconfig() { if(document && document.images) { isCSS = (document.body && document.body.style) ? true : false; isW3C = (isCSS && document.getElementById) ? true : false; isIE4 = (isCSS && document.all && readIEVer() >= 4.0) ? true : false; isNN4 = (document.layers) ? true : false; isGecko = (isCSS && navigator && navigator.product && navigator.product == "Gecko"); isOpera = (isCSS && navigator.userAgent.indexOf( "Opera") != -1 ); isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false; isIE6 = ( isIE6CSS && readIEVer() >= 6.0 ); isDHTML = isCSS && ( isIE4 || isGecko || isOpera ); //screenWidth = (screen.width >= 1024 ? 952 : 728); //According to the updated Storm 4.0 SRS screenWidth = 728; if( suppressMenus ) { // Netscape 6.2 puts the menus in the wrong place... // Safari, the menus don't go away... problem in ResetMenu isDHTML = false; } else if( isOpera && readOperaVer() < 7 ) { // Opera 6.x doesn't seem to like the DHTML... isDHTML = false; } else if( isGecko && navigator.productSub <= 20011022 ) { // Netscape 6.2 puts the menus in the wrong place... isDHTML = false; } else if( isGecko && navigator.productSub == 20030107 ) { // Safari, the menus don't go away... problem in ResetMenu isDHTML = false; } var bwcv= getCookie( "bandwidth" ); var bw = Bandwidth(); if ( !(bwcv) || (bw && bwcv && bwcv.indexOf ( bw ) > -1 )) { SetCookie ( "bandwidth" , bw ); } if ( isW3C ) { document.domain = "dell.com" ; } } } function readIEVer() { var agent = navigator.userAgent; var offset = agent.indexOf( "MSIE" ); if( offset < 0 ) { return 0; } return parseFloat( agent.substring( offset + 5, agent.indexOf( ";", offset ) ) ); } function BandWidthRedir ( url ) { var bWidth = Bandwidth(); if ( bWidth == "Modem" ) { document.location.href = url ; } } function readOperaVer() { var agent = navigator.userAgent; var offset = agent.indexOf( "Opera" ); if( offset < 0 ) { return 0; } return parseFloat( agent.substring( offset + 6 ) ); } // Seek nested NN4 layer from string name function seekLayer(doc, name) { var theObj; for (var i = 0; i < doc.layers.length; i++) { if (doc.layers[i].name == name) { theObj = doc.layers[i]; break; } // dive into nested layers if necessary if (doc.layers[i].document.layers.length > 0) { theObj = seekLayer(document.layers[i].document, name); } } return theObj; } function parentNode(elem) { if( elem.parentElement ) { return elem.parentElement; } if( elem.parentNode ) { return elem.parentNode; } return null; } function contains(lookWhere,lookFor) { if( lookWhere == null || lookFor == null ) { return false; } /* if( lookWhere.contains ) { return lookWhere.contains( lookFor ); } else */ { var parent = parentNode( lookFor ); while( parent ) { if( parent == lookWhere ) { return true; } parent = parentNode( parent ); } } return false; } // Convert object name string or object reference // into a valid element object reference function getRawObject(obj) { var theObj; if (typeof obj == "string") { if (isW3C) { theObj = document.getElementById(obj); } else if (isIE4) { theObj = document.all(obj); } else if (isNN4) { theObj = seekLayer(document, obj); } } else { // pass through object reference theObj = obj; } return theObj; } // Convert object name string or object reference // into a valid style (or NN4 layer) reference function getObject(obj) { var theObj = getRawObject(obj); if (theObj && isCSS) { theObj = theObj.style; } return theObj; } function getObjectsByTag(tag) { if( document.getElementsByTagName ) { return document.getElementsByTagName(tag); } else if( document.all ) { return document.all.tags(tag); } return null; } // get the element an event refers to function eventToElement( evt ) { var elem = null; if( evt.target ) { elem = evt.target; } else if( evt.toElement ) { elem = evt.toElement; } if( elem && elem.nodeName == "#text" ) { elem = elem.parentNode; } return elem; } // Set the visibility of an object to visible function show(obj) { var theObj = getObject(obj); if (theObj) { theObj.visibility = "visible"; } } // Set the visibility of an object to hidden function hide(obj) { var theObj = getObject(obj); if (theObj) { theObj.visibility = "hidden"; } } // Set the visibility of an object to hidden function isVisible(obj) { var theObj = getObject(obj); return (theObj) ? ( theObj.visibility == "visible" ) : false; } // Position an object at a specific pixel coordinate function shiftTo(obj, x, y) { var theObj = getObject(obj); if (theObj) { if (isCSS) { // equalize incorrect numeric value type var units = (typeof theObj.left == "string") ? "px" : 0 theObj.left = x + units; theObj.top = y + units; } else if (isNN4) { theObj.moveTo(x,y) } } } // Retrieve the x coordinate of a positionable object function getObjectLeft(obj) { var elem = getRawObject(obj); var result = 0; if (document.defaultView) { var style = document.defaultView; var cssDecl = style.getComputedStyle(elem, ""); result = cssDecl.getPropertyValue("left"); } else if (elem.currentStyle) { result = elem.currentStyle.left; } else if (elem.style) { result = elem.style.left; } else if (isNN4) { result = elem.left; } return parseInt(result); } // Retrieve the y coordinate of a positionable object function getObjectTop(obj) { var elem = getRawObject(obj); var result = 0; if (document.defaultView) { var style = document.defaultView; var cssDecl = style.getComputedStyle(elem, ""); result = cssDecl.getPropertyValue("top"); } else if (elem.currentStyle) { result = elem.currentStyle.top; } else if (elem.style) { result = elem.style.top; } else if (isNN4) { result = elem.top; } return parseInt(result); } // Retrieve the rendered width of an element function getObjectWidth(obj) { var elem = getRawObject(obj); var result = 0; if (elem.offsetWidth) { result = elem.offsetWidth; } else if (elem.clip && elem.clip.width) { result = elem.clip.width; } else if (elem.style && elem.style.pixelWidth) { result = elem.style.pixelWidth; } return parseInt(result); } // Retrieve the rendered height of an element function getObjectHeight(obj) { var elem = getRawObject(obj); var result = 0; if (elem.offsetHeight) { result = elem.offsetHeight; } else if (elem.clip && elem.clip.height) { result = elem.clip.height; } else if (elem.style && elem.style.pixelHeight) { result = elem.style.pixelHeight; } return parseInt(result); } // Return the available content width space in browser window function getInsideWindowWidth() { if (window.innerWidth) { return window.innerWidth; } else if ( isIE6CSS ) { // measure the html element's clientWidth return document.body.parentElement.clientWidth; } else if (document.body && document.body.clientWidth) { return document.body.clientWidth; } return 0; } // Return the available content height space in browser window function getInsideWindowHeight() { if( window.innerHeight ) { return window.innerHeight; } else if( isIE6CSS ) { // measure the html element's clientHeight return document.body.parentElement.clientHeight } else if (document.body && document.body.clientHeight) { return document.body.clientHeight; } return 0; } // Open a popup window function winopen(url,stuff,morestuff) { var popwin = window.open(url,stuff,morestuff); // you may get "undefined" if a popup blocker did its thing... if( typeof(popwin) != "undefined" && popwin ) { popwin.focus(); } lastPopup = popwin; } // ------------------------------------------------------------- // cookie handling functions // ------------------------------------------------------------- function getCookie(NameOfCookie) { if (document.cookie.length > 0) { begin = document.cookie.indexOf(NameOfCookie+"="); if (begin != -1) { begin += NameOfCookie.length + 1; end = document.cookie.indexOf(";", begin); if (end == -1) { end = document.cookie.length; } return unescape( document.cookie.substring(begin, end)); } } return ""; } function SetCookie (NameOfCookie , value) { document.cookie = NameOfCookie + "=" + escape( value ); } // Auto Submit the form if valid function AutoSubmit ( frm ) { var cookieVal = getCookie ( "autosubmit" ); if ( cookieVal == document.location ) { var submitForm = window.confirm ( "Resubmit form?"); if ( submitForm ) { frm.submit(); return; } else { return; } } SetCookie( "autosubmit" , document.location ); frm.submit(); } // Auto Submit Form if Valid/Create Form Freq Popup Window function AutoSubmit2 ( frm, url, freq ) { var oldAction = frm.action; frm.action = url; var cookieVal = getCookie ( "autosubmit" ); if ( cookieVal == document.location ) { var submitForm = window.confirm ( "Resubmit form?"); if ( submitForm ) { if( freq == "true" ) { frm.target = "FreqFormPopup"; var x = window.open( url, "FreqFormPopup", "width=600, height=400, location=yes, menubar=yes, status=yes, toolbar=yes, scrollbars=yes, resizable=yes" ); } frm.submit(); frm.target = "_self"; frm.action = oldAction; return; } else { return; } } SetCookie( "autosubmit" , document.location ); if( freq == "true" ) { frm.target = "FreqFormPopup"; var x = window.open( url, "FreqFormPopup", "width=600, height=400, location=yes, menubar=yes, status=yes, toolbar=yes, scrollbars=yes, resizable=yes" ); } frm.submit(); frm.target = "_self"; frm.action = oldAction; } // Dynamic Forms Single Choice Skip Level function singlechoiceskiplevel( formInput ) { if( typeof(formInput) != "undefined" ) { var i = 0; while ( i < formInput.length ) { if( formInput[i].value != null && formInput[i].value != "") { if( document.getElementById(formInput[i].value) != null ) { if( formInput[i].selected || formInput[i].checked ) { document.getElementById(formInput[i].value).style.display = "inline"; } else { document.getElementById(formInput[i].value).style.display = "none"; } } } i++; } } } // ------------------------------------------------------------- // menu builder functions // ------------------------------------------------------------- var m_header = null; var m_menu = null; var m_subMenu = null; var m_subMenuEvtCtl = null; var m_hilite = null; var m_colorDepth = 0; var m_menuArrows = true; var m_stdTarget = " target=\"_blank\""; var m_stdEmpty = ""; var m_stdOffImg; function renderMenuStripSep() { document.write( "\"\"" ); } function menuGoto( url ) { if ( m_anchorClicked ) { return; } m_anchorClicked = true; hideMenus(); if ( url != null && url.indexOf( "javascript" ) > -1 ) { eval ( url ); } else { document.location = url; } if( document.event != null ) { document.event.cancelBubble = true; } return false; } function menuWinOpen( url ) { hideMenus(); window.open( url ); return false; } function renderMenuStrip() { var menuHeaderID; if( isIE6 ) { bodyTag.style.behavior = "url(#default#clientCaps)"; m_colorDepth = bodyTag.colorDepth; } spacing = "  "; if( m_menuBar.length < 4 ) { spacing += spacing; } var presep = ( m_menuBar.length <= 3 ); if( presep ) { document.write( " " ); } for( n = 0; n < m_menuBar.length; n++ ) { if( n > 0 ) { renderMenuStripSep(); } menuHeaderID = m_menuBar[n].Id + "Hdr"; if( isDHTML ) { document.write( "" ); document.write( "" + spacing + m_menuBar[n].Text ); if( m_menuBar[n].OffDell ) { document.write( m_stdOffImg ); } if( m_menuArrows ) { document.write( "" ); if( presep ) { document.write( spacing ); } } else { document.write( spacing ); } document.write( "" ); } else { document.write( "" ); document.write( "" + m_menuBar[n].Text ); if( m_menuBar[n].OffDell ) { document.write( m_stdOffImg ); } document.write( "" ); } } } function renderItems( menu, z ) { renderSubItems( menu, z, "menuItem" ); } function renderSubItems( menu, z, css ) { if( css == "menuItem" ) { document.write( "" ); } else { document.write( "" ); } for( var n = 0; n < menu.MenuItems.length; n++ ) { var item = menu.MenuItems[n]; if( item.IsSeparator ) { document.write( "" ); } else if( item.IsCaption ) { if( n > 0 ) { document.write( "" ); } document.write( "" ); document.write( "" ); } else if( item.MenuItems ) { document.write( "" ); } else { document.write( "" ); } } document.write( "" ); for( var n = 0; n < menu.MenuItems.length; n++ ) { var item = menu.MenuItems[n]; if( item.MenuItems ) { renderSubItems( item, z + 1, "menuSubItem" ); } } } function menuRef( id, text, href, items, target ) { this.Id = id; this.Text = text; this.Href = mhFixupLink( href, "&~ck=mn" ); this.IsSeparator = false; this.IsCaption = false; this.MenuItems = items; this.OffDell = false; this.TargetHtml = m_stdEmpty; if( ( typeof(target) != "undefined" ) && target ) { this.OffDell = ( target == "offdell" ); this.TargetHtml = " target=\"" + target + "\""; } } function menuItem( text, href, target ) { this.Text = text; this.Href = mhFixupLink( href, "&~ck=mn" ); this.IsSeparator = false; this.IsCaption = false; this.MenuItems = null; this.OffDell = false; this.TargetHtml = m_stdEmpty; if( ( typeof(target) != "undefined" ) && target ) { this.OffDell = ( target == "offdell" ); this.TargetHtml = " target=\"" + target + "\""; } } function menuCaption( text ) { this.Text = text; this.Href = null; this.IsSeparator = false; this.IsCaption = true; this.MenuItems = null; } function menuSep() { this.IsSeparator = true; this.IsCaption = false; } // ------------------------------------------------------------- // menu display/hiding functions // ------------------------------------------------------------- function clearReset() { if( resetsub ) { clearTimeout( resetsub ); resetsub = null; } if( resetmain ) { clearTimeout( resetmain ); resetmain = null; } if( resetmenu ) { clearTimeout( resetmenu ); resetmenu = null; } } function showSubMenu( evt, menuID ) { if( resetmenu ) { clearTimeout( resetmenu ); resetmenu = null; } if( !isIE6 ) { clearTimeout( resetsub ); resetsub = null; } if( menuID != null ) { if( resetsub && isIE6 ) { if( resetmain ) { clearTimeout( resetmain ); resetmain = null; } tempEvent = document.createEventObject( evt ); resetmain = setTimeout( "showSubMenuDelay( " + menuID + " )", resetTime ); } else { showSubMenuNow( evt, menuID ); } } else { if( isIE6 && resetsub ) { if( resetmain ) { clearTimeout( resetmain ); resetmain = null; } tempEvent = document.createEventObject( evt ); resetmain = setTimeout( "setHiliteDelay()", resetTime ); } } } function showSubMenuDelay( menuID ) { showSubMenuNow( tempEvent, menuID ); setHilite( tempEvent ); } function showSubMenuNow( evt, menuID ) { if( isDHTML ) { evt = evt ? evt : event; var top = -1; var left; var currentEle; var newMenu = getRawObject( menuID ); if( m_menu.id == m_menuBar[m_menuBar.length - 1].Id ) { left = m_header.offsetLeft + m_header.offsetWidth - m_menu.offsetWidth - newMenu.offsetWidth + 5 + document.body.offsetLeft; } else { left = m_header.offsetLeft + m_menu.offsetWidth + 3; } if( subtimerID ) { if( newMenu && newMenu == m_subMenu ) { return; } clearTimeout( subtimerID ); subtimerID = null; } if( m_subMenu != null) { if( m_subMenu == newMenu ) { evt.cancelBubble = true; return; } if( isVisible(m_subMenu) ) { hideSubMenu(); } } if( m_hilite ) { m_hilite.className = ""; m_hilite = null; } m_subMenuEvtCtl = eventToElement( evt ); m_subMenu = newMenu; currentEle = getHilite( evt ); rowHeight = ( ( m_menu.offsetHeight ) / ( m_menu.rows.length ) ); top += m_menu.offsetTop - 1; if( currentEle ) { top += currentEle.rowIndex * rowHeight; } shiftTo( m_subMenu, left, top ); if( !isVisible(m_subMenu) ) { subtimerID = setTimeout( "showSubMenuTimed()", 100 ); } evt.cancelBubble = true; } } function showSubMenuTimed() { if( m_subMenu == null ) { return; } if( isIE6 && m_subMenu.filters && m_colorDepth > 8 ) { m_subMenu.filters.item(0).Apply(); m_subMenu.filters.item(1).Apply(); } show(m_subMenu); if( isIE6 && m_subMenu.filters && m_colorDepth > 8 ) { m_subMenu.filters.item(0).Play(); m_subMenu.filters.item(1).Play(); } } // defines/shows the current header and menu // function showMenu( evt, menuHeaderID, menuID ) { clearReset(); if( isDHTML ) { evt = evt ? evt : event; if( timerID ) { clearTimeout( timerID ); timerID = null; } if( subtimerID ) { clearTimeout( subtimerID ); subtimerID = null; } timerID = setTimeout( "showMenuTimed( '" + menuHeaderID + "', '" + menuID + "')", 200 ); evt.cancelBubble = true; } } function showMenuTimed( menuHeaderID, menuID ) { var top = 0; var left = 0; var currentEle; var newMenu = getRawObject( menuID ); if(m_header != null && m_menu != null && m_menu != newMenu) { if( isVisible(m_menu) ) { hideMenu(); showSelectCtrl(); } } m_header = getRawObject( menuHeaderID ); m_menu = newMenu; m_header.className = "menuMainItemSel"; currentEle = m_header; // work out the position of the header and its parent elements // while( currentEle && currentEle.tagName.toLowerCase() != 'body' ) { top += currentEle.offsetTop; left += currentEle.offsetLeft; currentEle = currentEle.offsetParent; } top += currentEle.offsetTop; left += currentEle.offsetLeft; if( menuHeaderID == ( m_menuBar[m_menuBar.length - 1].Id + "Hdr" ) ) { left += m_header.offsetWidth - m_menu.offsetWidth; } // add the width of the header, and width of extra image. // top += (m_header.offsetHeight); shiftTo( m_menu, left, top ); hideSelectCtrl(); if( !isVisible(m_menu) ) { if( isIE6 && typeof(m_menu.filters) != "undefined" && m_menu.filters && m_colorDepth > 8 ) { m_menu.filters.item(0).Apply(); m_menu.filters.item(1).Apply(); } show(m_menu); if( isIE6 && typeof(m_menu.filters) != "undefined" && m_menu.filters && m_colorDepth > 8 ) { m_menu.filters.item(0).Play(); m_menu.filters.item(1).Play(); } } } // Hide the current menu // function hideMenu() { if( isDHTML && m_menu ) { hideSubMenu(); hide(m_menu); m_header.className = "menuMainItem"; m_menu = null; } } function hideSubMenu() { if( isDHTML && m_subMenu ) { hide(m_subMenu); m_subMenuEvtCtl = null; m_subMenu = null; clearHilite( m_menu ); } if( resetsub ) { clearTimeout( resetsub ); resetsub = null; } } function hideMenus() { if( timerID ) { clearTimeout( timerID ); timerID = null; } hideMenu(); } // hide/reset the current menu, but only if we're // not moving onto the menu itself // function resetMenu( evt ) { if( !resetsub ) { if( isDHTML ) { evt = evt ? evt : event; if( timerID ) { clearTimeout( timerID ); timerID = null; } if( m_header != null && m_menu != null ) { var dest = eventToElement( evt ); var notSubMenu = ( m_subMenu != dest && !contains( m_subMenu, dest ) ); // hide the submenu if necessary // if( m_subMenu && m_subMenuEvtCtl && notSubMenu && m_subMenuEvtCtl != dest && !contains( m_subMenuEvtCtl, dest ) && m_subMenu != dest && !contains( m_subMenu, dest ) ) { if( !resetsub ) { resetsub = setTimeout( "hideSubMenu()", resetTime ); } } // proceed if we're not moving onto a menu item // if( ( !m_subMenu || notSubMenu ) && dest && m_header != dest && !contains( m_header, dest ) && m_menu != dest && !contains( m_menu, dest ) ) { if( !resetsub ) { resetsub = setTimeout( "hideSubMenu()", resetTime ); } if( !resetmenu ) { resetmenu = setTimeout( "hideMenus()", resetTime); } m_header.className = "menuMainItem"; if( m_hilite ) { m_hilite.className = ""; m_hilite = null; } if( !resetsub && !resetmenu ) { m_header = null; m_menu = null; m_hilite = null; } showSelectCtrl(); } // work out what dest highlight // else if( m_menu || m_subMenu ) { setHilite( evt ); } evt.cancelBubble = true; } } } } function setHiliteDelay() { if( typeof(tempEvent) != "undefined" ) { setHilite( tempEvent ); } } function setHilite ( evt ) { var hilite = getHilite( evt ); if( hilite ) { if( m_hilite && ( !m_subMenu || contains( m_subMenu, m_hilite ) ) ) { m_hilite.className = "menuSubItem"; m_hilite = null; } var content = hilite.innerHTML; if( content.indexOf( "menuSubItem" ) > 0 ) { m_hilite = hilite; m_hilite.className = "menuSubSelRow"; } else if( content.indexOf( "menuItem" ) > 0 ) { m_hilite = hilite; m_hilite.className = "menuSelRow"; } } } function clearHilite( table ) { var cell, row, count, ix; count = table.rows.length; for( ix = 0; ix < count; ix++ ) { table.rows[ix].className = ""; } } function getHilite( evt ) { evt = evt ? evt : event; var hilite = null; var to = eventToElement( evt ); if( to && ( m_menu && contains( m_menu, to ) ) || ( m_subMenu && contains( m_subMenu, to ) ) ) { hilite = to; while( hilite && hilite.tagName.toLowerCase() != "tr" ) { hilite = parentNode( hilite ); } if( hilite ) { var menuTable = parentNode( parentNode( hilite ) ); if( menuTable && menuTable.className && menuTable.className == "subContainer" ) { var container = parentNode( menuTable ); if( container.tagName.toLowerCase() == "td" ) { hilite = parentNode( container ); } } } } return hilite; } // ------------------------------------------------------------- // HTML workarounds // ------------------------------------------------------------- // Show SELECT controls (dropdown lists) when menu is hidden // function showSelectCtrl() { var obj; var tags = getObjectsByTag("select"); for( var i = 0; i m_menu.offsetLeft)) { hide(obj); } } } top = 0; left = 0; } } // ------------------------------------------------------------- // client-side masthead // ------------------------------------------------------------- var m_pnlinks; var m_crumbs; var m_mhFixed = false; var m_isHome = false; var m_isSegHome = false; var m_mda = null; var m_printLink = null; var m_emailLink = false; var m_helpLink = null; var m_production = true; var m_menudef = "/content/public/menu.aspx"; var m_avgChW = 6; var m_crumbRegEx1 = /<.*>/g; var m_crumbRegEx2 = / /g; var m_crumbRegEx3 = /&~ck=bt/g; var m_subNavLinksDisplay = false; var m_subNavIconsDisplay = false; var m_largeFont = false; function writeMHPop() { autoconfig(); writeMHPopInternal( true ); } function writeMHFlat() { autoconfig(); writeMHPopInternal( false ); } function writeMHPopInternal( showClose ) { //Print page document.writeln( "" ); // top strip document.write( "" ); // main section document.write( "" ); document.write( "" ); if( !legacyMode ) { document.write( "" ); } document.write( "
" ); if( m_printLink ) { document.write( "" + m_printText + "" ); } if( showClose ) { if( m_printLink ) { document.write( "  |  " ); } document.write( "" + m_popClose + "" ); } document.write( "\"\"
\"\"
\"\"
\"\"
" ); } function writeMH( phoneTitle, phoneMsg, phoneTariff, segmentTitle, hasLocale, logoLink, pnmsg ) { document.writeln ( ""); autoconfig(); if ( typeof(m_suppressPrintLink) != "undefined" ) { m_printLink = null; } if ( typeof(m_menuBar) == "undefined" ) { if( !m_production ) { document.write( "
There is a problem with the menu definition. " ); document.write( "Click here to view
" ); return; } return; } // document.write( "" ); if( m_largeFont ) { m_avgChW = m_avgChW + 2; } m_mhFixed = true; // m_mda = null; m_stdOffImg = "<img src=\"" + m_imgPfx + "/images/global/brand/icons/smextlink.gif\", width=\"16\" height=\"9\" border=\"0\"/>"; if( isDHTML ) { for( var n = 0; n < m_menuBar.length; n++ ) { renderItems( m_menuBar[n], 100 ); } } if( typeof(m_printableText) == "undefined" ) { m_printableText = m_printText; } if( typeof(m_helpText) == "undefined" ) { m_helpText = "Help"; } if( document.body ) { document.body.onmouseover = resetMenu; document.body.onmouseout = resetMenu; } else { var bodytags = getObjectsByTag( "body" ); if( bodytags && bodytags.length > 0 ) { bodytags[0].onmouseover = resetMenu; bodytags[0].onmouseout = resetMenu; } } document.writeln( "<a name=\"mastheadtop\"></a>" ); if( m_isHome || hasLocale ) { document.writeln( m_isHome ? m_localeSelector : m_localeSelectLite ); } document.write( "</td></tr>" );//This is opened in pagehost file // phone strip var phoneMdaWidth = 350; document.write( "<tr><td>" ); document.write( "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">" ); document.write( "<tr><td>" ); document.write( "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"" + screenWidth + "\" >"); document.write( "<tr>" ); document.write( "<td width=\"365\" align=\"left\" valign=\"bottom\" style=\"padding-left:8px; padding-top:0px; padding-bottom:0px;padding-right:8px\">" ); if( m_mda ) { document.write( "<span class=\"mhTextNewMda\">" ); document.write( m_mda ); document.write( "</span>" ); } document.write( "</td>" ); document.write( "<td style=\"padding-left:6px; padding-top:0px; padding-bottom:0px;\" width=\"" + phoneMdaWidth + "\" align=\"right\" valign=\"bottom\">" ); if( phoneTitle || phoneMsg ) { document.write( "<span class=\"mhTextNewPnMsg\">" ); if( phoneTitle ) { document.write( phoneTitle ); document.write( " " ); } if( phoneMsg ) { document.write( phoneMsg ); } document.write( "</span>" ); } if( phoneTariff ) { document.write( "<span class=\"mhTextNewTrf\"> " + phoneTariff + "</span>" ); } document.write( "<img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" width=\"10\" height=\"1\" /></td>" ); document.writeln( "</tr>" ); document.write( "<tr><td><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" width=\"20\" height=\"2\" /></td></tr>" ); document.write( "</table>" ); document.write( "</td><td width=\"100%\"></td></tr>" ); // main section if( m_isHome ) { document.write( "<tr><td>" ); document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + screenWidth + "\" bgcolor=\"#0066CC\">" ); document.write( "<tr><td width=\"123\" height=\"44\" valign=\"middle\">" ); document.write( "<img src=\"" + m_homelogo + "\" alt=\"\" align=\"absmiddle\" border=\"0\" />" ); document.write( "</td><td valign=\"bottom\" nowrap=\"1\">"); document.write( "<img src=\"" + m_ctryImg + "\" alt=\"" + m_ctryShort + "\" vspace=\"4\">" ); if ( flag ) { document.write( "&nbsp;<img src=\"" + m_imgPfx + "/images/global/masthead/smlflags/" + flag + ".gif\" alt=\"" + m_ctryShort + "\" border=\"0\" vspace=\"9\" />"); } document.write( "</td><td align=\"right\" valign=\"middle\" nowrap=\"1\">"); renderSearchLinks(); document.write( "</tr>" ); document.write( "<tr><td colspan=\"3\" bgcolor=\"#004E98\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\"/></td></tr>" ); document.write( "</table>" ); document.write( "</td></tr>" ); //If it is in homepage, always display sub nav icons m_subNavLinksDisplay = true; m_subNavIconsDisplay = true; } else { document.write( "<tr bgcolor=\"#0066CC\"><td>" ); document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + screenWidth + "\" bgcolor=\"#0066CC\">" ); document.write( "<tr><td width=\"1\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" height=\"44\" width=\"1\" alt=\"\" border=\"0\" /></td>" ); document.write( "<td width=\"122\">" ); // Skip Navigation Link document.write( "<a href=\"#skipMH\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"Skip to main content\" border=\"0\" width=\"1\" height=\"1\" /></a>" ); if( typeof( m_nothomelogo ) != "undefined" ) { if( logoLink ) { document.write( "<a href=\"" + m_homelink + "\">" ); } document.write( "<img src=\"" + m_nothomelogo + "\" alt=\"\" align=\"absmiddle\" border=\"0\" width=\"123\" height=\"28\" />" ); if( logoLink ) { document.write( "</a>" ); } } if(typeof(m_mhTheme) != "undefined") { if( m_mhTheme != null && m_mhTheme.length>0 ) { document.write( "</td><td width=\"62%\" style=\"background-image: url(" + m_mhTheme + ");background-repeat: no-repeat;background-position:right;\">" ); } else { document.write( "</td><td width=\"62%\">" ); } } else { document.write( "</td><td width=\"62%\">" ); } if( flag ) { document.writeln( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td width=\"2\" nowrap=\"1\"><span class=\"mhTitle\">" + m_ctryShort + "&nbsp;</span></td><td><img src=\"" + m_imgPfx + "/images/global/masthead/smlflags/" + flag + ".gif\" alt=\"" + m_ctryName + "\" border=\"0\" /></td></tr></table>" ); } else { document.writeln( "<div class=\"mhTitle\">" + m_ctryShort + "</div>" ); } if( segmentTitle ) { document.write( "<div class=\"mhTitle\">" ); if( m_seglink ) { document.write( "<a href=\"" + m_seglink + "\" class=\"mhTitleLink\">" ); } document.write( segmentTitle ); if( m_seglink ) { document.write( "</a>" ); } document.write( "</div></td>" ); } if( m_search ) { document.write( "<td align=\"right\" valign=\"bottom\" width=\"100%\">" ); document.write( m_search ); } else { document.write( "<td align=\"right\" valign=\"middle\" width=\"100%\">" ); renderSearchLinks(); } document.write( "</td><td>&nbsp;</td></tr>" ); // nav strip if( typeof(m_menuBar) != "undefined" && m_menuBar && m_menuBar.length > 0 ) { document.write( "</table></td><td bgcolor=\"#0066CC\" width=\"100%\"></td></tr><tr bgcolor=\"#0066CC\"><td><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + screenWidth + "\">" ); document.write( "<tr><td width=\"" + screenWidth + "\" bgcolor=\"#006699\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" width=\"" + screenWidth + "\" height=\"1\" /></td></tr></table>" ); document.write("</td><td width=\"100%\" bgcolor=\"#006699\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" width=\"100%\" height=\"1\"/></td></tr>"); document.write("<tr bgcolor=\"#0099FF\" ><td background=\"" + m_imgPfx + "/images/global/brand/ui/pn_bg.gif\">"); document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + screenWidth + "\" height=\"24\">" ); if( m_menuBar.length < 4 ) { document.write( "<tr ><td bgcolor=\"#0099FF\" background=\"" + m_imgPfx + "/images/global/brand/ui/pn_bg.gif\" align=\"right\">" ); document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr>" ); renderMenuStripSep(); } else { document.write( "<tr ><td bgcolor=\"#0099FF\" background=\"" + m_imgPfx + "/images/global/brand/ui/pn_bg.gif\">" ); document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + screenWidth + "\"><tr>" ); } renderMenuStrip(); //do it only if the masthead extends menu_sep.gif //document.write( "<td nowrap=\"1\"><img src=\"" + m_imgPfx + "/images/global/masthead/menu_sep.gif\" width=\"2\" alt=\"\" /></td>" ); document.write( "</tr></table></td></tr></table></td>" ); document.write( "<td bgcolor=\"#0099FF\" background=\"" + m_imgPfx + "/images/global/brand/ui/pn_bg.gif\" width=\"100%\"><img src=\"" + m_imgPfx + "/images/global/masthead/menu_sep.gif\" width=\"2\" alt=\"\" /></td></tr>" ); } else { document.write( "<tr><td bgcolor=\"#004E98\" colspan=\"5\"><img src=\"" ); document.write( m_imgPfx ); document.write( "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td></tr></table></td><td bgcolor=\"#0066CC\" width=\"100%\"></td></tr>" ); } } // Skip Navigation Bookmark //document.write( "<tr><td><a name=\"skipMH\" ></a></td></tr>" ); // breadcrumbs and subnav links if( (!m_isHome) && ( m_crumbs || m_pnlinks )) { var bcTwoLine = false; if( m_crumbs ) { var bcWidth = breadCrumbsWidth(false); bcWidth = screenWidth - bcWidth; var snWidth = subNavWidth(); bcTwoLine =( bcWidth + snWidth >= 715 )? true : false; } if( !bcTwoLine ) { document.write( "<tr bgcolor=\"#f5f5f5\"><td>" ); document.write( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + screenWidth + "\">" ); document.write( "<tr>" ); if( m_crumbs ) { renderCrumbsNew( false ); } if( m_pnlinks && m_subNavLinksDisplay ) { renderSubNavLinks(); } document.write( "</tr></table></td><td width=\"100%\" bgcolor=\"#f5f5f5\"</td></tr>" ); } else { if( m_pnlinks && m_subNavLinksDisplay ) { document.write( "<tr>" ); renderSubNavLinks(); document.write( "<td bgcolor=\"#f5f5f5\" width=\"100%\"></td></tr>" ); } document.write( "<tr><td colspan=\"2\" width=\"100%\" bgcolor=\"#999999\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td></tr>" ); document.write( "<tr>" ); renderCrumbsNew( false ); document.write( "<td bgcolor=\"#f5f5f5\" width=\"100%\"></td></tr>" ); } document.write( "<tr>" ); document.write( "<td width=\"" + screenWidth + "\" bgcolor=\"#999999\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td>" ); document.write( "<td width=\"100%\" bgcolor=\"#999999\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td>" ); document.write( "</tr>" ); } else if( m_isHome && m_pnlinks ) { if( m_pnlinks && m_subNavLinksDisplay ) { document.write( "<tr >" ); renderSubNavLinks(); document.write( "</tr>" ); document.write( "<tr>" ); document.write( "<td width=\"" + screenWidth + "\" bgcolor=\"#999999\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td>" ); document.write( "</tr>" ); } } //Changed the height if( !legacyMode && !m_isHome ) { document.write( "<tr><td bgcolor=\"#ffffff\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"5\" width=\"1\" /></td><td width=\"100%\"></td></tr>" ); } document.write("</table>"); document.writeln ( "<!-- end masthead -->"); //document.write( "" ); } function renderSubNavLinks() { //problem in width document.write(""); document.write( "" ); for( var n = 0; n < m_pnlinks.length; n++ ) { if( n > 0 ) { document.write( "" ); } var href = m_pnlinks[n].Href; var icon = m_pnlinks[n].Icon; if( icon && m_subNavIconsDisplay ) { document.write( "" ); } document.write( "" ); } document.write( "
\"\"\"\"" + m_pnlinks[n].Text + "  
" ); document.write( "" ); } function getBackto() { if ( typeof ( m_backto ) != "undefined" ) { return m_backto; } return ""; } function getGotoTop () { if ( typeof ( m_gototop ) != "undefined" ) { return m_gototop; } return ""; } function getPrintableText () { if ( typeof ( m_printableText ) != "undefined" ) { return m_printableText; } return ""; } function renderCrumbsNew( forFooter ) { document.write( "     " + getBackto() + ": " ); var totalw = 700 - ( getBackto().length * m_avgChW ); if( forFooter ) { if( m_printLink ) { totalw -= 20 + ( getPrintableText().length * m_avgChW ); } if( m_emailLink ) { totalw -= 20 + ( m_emailText.length * m_avgChW ); } if( m_helpLink ) { totalw -= 20 + ( m_helpText.length * m_avgChW ); } } for( var n = 0; n < 2; n++ ) { if( n >= m_crumbs.length ) { break; } if( n > 0 ) { document.write( " > " ); totalw -= 16; } href = m_crumbs[n].Href; if( href ) { if( forFooter ) { href = href.replace( m_crumbRegEx3, "&~ck=bb" ); } document.write( "" + m_crumbs[n].Text + "" ); } else { document.write( "" + m_crumbs[n].Text + "" ); } totalw -= crumbWidth( m_crumbs[n].Text ); } var trail = ""; for( var n = m_crumbs.length - 1; n >= 2; n-- ) { totalw -= crumbWidth( m_crumbs[n].Text ) + 16; if( totalw < 0 ) { break; } href = m_crumbs[n].Href; if( href ) { if( forFooter ) { href = href.replace( m_crumbRegEx3, "&~ck=bb" ); } trail = " > " + m_crumbs[n].Text + "" + trail; } else { trail = " > " + m_crumbs[n].Text + "" + trail; } } if( trail.length > 0 ) { if( totalw < 0 ) { document.write( " > ..." ); } document.write( trail ); } document.write( "" ); if( forFooter ) { renderPrintEmailLinks(); } } function crumbWidth( crumb ) { var text = crumb.replace( m_crumbRegEx1, "" ); text = text.replace( m_crumbRegEx2, " " ); var hasUnicode = false; for( n = 0; n < text.length; n++ ) { if( text.charCodeAt( n ) > 0x1000 ) { hasUnicode = true; break; } } if( hasUnicode ) { return text.length * m_avgChW; } else { if( m_largeFont ) { return text.length * 8; } else { return text.length * 6; } } } function subNavWidth() { var navWidth = 0; if( m_pnlinks) { for( var n = 0; n < m_pnlinks.length; n++ ) { if( n > 0 ) { //separator navWidth = navWidth + 23; } var icon = m_pnlinks[n].Icon; if( icon && m_subNavIconsDisplay ) { navWidth = navWidth + 24; } navWidth = navWidth + crumbWidth( m_pnlinks[n].Text) ; if( m_largeFont) { navWidth = navWidth + 7; } } } return navWidth; } function breadCrumbsWidth(forFooter) { var totalw = 700 - ( getBackto().length * m_avgChW ); for( var n = 0; n < 2; n++ ) { if( n >= m_crumbs.length ) { break; } if( n > 0 ) { totalw -= 16; } totalw -= crumbWidth( m_crumbs[n].Text ); } var trail = ""; for( var n = m_crumbs.length - 1; n >= 2; n-- ) { totalw -= crumbWidth( m_crumbs[n].Text ) + 16; if( totalw < 0 ) { break; } } return totalw; } function renderPrintEmailLinks() { if( m_printLink || m_emailLink || m_helpLink ) { //document.write( "" ); // added the padding to match the MDA (John Tipton) document.write( "" ); document.write( "" ); if( m_emailLink ) { var m_emailsubject = document.title; if( typeof(m_emailSubject) != "undefined" && m_emailSubject != null && m_emailSubject.length > 0 ) { m_emailsubject = m_emailSubject; } var emailUrl = "javascript:void(document.location.href=" + "'mailto:?subject=" + m_emailsubject + "&body=" + document.location.href.replace(/%26/g,'%2526').replace(/&/g,'%2526') + "')" ; document.write( "" ); document.write( "" ); } if( m_printLink ) { if( m_emailLink ) { document.write( "" ); } document.write( "" ); document.write( "" ); } if( m_helpLink ) { if( m_emailLink ) { document.write( "" ); } document.write( "" ); document.write( "" ); } document.write( "
\""" + m_emailText + "  |  \""" + getPrintableText() + "  |  \""" + m_helpText + "     
" ); } } function renderSearchLinks() { if( m_searchLinks ) { document.write( "" ); for( var n = 0; n < m_searchLinks.length; n++ ) { if( n > 0 ) { document.write( "" ); } var href = m_searchLinks[n].Href; var text = m_searchLinks[n].Text; document.write( "" ); document.write( "" ); } document.write( "
\"\"\"\"" + text + "\"\"
" ); } else { document.write( " " ); } } function mhFixupLink( href, extra ) { if( typeof(extra) == "undefined" ) { extra = "&~ck=mn"; } if( href ) { var anchor = null; var anchorix = href.indexOf( "#" ); if( anchorix != -1 ) { anchor = href.substr( anchorix ); href = href.substr( 0, anchorix ); } if( href.indexOf( "?" ) == -1 ) { extra = "?" + extra.substr( 1 ); } if( href.toLowerCase().indexOf( "javascript:" ) == -1 ) { href += extra; } else { start = href.indexOf( "?" ); if( start != -1 ) { ix = href.indexOf( "\'", start ); if( ix == -1 ) { ix = href.indexOf( "\\", start ); if( ix == -1 ) { ix = href.indexOf( "\"", start ); } } if( ix != -1 ) { href = href.substr( 0, ix ) + extra + href.substr( ix ); } } } if( anchor ) { href += anchor; } } return href; } function mhLink( text, href, icon, extra ) { href = mhFixupLink( href, extra ); this.Text = text; this.Href = href; this.Icon = icon; } function addPnLink( text, href, icon ) { if( !m_pnlinks ) { m_pnlinks = new Array(); } m_pnlinks[m_pnlinks.length] = new mhLink( text, href, icon, "&~ck=pn" ); } function addCrumb( text, href ) { if( !m_crumbs ) { m_crumbs = new Array(); } m_crumbs[m_crumbs.length] = new mhLink( text, href, null, "&~ck=bt" ); } // ------------------------------------------------------------- // client-side footer // ------------------------------------------------------------- function writeFooterLine( color ) { document.writeln( "\"\"" ); } function writeFooterStart() { var width = ( m_mhFixed ? "728" : "100%" ); document.write( "" ); document.write( "" ); if(typeof(m_pageTheme) != "undefined") { if( m_pageTheme != null && m_pageTheme.length>0 ) { document.write( "" ); } } if( !m_isHome && m_crumbs ) { writeFooterLine( "#999999" ); document.write("
\"\"
\"\"
"); renderCrumbsNew( true ); document.write("
"); } document.write( "" ); } function writeFooterMid() { var width = ( m_mhFixed ? "728" : "100%" ); var sepCol = "#cccccc"; if( !m_isHome && m_crumbs ) { sepCol = "#999999"; } document.write( "" ); document.write( "" ); document.write( "
\"\"
\"\"
" ); } function writeFooterBegin() { writeFooterStart(); writeFooterMid(); } function writeFooterClose() { document.write( "
\"\"" + getGotoTop() + "  
\"\"
\"\"
" ); } function StripCookieValue ( inVal , removeVal ) { if ( !inVal || inVal.length == 0 || !removeVal || removeVal.length == 0 ) { return inVal; } var idx = 0; var ampIdx = 0; var semiIdx = 0; var len = 0; var repString = ""; idx = inVal.indexOf ( removeVal ); if ( idx > - 1) { ampIdx = inVal.indexOf ( "&" , idx ); semiIdx = inVal.indexOf ( ";" , idx); len = ampIdx ; if ( len == -1 ) { len = semiIdx; } else if ( semiIdx != -1 && semiIdx < len ) { len = semiIdx; } if ( len > -1 ) { repString = inVal.substring( idx , len ); } else { repString = inVal.substr( idx ); } return inVal.replace ( repString , "" ).replace("&&" , "&" ) ; } return inVal; } function RemoveName() { var cookie = getCookie ( "StormPCookie" ) if ( cookie && cookie.length > 0 ) { cookie= StripCookieValue( cookie , "fstn" ); cookie = StripCookieValue( cookie , "lstn"); document.cookie = "StormPCookie=" + cookie + ";domain=.dell.com"; } cookie = getCookie ( "lwp" ); if ( cookie && cookie.length > 0 ) { cookie = StripCookieValue( cookie , "fstn" ); cookie = StripCookieValue( cookie , "lstn"); cookie = StripCookieValue ( cookie , "fn" ); document.cookie = "lwp=" + cookie+ ";domain=.dell.com"; } } function Bandwidth() { if( readIEVer() < 5.0 || isOpera || navigator.appVersion.toLowerCase().indexOf("win") == -1 ) { return "NA"; } document.body.addBehavior ("#default#clientCaps"); if ( typeof( document.body.connectionType) != "undefined" ) { if ( document.body.connectionType == "modem" ) { return "Modem"; } return "Lan"; } } function FlashLibrary(){ var t = this; var activeX = false; t.ieAutoInstall = true; t.hasVersion = function(ver){ t.swf = false; if(!ver) ver = 0; var n = navigator; if(n.plugins && n.plugins.length > 0){ var m,tp,d,v; m = n.mimeTypes; tp = 'application/x-shockwave-flash'; if(m && m[tp] && m[tp].enabledPlugin && m[tp].enabledPlugin.description){ d = m[tp].enabledPlugin.description; v = d.charAt(d.indexOf('.')-1); t.swf = (v >= ver) ? true : false; } }else if(n.appVersion.indexOf("Mac") == -1 && window.execScript){ for(var i=ver; i<=7&&i!=1&&t.swf!=true; i++){ execScript('on error resume next: flash.swf=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash'+((i==0)?'':'.'+i)+'"))','VBScript'); } activeX = true; }else{ t.swf = false; } return t.swf; } t.getPluginTag = function(swfFile,width,height,bgcolor,ver,altFormat,params){ var s = ''; var win = (navigator.appVersion.toLowerCase().indexOf("win")!=-1); var ie = (navigator.appName=="Microsoft Internet Explorer"); if(t.hasVersion(ver) && swfFile || win && ie && swfFile && t.ieAutoInstall){ var additionalParams = ''; var qPos = swfFile.indexOf ( "?" ) if ( qPos > -1 && qPos + 1 < swfFile.length && ver == 6 ) { var ta = 'FlashVars'; var v = swfFile.substring ( qPos + 1 ); swfFile = swfFile.substring ( 0 , qPos ); additionalParams += (activeX)?'\t\n': ' '+ ta + '="' + v + '"'; } if(activeX){ s = '\n'; s += '\t\n'; s += '\t\n'; s += '\t\n'; s += '\t\n'; s += '\t\n'; s += additionalParams; s += altFormat; s += '\n\n'; return s; }else{ s = '\n'; return s; } }else{ return altFormat; } } } // ------------------------------------------------------------- // end of common.js // -------------------------------------------------------------