//change this based on server hostname
//var v_hostname = "www-dev1.transunion.com";
//var v_hostname = "www-qa1.transunion.com";
var v_hostname = "www.transunion.com"

var dCurrDate=new Date(); var dCurrYear=dCurrDate.getFullYear();
//var v_copyright = "&copy;"+dCurrYear+" TransUnion LLC. All rights reserved.";

//global DOM defs
if( typeof Node == "undefined" ) {
  var Node = {
    ELEMENT_NODE: 1,
	ATTRIBUTE_NODE: 2,
	TEXT_NODE: 3,
	CDATA_SECTION_NODE: 4,
	ENTITY_REFERENCE_NODE: 5,
	ENTITY_NODE: 6,
	PROCESSING_INSTRUCTION_NODE: 7,
	COMMENT_NODE: 8,
	DOCUMENT_NODE: 9,
	DOCUMENT_TYPE_NODE: 10,
	DOCUMENT_FRAGMENT_NODE: 11,
	NOTATION_NODE: 12
  }  //var Node
}  //if Node

//various globals:
var aDecrImages = new Array, aIncrImages = new Array;
//fontsize range in em, with default index:
var aFontSizes=[.4375, .53125, .625, .71875, .8125, .90625], iDefFontIndex=2;
var iFontIndex = iDefFontIndex;
//messages:
var sMsgSelect="Please make a selection.";

//various onLoad events:
//bug fix (footer placement):
(window.attachEvent) ? window.attachEvent('onload', footerFix ) : window.addEventListener('load', footerFix, false);

if( navigator.userAgent.indexOf( 'MSIE 7.' ) != -1 ) {
//  (window.attachEvent) ? window.attachEvent('onload', footerFix ) : window.addEventListener('load', footerFix, false);
  (window.attachEvent) ? window.attachEvent('onload', ie7wrapper ) : window.addEventListener('load', ie7wrapper, false);
} //if IE7.x

//2006/11/01 pmackie@transunion.com
//if this is a "print" page, start processing:
if(isPrintable( document.URL )) {
  (window.attachEvent) ? window.attachEvent('onload', printPageRef ) : window.addEventListener('load', printPageRef, false);
} else { //for non-printables check font-size:
  (window.attachEvent) ? window.attachEvent('onload', initResize ) : window.addEventListener('load', initResize, false);
} //isPrintable

//2006/11/09 pmackie@transunion.com
//onload event handler for printable pages
//if this is a printable page, call printPage function with "current" target
function printPageRef() {
  var isPrintAll = getPrintAllValue( document.URL );
  if ( isPrintAll == '' ) isPrintAll = true;
  printPage( "current", isPrintAll );
} //printPageRef


//2006/12/11 pmackie@transunion.com
//various fixes for IE7.x
function ie7wrapper() {
  //footerFix();
  flipCSS();
}

//=============================COOKIES==============================
function setCookie(sName, sValue, oExpires, sPath, sDomain, bSecure) {
  var sCookie = sName + "=" + encodeURIComponent(sValue);
  if (oExpires) sCookie += "; expires=" + oExpires.toGMTString();
  if (sPath) sCookie += "; path=" + sPath;
  if (sDomain) sCookie += "; domain=" + sDomain;
  if (bSecure) sCookie += "; secure";
  document.cookie = sCookie;
} //setCookie()
                                
function getCookie(sName) {
  var sRE = "(?:; )?" + sName + "=([^;]*);?";
  var oRE = new RegExp(sRE);
  return (oRE.test(document.cookie)) ? decodeURIComponent(RegExp["$1"]) : null;
} //getCookie()

function deleteCookie(sName, sPath, sDomain) {
  var sCookie = sName + "=; expires=" + (new Date(0)).toGMTString();
  if (sPath) sCookie += "; path=" + sPath;
  if (sDomain) sCookie += "; domain=" + sDomain;
  document.cookie = sCookie;
} //deleteCookie()
//=============================END OF COOKIES===========================


//helper function to open popup windows
function popWin( url, title, width, height ) {  
  var v_url = url;
  var params = 'toolbar=yes,location=no,status=yes,scrollbars=yes,resizable=yes';
  //append popup parameters:
  if( width ) params += ',width=' + width + ',height=' + height;
  var newWindow = window.open( v_url, title, params );
} //popWin()

