function renderLoginLogout(loginURL, logoutURL){
    if(checkCardMember()){
        document.write('<div id="iNavLogoutButton">');
        document.write('<span class="iNav_btnLeftDoor iNav_orangeLeftDoor"><\/span>');
        document.write('<a class="iNav_btnCenterBackground iNav_orangeButtonCenter" href="'+logoutURL+'" onclick="javascript:iNavLogOut();">');
        document.write('<span class="iNav_btnCenterText iNav_orangeButtonText"> ');
        document.write(iNavLogoutPrompt);
        document.write(' <\/span>');
        document.write('<\/a>');
        document.write('<span class="iNav_btnRightDoor iNav_orangeRightDoor"><\/span>');
        document.write('<\/div>');
    } else {
        document.write('<div id="iNavLoginButton">');
        document.write('<span class="iNav_btnLeftDoor iNav_yellowLeftDoor"><\/span>');
        document.write('<a class="iNav_btnCenterBackground iNav_yellowButtonCenter" href="'+loginURL+'" onclick="javascript:iNavLogIn();">');
        document.write('<span class="iNav_btnCenterText iNav_yellowButtonText"> ');
        document.write(iNavLoginPrompt);
        document.write(' <\/span>');
        document.write('<\/a>');
        document.write('<span class="iNav_btnRightDoor iNav_yellowRightDoor"><\/span>');
        document.write('<\/div>');
    }
}


function iNavLogIn(){
	if (typeof iNav_LOGIN_URL != 'undefined') window.location.href=iNav_LOGIN_URL;
	else window.location.href="http://www.americanexpress.com";
}	

function iNavLogOut(){
	if (typeof iNav_LOGOUT_URL != 'undefined') window.location.href=iNav_LOGOUT_URL;
	else window.location.href="http://www.americanexpress.com";
}	

//////////////////////////////////////////// SEARCH //////////
function addSearchForm(){
        //<form name="iNav_Form" id="iNav_Form"><input id="iNav_textbox" type="hidden"/></form>
    var searchForm = document.createElement("form"); 
    searchForm.setAttribute('id', 'iNav_Form');
    searchForm.method="POST";
    var searchBox = document.createElement("input"); 
    searchBox.setAttribute('id', 'iNav_textbox');
    searchBox.setAttribute('type', 'hidden');
    searchForm.appendChild(searchBox);
    document.body.appendChild(searchForm);
}

function iNavSearchFunction(sw) {
	sw = sw.replace(/^[\s]+/,"");
	var theBox = document.getElementById('iNav_textbox');
	theBox.value = sw;
	if(sw==""){
		alert(iNav_SearchNothingEntered);
		theBox.focus();
		return false;
	}
	else {
		//these are in the footer to eliminate spacing issues
		theBox.value=sw;
    	document.getElementById('iNav_Form').action=iNav_SEARCH_URL+"?p_search_text="+sw;
		document.getElementById('iNav_Form').submit();
		return true;
	}
}