// PORTALS defined:
var PORTAL_MDR = 'mdr';
var PORTAL_HITSP = 'hitsp';
var PORTAL_COMMON_FORMATS = 'ps';
var PORTAL_MUMM = 'mum';
var PORTAL_STATE_ALL_PAYERS = 'apcd';
// new S&I Portal added on 08/23/2011
var PORTAL_SI = 'si';

// define the window location and default portal:
var pageURI = new URI(window.location);
var pageSystem = PORTAL_MDR;

// look to the URI to find the system:
if(pageURI.getData('system') != undefined){
    pageSystem = pageURI.getData('system');
} else if(pageURI.getData('System') != undefined){
    pageSystem = pageURI.getData('System');
}

var showFooter = pageURI.getData('newTemplate') != '1';
if(showFooter){
    document.write('<div id="footer">');
    document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
    document.write('<tbody>');
    document.write('<tr>');
    document.write('<td background="images/bottom_ahrq_bkg.jpg" width="125"><img src="images/bottom_ahrq_1.jpg" alt="AHRQ" width="125" /></td>');
    document.write('<td background="images/bottom_ahrq_bkg.jpg" width="100%"><img src="images/bottom_ahrq_bkg.jpg" alt=" " height="34" width="10" /></td>');
    document.write('<td background="images/bottom_ahrq_bkg.jpg" width="310"><img src="images/bottom_ahrq_2.gif" alt="Advancing Excellence in Health Care" height="34" width="310" /></td>');
    document.write('</tr>');
    document.write('</tbody>');
    document.write('</table>');
    document.write('<!-- Footer links section -->');
    document.write('<center>');
    document.write('<div id="banner_Footer2">');
    document.write('<p>');

    if (pageSystem == PORTAL_HITSP ){
        document.write('<a href="index_hitsp.jsp?system=hitsp&Referer=Index">HITSP Portal Home</a> | ');
    } else if (pageSystem == PORTAL_COMMON_FORMATS){
        document.write('<a href="dr.ui.drPSFormsListing_Page?system=ps">PSO Common Formats Home</a> | ');
    }else if (pageSystem == PORTAL_MUMM){
        document.write('<a href="dr.ui.drMeasureListing_Page?system=mum">MUM Portal Home</a> | ');
    }else if (pageSystem == PORTAL_STATE_ALL_PAYERS){
        document.write('<a href="index_apcd.jsp?system=apcd&amp;referrer=index">States\' All-Payer Claims Database Home</a> | ');
    }else if (pageSystem == PORTAL_SI){
        document.write('<a href="index_si.jsp?system=si&Referer=Index">S&amp;I Portal Home</a> | ');
        
    }else{
        document.write('<a href="index.jsp?system=mdr&Referer=Index">USHIK Home</a> | ');
        document.write('<a href="models.jsp?&system=mdr&Referer=Models" class="footer_navlink">Models</a> | ');
        document.write('<a href="dr.ui.drCriteriaSearch?system=mdr&Referer=Advanced" class="footer_navlink">Advanced Search</a> | ');
        document.write('<a href="reports.jsp?Referer=Reports" class="footer_navlink">Reports</a> | ');
        document.write('<a href="help.jsp?Referer=Help" class="footer_navlink">Help</a> | ');
        document.write('<a href="login.html?Referer=Login" class="footer_navlink">Login</a> | ');
        document.write('<a href="whats_new.jsp?Referer=What" class="footer_navlink">What&#39;s New in USHIK</a><br /> ');
        
    }
    document.write('<a href="http://www.usdoj.gov/oip/index.html" class="footer_navlink">Freedom of Information Act</a> | ');
    document.write('<a href="http://www.ahrq.gov/news/privacy.htm" class="footer_navlink">Privacy Policy</a> | ');

    document.write('<a href="http://www.hhs.gov" class="footer_navlink">U.S. Department of Health &amp; Human Services</a> | <a href="http://www.whitehouse.gov" class="footer_navlink">The White House</a> |');
    document.write('<a href="http://www.usa.gov" class="footer_navlink">USA.gov: The U.S. Government&#39;s Official Web Portal</a>');
    document.write('</p>');
    document.write('</div>');
    document.write('<div id="banner_Footeraddress">');
    document.write('<p style="font-family:Arial;font-size:11;font-weight:normal;">Disclaimer: The source organization is the Authoritative Source for data element information.<br />For contact information use the Organizations link in the menu to navigate to the source organization\'s Point of Contact.');
    document.write('</p>');
    document.write('</div>');
    document.write('</center>');
    document.write('<!-- End of Footer links section -->');
}