//helper functions for pulldowns
//onClick goto selected page, where selected value is destination URL with optional arguments
//arguments might be appended to URL deciding on target:
//  window={ current | new | popupWIDTHxHEIGHT }
//    current will open in current window, new will open new window,

//    popup will open new window with specified width and height
//if no value is selected ( value == -1 | null ) then user will be prompted
//  to make a selection
function gotoLocale() {
  var v_selected = document.locale_form.listLocaleItems.options[document.locale_form.listLocaleItems.selectedIndex].value;
  var v_url, v_target;
  if( v_selected && v_selected != -1 ) {
    var v_argStart = v_selected.lastIndexOf( "?" );
	if( v_argStart == -1 ) {  //no args passed, reload current page with passed url
		window.location = v_selected;
	} else {  //parse args
		v_url = v_selected.slice( 0, v_argStart );
		v_target = v_selected.substr( v_argStart + 1 ).replace( "window=", "" );
		if( v_target.substr( 0 , 5 ) == 'popup' ) {  //popup, extract WIDTHxHEIGHT
			var v_numbers = v_target.substr( 5 );
			var v_width = v_numbers.substr( 0, v_numbers.indexOf( "x" ) );
			var v_height = v_numbers.substr( v_numbers.indexOf( "x" ) + 1 );
			popWin( v_url, 'popup', v_width, v_height )  //open popup
		} else if( v_target.substr( 0 , 3 ) == 'new' ) {
			popWin( v_url, 'popup', 0, 0 )  //open new window
		} else {  //all others open as current
			window.location = v_selected.substr( 0, v_selected.indexOf( "?" ) );
		}  //if
    }  //if
  } else { alert(sMsgSelect); }
} //gotoLocale()

function gotoLogin() {
  var v_selected = document.login_form.listLoginItems.options[document.login_form.listLoginItems.selectedIndex].value;
  var v_url, v_target;
  if( v_selected && v_selected != -1 ) {
	var v_argStart = v_selected.indexOf( "&" ) != -1 ? v_selected.lastIndexOf( "&" ) : v_selected.lastIndexOf( "?" );
	if( v_argStart == -1 ) {  //no args passed, reload current page with passed url
	  window.location = v_selected;
	} else {  //parse args
		v_url = v_selected.slice( 0, v_argStart );
		v_target = v_selected.substr( v_argStart + 1 ).replace( "window=", "" );
		if( v_target.substr( 0 , 5 ) == 'popup' ) {  //popup, extract WIDTHxHEIGHT
		  var v_numbers = v_target.substr( 5 );
		  var v_width = v_numbers.substr( 0, v_numbers.indexOf( "x" ) );
		  var v_height = v_numbers.substr( v_numbers.indexOf( "x" ) + 1 );
		  popWin( v_url, 'popup', v_width, v_height )  //open popup
		} else if( v_target.substr( 0 , 3 ) == 'new' ) {
		  popWin( v_url, 'popup' )  //open new window
		} else {  //all others open as current
		  window.location = v_url;
		}  //if
    }  //if
  } else { alert(sMsgSelect); }
} //gotoLogin()

//Home Page true credit links that open in popup window
function popupHome(url)
{
  var opts = "location=no,status=no,titlebar=no,menubar=no,addressbar=no,scrollbars=yes,directories=no,resizable=no,screenX=0,screenY=0,toolbar=no,height=310,width=800, top=0, left=300";
  var hWnd = window.open(url,'mywindow', opts);
  hWnd.focus();
  return(false);
}

//popup for dispute wizard link
function disputeWizardWin(url) {
  var opts = "width=775,height=500,left=10,top=10,resizable=1,scrollbars=1,status=1,menubar=0,directories=0,location=0,toolbar=0";
  var hWnd = window.open(url,'DisputeOnlineWizard', opts);
  hWnd.focus();
}

