// 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';

// 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');
}
/*
document.write('<!-- Ahrq footer section -->');
var viewPos = document.cookie.indexOf("view=");
var patientView = document.cookie.indexOf("ps");
var hitspView = document.cookie.indexOf("hitsp");
var mumView = document.cookie.indexOf("mum");
var apcdView = document.cookie.indexOf("apcd");
if (patientView!=viewPos+5){
    patientView=-1;
}*/
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.html?system=hitsp&Referer=Index">HITSP Portal Home</a> | ');
} else if (pageSystem == PORTAL_COMMON_FORMATS){
    document.write('<a href="index.html?system=ps&Referer=Index">PSO Common Formats Home</a> | ');
}else if (pageSystem == PORTAL_MUMM){
    document.write('<a href="index.html?system=mum&Referer=Index">MUM Portal Home</a> | ');
}else if (pageSystem == PORTAL_STATE_ALL_PAYERS){
    document.write('<a href="index_apcd.html?system=apcd&amp;referrer=index">States\'s All-Payer Claims Database Home</a> | ');
} else {
    document.write('<a href="index.html?system=mdr&Referer=Index">USHIK Home</a> | ');
    document.write('<a href="models.html?&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.html?Referer=Reports" class="footer_navlink">Reports</a> | ');
    document.write('<a href="help.html?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.html?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 button to navigate to source organization Point of Contact.');
document.write('</p>');
document.write('</div>');
document.write('</center>');
document.write('<!-- End of Footer links section -->');