//2006/11/01 pmackie@transunion.com
//fix footer for IE7.x
function footerFix() {
//alert('fixing IE7.x footer...');
    var divs = document.getElementsByTagName('div');
    for (var i=0; i < divs.length; i++) {
      if ('iw_component' == divs[i].className) {
        var hasPercentHeight = false;
        var elts = divs[i].childNodes;
        for (var j=0; !hasPercentHeight && (j<elts.length); j++) {
          if (1 == elts[j].nodeType) {
            var h = elts[j].getAttribute('height') || elts[j].style.height;
            if (-1 != h.indexOf('%')) hasPercentHeight = true;
          }
        }
        if (!hasPercentHeight) {
          var oldStyleHeight = divs[i].style.height;
          var expl = divs[i].offsetHeight;
          divs[i].style.height = 'auto';
          var auto = divs[i].offsetHeight;
          if (expl > auto) divs[i].style.height = oldStyleHeight;
        }
      }
    }
} //footerFix()

//2006/12/11 pmackie@transunion.com
//for IE7.x apply specific stylesheets
function flipCSS() {
  //array of stylesheet names:
  var aStyles=[{"origName" : "corporateCommon.css", 	"newName" : "corporateCommonWrap.css"},
			   {"origName" : "leftNav.css", 			"newName" : "leftNavWrap.css"},
			   {"origName" : "corporateBullets.css", 	"newName" : "corporateBulletsWrap.css"},
			   {"origName" : "promotion.css", 	        "newName" : "promotionWrap.css"},
			   {"origName" : "adsSplashStyle.css", 	"newName" : "adsSplashWrap.css"},
			   {"origName" : "transUnionHome1SEO.css", 	"newName" : "transUnionHome1SEOWrap.css"},
			   {"origName" : "topNav.css", 				"newName" : "topNavWrap.css"}];
//{"origName" : "form.css", 				"newName" : "formWrap.css"},
  for(var i=0; i<document.styleSheets.length; i++)
	for(var j=0; j<aStyles.length; j++) {
	  var sHref=document.styleSheets[i].href;
	  if(sHref.substr(sHref.lastIndexOf('/')+1)==aStyles[j].origName) {
		document.styleSheets[i].href=sHref.substring(0,sHref.lastIndexOf('/')+1)+aStyles[j].newName;
		break;
	  } //if
	} //for aStyles
} //flipCSS()

/*
//function to check screen resolution and if crazy, reposition footer component to cover background image
function checkScreenRes() {
	//alert( 'in checkScreenRes' );
}
*/
//2006/08/02 pmackie@transunion.com
//function to remove trailing questionmark in link URL
//this is a workaround for LiveSite generated links with $PAGE_LINK[page] token
function removeQuestionMark( url ) {
  var v_url = url;
  if( v_url.lastIndexOf("?")!=-1 && v_url.lastIndexOf("?") == ( v_url.length-1 ) ) {
    v_url = v_url.substr( 0, v_url.length-1 );
  } //if
  return v_url;
} //removeQuestionMark()

function formAbandonment() {
  var v_object = document.getElementById('loadFile'); //check if dynamic form
  if( v_object ) {
    //there should be only 1 form except for login and locale forms
	var forms = document.forms;
    for( var i=0; i<forms.length; i++) {
      if( forms[i].name != 'locale_form' && forms[i].name != 'login_form') {
        //alert( 'will track form: ' + forms[i].name );
        fc_form_track = forms[i].name + "}" + forms[i].name;
      } //if form
    } //for
  } //if v_object
} //formAbandoment()

//2006/08/25 pmackie@transunion.com
//FireClick tracking, following are tracked (what==>how):
//popups==>media, external links==>ad, documents==>download
function track(_link, type) {
  var v_url=_link.href;
  var v_name=_link.name;
  //if no friendly name exists, use href value
  if(v_name=="")v_name=v_url;
  //only allow type: ad, media, download. If ad, make sure the link is external
  if((type=='ad' && v_url.match(v_hostname)==null)
		|| type=='media' || type=='download'){pageTracker._trackEvent('Download',type,v_name);return fc_click(v_name, type);}
} //track()

//2007/01/10 pmackie@transunion.com
//same as track(), but URL is passed instead of link, used by LeftNav
function trackURL(sURL, sType) {
  if((sType=='ad' && sURL.match(v_hostname)==null)
	  || sType=='media' || sType=='download')fc_click(sURL , sType);
} //trackURL()

//===========================FONT SIZE CHANGE===========================
//2006/11/22 pmackie@transunion.com
function preloadFontChangeImages() {
  aDecrImages[0] = new Image(); aDecrImages[0].src = "/images/artifacts/iconDecreaseOff.gif";
  aDecrImages[1] = new Image(); aDecrImages[1].src = "/images/artifacts/iconDecrease.gif";
  aIncrImages[0] = new Image(); aIncrImages[0].src = "/images/artifacts/iconIncreaseOff.gif";
  aIncrImages[1] = new Image(); aIncrImages[1].src = "/images/artifacts/iconIncrease.gif";
} //preloadFontChangeImages()

//2006/12/07 pmackie@transunion.com
//if font size stored in Cookie, use it:
function initResize() {
  var sFontIndex=getCookie("TUFontSize");
  if(sFontIndex) {
	iFontIndex=sFontIndex;
	document.body.style.fontSize = aFontSizes[sFontIndex] + 'em';
	var sMax = String(aFontSizes.length-1);
	switch( sFontIndex ) {
	  case "0":
	    var oButton=document.getElementById("font-minus");
		if(oButton) { oButton.src = aDecrImages[0].src; oButton.style.cursor = "default"; }
	    break;
	  case sMax:
	    var oButton=document.getElementById("font-plus");
		if(oButton) { oButton.src = aIncrImages[0].src; oButton.style.cursor = "default"; }
	    break;
	} //switch sFontIndex
  } //if sFontIndex
} //initResize()

//2006/10/16 pmackie@transunion.com
//change font-size globally by increment/decrement of .15em
//the range is 2 down and 3 up from default of .625em, and offset is .09375em (.15em * .625)
function changeFontSize( oButton, sOtherButton ) {
  if( !document.body.style.fontSize ) document.body.style.fontSize = aFontSizes[iDefFontIndex] + 'em';
  var buttonName = oButton.name, oOtherButton = document.getElementById( sOtherButton );
  switch( buttonName ) {
	case "font-minus":
	  //iFontIndex = iFontIndex <= 1 ? 0 : --iFontIndex;
	  if(iFontIndex <= 1) {
		iFontIndex = 0;
	    oButton.src = aDecrImages[0].src;
	    oButton.style.cursor = "default";
	  } else {
		--iFontIndex;
	    oOtherButton.src = aIncrImages[1].src;
	    oOtherButton.style.cursor = "pointer";
	  } //if
	  break;
	case "font-plus":
	  //iFontIndex = iFontIndex >= aFontSizes.length -2 ? aFontSizes.length -1 : ++iFontIndex;
	  if(iFontIndex >= aFontSizes.length -2) {
		iFontIndex = aFontSizes.length -1;
	    oButton.src = aIncrImages[0].src;
	    oButton.style.cursor = "default";
	  } else {
		++iFontIndex;
	    oOtherButton.src = aDecrImages[1].src;
	    oOtherButton.style.cursor = "pointer";
	  }
	  break;
  } //switch buttonName
  document.body.style.fontSize = aFontSizes[iFontIndex] + 'em';
  storeInCookie( iFontIndex );
} //changeFontSize()

function storeInCookie( sFontIndex ) {
  //var expires = new Date(); expires.setFullYear(expires.getFullYear() + 1); setCookie("TUFontSize", sFontIndex, expires);
  setCookie("TUFontSize", sFontIndex, '', '/');
} //storeInCookie
//===========================END OF FONT SIZE CHANGE===========================

//===========================PRINTABLE PAGE===========================
//2006/11/15 pmackie@transunion.com
//change line-height css property by parameter
//for all printable divs
function changePrintableLineHeight( fOffset ) {
  var divs = document.getElementsByTagName("div");
  for( var i=0; i < divs.length; i++ ) {
    if( divs[i].attributes.getNamedItem("printable") )
	  if( divs[i].attributes.getNamedItem("printable").nodeValue == "true" ) {
		//FIX: line height chagne
	  } //if nodeValue == true
  } //for divs
} //changePrintableLineHeight()

//2006/10/28 pmackie@transunion.com
//prepare and print print-friendly page
function printPage( printTarget, isPrintAll ) {
  var url = document.URL;
  var title = "printablePage";
  var firstDelimiter = getFirstDelimiter( url );
  /*if target is "current" generate printable page
    otherwise call popWin with appended url
    the popup (or new window) will then call this function again on load
	with current target and appended print arguments */
  switch( printTarget ) {
	case "popup":
	  url += firstDelimiter + "isPrintAll=" + isPrintAll + "&isClosable=true";
	  popWin( url, title, 640, 480 );
	  break;
	case "new":
	  url += firstDelimiter + "isPrintAll=" + isPrintAll + "&isClosable=true";
	  popWin( url, title );
	  break;
	case "current":  //generate printer friendly page:
	  if( isPrintAll == "false" ) {
        document.body.style.backgroundImage="none";
        ascendPrintables();  //propagate printable attribute to parent iw-components
		disableLinks();  //IE6 allow clicking even on modal window
        //liveSite creates horizontal wrapper layout divs, f.ex: <div style="width:931px;">
        //loop through these, and check if any children are printable
        var currNode = document.getElementsByTagName("div")[0];  //1st div is always 1st layout div
        truncateDiv(currNode,625);
		if( navigator.userAgent.indexOf( 'MSIE' ) == -1 ) { //don't print header for IE (bug, fix!)
          createPrintHeader( currNode );  //create popup print header before currNode
		} //if !IE7
        var isRelatedLinks = checkRelatedLinks(); //this will determine width truncation
        //create a treeWalker object to walk through layout divs, and process nodes:
        var walker = document.createTreeWalker( currNode, NodeFilter.SHOW_ELEMENT, null, false );
        do {
	      if( currNode.tagName == "DIV" ) processPrintNode( currNode, isRelatedLinks );
        }  while( currNode = walker.nextSibling() );
        createPrintFooter();  //create popup print footer
	  } //if !isPrintAll
	  setTimeout(printAndClose, 1000);
	  break;
  } //switch target
} //printPage()

function printAndClose() {
  window.print();
  if(isClosable(document.URL)) self.close();
} //printAndClose()

function disableLinks() {
  for (var i=0;i < document.links.length;i++) document.links[i].onclick = retFalse;
} //disableLinks()
function retFalse () {
  return false;
} //retFalse()

//2006/10/18 pmackie@transunion.com
//check which part of current node is appropriate for printing
//hide the rest
function processPrintNode( currNode, isRelatedLinks ) {
  //if current node have printable elements check which ones
  //otherwise hide the whole node:
  if( containsPrintableDivs( currNode ) ) {
	truncateDiv(currNode,625);
	//found a printable, by default print the whole div layout node 
	//  except for explicitly defined non-printable descendants
	//  and printable images as text
	var iWidth = isRelatedLinks ? 705 : 625;
	truncateWidth (currNode,iWidth);
    var divs = currNode.getElementsByTagName("div");
	for( var i=0; i < divs.length; i++ ) {
	  if( divs[i].attributes.getNamedItem("printable") ) {
		var printableValue = divs[i].attributes.getNamedItem("printable").nodeValue;
        switch( printableValue ) {
	      case "false":
	        hideNodeTree( divs[i] );
	        break;
	      case "text":
			convertImageToText( divs[i] );
		    break;
		} //switch printableValue
	  } //if printable defined
	} //for divs
  } else {  //no printables in current node, hide the whole div layout node
	hideNodeTree( currNode );
  } //if containsPrintableDivs
} //processPrintNode();

//2006/10/18 pmackie@transunion.com
//check if current node has any printable div elements (descendants incl. self)
//i.e. elements with "printable=true" attribute
function containsPrintableDivs( currNode ) {
  if( currNode.attributes.getNamedItem("printable") ) {  //check self
	if( currNode.attributes.getNamedItem("printable").nodeValue == "true" ) {
	  return true;
	}
  } else { //check descendants
    var divs = currNode.getElementsByTagName("div");
	for( var i=0; i < divs.length; i++ ) {
	  if( divs[i].attributes.getNamedItem("printable") ) {
	    if( divs[i].attributes.getNamedItem("printable").nodeValue == "true" ) { 
		  return true;
		} //if printable true
	  } //if printable defined
	} //for divs
  } //if self/descendants
  return false;
} //containsPrintableDivs()

//2006/10/19 pmackie@transunion.com
//hide whole node tree (currNode and div descendants)
function hideNodeTree( currNode ) {
  currNode.style.display = "none";
  var divs = currNode.getElementsByTagName( "div" );
  for( var i=0; i < divs.length; i++ ) {
	divs[i].style.display = "none";
  } //for divs
} //hideNodeTree()

//2006/10/19 pmackie@transunion.com
//create custom print header based on popup template
//insert before currNode, which is 1st layout div
function createPrintHeader( currNode ) {
  //header consists of 3 main div wrappers:
  var headerDiv1 = document.createElement( "div" );
  var headerDiv2 = document.createElement( "div" );
  var headerDiv3 = document.createElement( "div" );
  headerDiv1.setAttribute( "style", "width:626px;" ); 
  headerDiv2.setAttribute( "style", "width:626px;" ); 
  headerDiv3.setAttribute( "style", "width:626px;" ); 
headerDiv1.innerHTML = '\n'
+  '<div style="clear: both; display: inline; float: left;">\n'
+    '<div style="display: inline; float: left;">\n'
+      '<div class="iw_component" style="clear: both; width: 600px; height: auto; display: inline; float: left;">\n'
+	    '<div id="header" printable="false">\n'
+          '<div class="headerPadding">\n'
+            '<div class="floatLeftImage">\n'
+              '<a name="'+v_hostname+'" class="imageLinkClass" target="_self" href="'+v_hostname+'" onClick="return false;"><img class="imageClass" title="TransUnion logo" alt="TransUnion logo" src="/images/global/logo1.gif"></a>\n'
+            '</div>\n'
+            '<div class="globalUtility">\n'
+              '<div class="globalUtilityLinkDiv">\n'
+                '<a name="javascript:self.close();" class="globalUtilityLink" target="_self" href="javascript:self.close();?" onClick="return false;">Close Window</a>\n'
+              '</div>\n'
+            '</div>\n'
+          '</div>\n'
+        '</div>\n'
+      '</div>\n'
+    '</div>\n'
+  '</div>\n';
headerDiv2.innerHTML = '\n'
+  '<div style="clear: both; display: inline; float: left;">\n'
+    '<div style="display: inline; float: left;">\n'
+      '<div class="iw_component" style="clear: both; width: 625px; height: auto; display: inline; float: left;"><img src="/images/artifacts/colorBlockDark.gif" alt="" style="border: 0px solid rgb(0, 0, 0);" height="30" width="625">\n'
+      '</div>\n'
+	'</div>\n'
+  '</div>\n';
headerDiv3.innerHTML = '\n'
+  '<div style="clear: both; display: inline; float: left; margin-top: 1px;">\n'
+    '<div style="display: inline; float: left;">\n'
+      '<div class="iw_component" style="clear: both; width: 625px; height: auto; display: inline; float: left;">\n'
+        '<div class="imageClass" printable="true">\n'
+          '<img style="margin: auto; display: block; position: relative; top: 0px;" title="" alt="" src="/images/artifacts/divider12.gif" height="6" width="625"></div>\n'
+        '</div>\n'
+      '</div>\n'
+	'</div>\n'
+  '</div>\n';
  document.body.insertBefore( headerDiv3, currNode );
  document.body.insertBefore( headerDiv2, headerDiv3 );
  document.body.insertBefore( headerDiv1, headerDiv2 );
}  //createPrintHeader()

//2006/10/19 pmackie@transunion.com
//create custom print footer based on popup template
//insert as last child of body
function createPrintFooter() {
  var footerDiv = document.createElement( "div" );
  footerDiv.setAttribute( "style", "width:626px;" ); 
  document.body.appendChild( footerDiv );
  footerDiv.innerHTML = '<div style="width:626px;">'
+ '<div style="clear:both;display:inline;float:left;margin-top:1px;">'
+   '<div style="display:inline;float:left;">'
+     '<div class="iw_component" style="clear:both;width:625px;height:40px;display:inline;float:left;">'
+       '<div id="footerPopup">'
+         '<hr class="footerDivider" />'
//+         '<div class="footerText">' + v_copyright +
//+         '</div>'
//+         '<div class="footerPipe">' + v_image + 
//+         '</div>'
+         footerLinks()
//+         '<div class="footerLinkDiv">'+v_site+'</div>'
//+         '<div class="footerLinkDiv">' + v_privacy + 
//+         '</div>'
//+         '<div class="footerLinkDiv">' + v_terms + 
//+         '</div>'
+       '</div>'
+     '</div>'
+   '</div>'
+ '</div>'
+ '</div>';
}  //createPrintFooter()

//read footer links from existing DOM and return as string
function footerLinks(){
	var sFooterLinks='', vType='link';
	var sInputElement = 'footerContent', j=1;
	//get 1st object:
	var oInputElement=document.getElementById(sInputElement+'Link'+j);
	if(!oInputElement){oInputElement=document.getElementById(sInputElement+'Body'+j);vType='body';}
	if(!oInputElement){oInputElement=document.getElementById(sInputElement+'Image'+j);vType='image';}	
	while(oInputElement){
	  switch( vType ) {
	    case "link":sFooterLinks+='<div class="footerLinkDiv">';break;
	    case "body":sFooterLinks+='<div class="footerText">';break;
	    case "image":sFooterLinks+='<div class="footerPipe">';break;
	  } //switch vType
		sFooterLinks+=oInputElement.innerHTML;
		sFooterLinks+='</div>'
    //get next object:
	  oInputElement=document.getElementById(sInputElement+'Link'+(++j));vType='link';
	  if(!oInputElement){oInputElement=document.getElementById(sInputElement+'Body'+j);vType='body';}
	  if(!oInputElement){oInputElement=document.getElementById(sInputElement+'Image'+j);vType='image';}	  
	} //while
  return sFooterLinks;
} //footerLinks()


//2006/10/20 pmackie@transunion.com
//loop through divs and images for oNode, and truncate their width property
//according to rules:
//for related links pages: if > 415 set to 415
//for non-related links pages: if > 626 set to 625
//
//also for divs: change left-margin property, if > 25 set to 25
function truncateWidth( oNode, sWidth ) {
  var objWidth = '', objMarginLeft = '';
  var divs = oNode.getElementsByTagName('div'); //truncate descendant divs
  for( var i=0; i < divs.length; i++ ) {
	truncateDiv(divs[i],sWidth);
    objMarginLeft = divs[i].style.marginLeft;
	if( objMarginLeft != '' && parseInt( objMarginLeft ) > 25 )
	  divs[i].style.marginLeft = 25 + "px";
  } //for divs
  var images = oNode.getElementsByTagName('img');
  for( var i=0; i < images.length; i++ ) {
	if( images[i].attributes.getNamedItem("width") ) {
      objWidth = images[i].attributes.getNamedItem("width").nodeValue;
      if(objWidth!='' && parseInt(objWidth)>626)images[i].attributes.getNamedItem("width").nodeValue = 625;
      else if(objWidth!='' && parseInt(objWidth)>415)images[i].attributes.getNamedItem("width").nodeValue = 415;
	} //if
  } //for images
} //truncateWidth()

function truncateDiv(oNode, sWidth) {
  if( oNode.attributes.getNamedItem("style") ) {
    objWidth = oNode.style.width;
    if(objWidth!='' && parseInt(objWidth)>sWidth) oNode.style.width = parseInt(sWidth) + "px";
  } 
} //truncateDiv()

//2006/10/20 pmackie@transunion.com
//loop through all divs with printable attribute and copy to parent iw_component
function ascendPrintables() {
  var divs = document.getElementsByTagName('div');
  for( var i=0; i < divs.length; i++ ) {
	if( divs[i].attributes.getNamedItem("printable") )
	  ascendPrintable( divs[i], divs[i].attributes.getNamedItem("printable").nodeValue );
  } //for divs
}  //ascendPrintables()

//2006/10/20 pmackie@transunion.com
//copy printable attribute to iw-component parent div (if exists):
//by default copy printable value as is, exception is "text" value which copies as "true"
function ascendPrintable( oNode, printable ) {
  //create a treeWalker object to find oNode's parent
  var walker = document.createTreeWalker( oNode, NodeFilter.SHOW_ELEMENT, null, false );
  var parentNode = walker.parentNode();
  if( parentNode.tagName == "DIV" && parentNode.attributes.getNamedItem("class") ) {
	if( parentNode.attributes.getNamedItem("class").nodeValue == "iw_component" ) {
	  if( printable == "text" ) printable = "true";
      parentNode.setAttribute( "printable", printable );
	} //if iw_component
  } //if DIV
} //ascendPrintable()

//2006/11/01 pmackie@transunion.com
//convert image inside oNode to text
function convertImageToText( oNode ) {
  var sText = "NO ALT TEXT DEFINED";
  var images = oNode.getElementsByTagName( "img" ); //should have only 1 image
  if( images[0].attributes.getNamedItem("alt") )
	sText = images[0].attributes.getNamedItem("alt").nodeValue;  //retrieve text from alt
  //create textDiv and replace image div with it:
  var textDiv = document.createElement( "div" );
  //textDiv.setAttribute( "style", "margin-top: 25px;" ); 
  oNode.parentNode.replaceChild( textDiv, oNode );
  textDiv.innerHTML = '<h1 style="padding-left:25px; margin-top:25px;">' + sText + '</h1>'
+ '<div style="width:1px; height:20px;">'
+ '<img src="/images/global/spacer.gif" />';
+ '</div>';
} //convertImageToText()

//2006/10/20 pmackie@transunion.com
//check if page has at least 1 related links component
function checkRelatedLinks() {
  var divs = document.getElementsByTagName('div');
  for( var i=0; i < divs.length; i++ ) {
	if( divs[i].attributes.getNamedItem("class") ) {
	  if( divs[i].attributes.getNamedItem("class").nodeValue.indexOf( "relatedLinks" ) != -1 )
	    return true;
	} //if class
  } //for divs
  return false;
}  //checkRelatedLinks()

//2006/10/30 pmackie@transunion.com
//check if a questionmark exists already in passed url
//if yes, return "&", otherwise return "?"
function getFirstDelimiter( url ) {
  return (url.indexOf("?")!=-1) ? "&" : "?";
} //getFirstDelimiter

//2006/10/30 pmackie@transunion.com
//check passed url has "isClosable=true" argument pair
function isClosable( url ) {
  return (url.match("isClosable=true")!=null) ? true : false;
} //isClosable()

//2006/10/30 pmackie@transunion.com
//check if passed url has "isPrintAll="
function isPrintable( url ) {
  return (url.match("isPrintAll=")!=null) ? true : false;
} //isPrintable()

//2006/10/30 pmackie@transunion.com
//get isPrintAll value from url arguments
//return null if non-existent
function getPrintAllValue( url ) {
  var printPos = url.indexOf( "isPrintAll=" );
  if( printPos != -1 ) {
    var args = url.substr( printPos );
	if( args.match( "&" ) != null ) args = args.substring( 0,  args.indexOf( "&" ) );
	return args.substr( args.indexOf( "=" ) + 1 );
  } //if isPrintAll
  return null;
} //getPrintAllValue()
//===========================END OF PRINTABLE PAGE===========================

//2009/07/23 ssaxena@transunion.com
//used to dynamically append the url parameter as a hidden input type value in the login form onload 
function getParameter()
{
	var url=document.location.search;
	var value="";var param="";var paramArr=new Array();
	url=url.substring(1,url.length);
	if(url.indexOf("isNewUser") != -1 || url.indexOf("recertAuthString") != -1)
	{
		var arr=url.split("&");
		for(var i=0;i<arr.length;i++)
		{
			paramArr=arr[i].split("=");
			param=paramArr[0];
			if(param == "isNewUser" || param == "recertAuthString")
			break;
		}
		value=paramArr[1];
		var objForm=document.getElementsByName("login");
		var objInput=document.createElement("input");
		objInput.type="hidden";
		objInput.name=param;
		objInput.value=value;
		objForm[0].appendChild(objInput);
	}
}//getParameter

function referrerGetCookie() {
  var sRef=getCookie("TUReferrer");
  if(sRef) {  
	return sRef;	
  } //if sFontIndex
} //initResize()
