// Quicknav
var quicknav = '' +
// quick_nav_id        ! Hot Text               ! Destination URL                  '  parser
//---------------------!------------------------!----------------------------------'-----------
' contactus            ! contact us             ! about_us/contactinfo.htm         '  + sep +
' officehours          ! office hours           ! about_us/officehours.htm         '  + sep + 
' quickmap             ! quick map              ! about_us/quickmap.htm            '  + sep + 
' parking              ! parking                ! about_us/parking.htm             '    ;

// GoodHealth Slogans
var slogan = new Array();
slogan[0]  = 'We are here to provide you with the best health services possible';
slogan[1]  = 'We dedicate ourselves to learning new ways of understanding and supporting the human body and spirit';
slogan[2]  = 'We honor the innate potential of every human being without predjudice or discrimination';
slogan[3]  = 'Our focus is on teaching each person to take responsibility for their health';
slogan[4]  = 'We wish to assist each person back to health, rather than manipulate them into it';
slogan[5]  = 'We are called upon to serve others, and we do this willingly';
slogan[6]  = 'We hope that you will come to know the true value of natural chiropractic health care';

var randomNum;
function HealthSlogan() {
	randomNum = Math.floor(Math.random()*slogan.length);
    document.write(slogan[randomNum]);
}

function TopNavOver(ele) {
	if (ns4) { 
		eval('document.ids.'+ele+ '_fl.color = \"#003366\"'); 
		eval('document.ids.'+ele+ '_rl.color = \"#003366\"'); 
	}
	if (ns6) {
		eval('document.getElementById(\'' + ele + '_fl' + '\').style.color = "#003366"');
		eval('document.getElementById(\'' + ele + '_rl' + '\').style.color = "#003366"');		
	} else {
		eval('document.all.'+ele+ '_fl.style.color = \"#003366\"');
		eval('document.all.'+ele+ '_rl.style.color = \"#003366\"');
	}
}
function TopNavOff(ele) {
	if (ns4) { 
		eval('document.ids.'+ele+ '_fl.color = \"#336699\"'); 
		eval('document.ids.'+ele+ '_rl.color = \"#336699\"'); 
	}
	if (ns6) {
		eval('document.getElementById(\'' + ele + '_fl' + '\').style.color = "#336699"');
		eval('document.getElementById(\'' + ele + '_rl' + '\').style.color = "#336699"');		
	} else {
		eval('document.all.'+ele+ '_fl.style.color = \"#336699\"');
		eval('document.all.'+ele+ '_rl.style.color = \"#336699\"');
	}
}
//=====================================================================================

// Left Nav Pic

function LeftNavPic() {

  if (i < url.indexOf('about_us')) {
	document.write('<img src="'+relpath+'images/pics/about_us.jpg"');
  }
  else if (i < url.indexOf('appointments')) {
	document.write('<img src="'+relpath+'images/pics/appointments.jpg"');  
  }
  else if (i < url.indexOf('info')) {
	document.write('<img src="'+relpath+'images/pics/info.jpg"');  
  }
  else if (i < url.indexOf('products')) {
	document.write('<img src="'+relpath+'images/pics/products.jpg"');  
  }
  else if (i < url.indexOf('services')) {
	document.write('<img src="'+relpath+'images/pics/services.jpg"');  
  }
  else {
	document.write('<img src="'+relpath+'images/pics/home.jpg"');  
  }   
  document.write(' width="138" height="95">');     
}

//=====================================================================================

// Create a method for trimming
String.prototype.normalize = function()
{
  return this.replace( /^\s+/g , '' ).replace( /\s+$/g , '' ).replace( /\s+/g , " " ) ;
}

// Build Left Navigation function
function LeftNav(theNav) {
    if (theNav != '!!' || '') {
	var aleftnav = theNav.split(sep);
	//document.write('&nbsp;<br>');
	// Insert top of left navigation 
	for (var i = 0; i < aleftnav.length; i++) {
		var result = aleftnav[i].split('!');
		var id     = result[0].normalize(); 
		var text   = result[1].normalize();
		var dest   = result[2].normalize();
		if (text.indexOf('~') > -1) { text = text.replace('~',nl) }
		if (id == secondary_nav_id) { state = 'navon'; }
		else { state = 'nav' }
		document.write('<a id="'+ id +'" class="'+state+'" href="'+
		(( dest.indexOf('http') > -1 ) ? dest + '" target="_blank' : relpath+subdir+'/'+dest ) +'">'+text+'</a>' +nl);
		}
	}
}    


// Global Navigation
function GlobalNav(theNav) {
	var aglobalnav = theNav.split(sep);
	// Insert top of global navigation 
	for (var i = 0; i < aglobalnav.length; i++) {
		var result = aglobalnav[i].split('!');
		var id     = result[0].normalize();
		var text   = result[1].normalize();
		var dest   = result[2].normalize();
		document.write('<a id="'+id+'_global" href="'+relpath+dest+'" onmouseover="TopNavOver(\''+id+'\')" onmouseout="TopNavOff(\''+id+'\')"><span class="topnavletter" id="'+id+'_fl">'+text.charAt(0).toUpperCase()+'</span><span class="topnavsmall" id="'+id+'_rl">'+text.substring(1,text.length).toUpperCase()+'</span></a>');
		if (i < aglobalnav.length - 1) { document.write('<img src="'+relpath+'images/design/topnavdia.gif" width="12" height="13" hspace="5">'); }		
	}
}

// Build Quick Navigation function
function QuickNav(theNav) {
    if (theNav != '!!' || '') {
	var aleftnav = theNav.split(sep);
	//document.write('&nbsp;<br>');
	// Insert top of left navigation 
	for (var i = 0; i < aleftnav.length; i++) {
		var result = aleftnav[i].split('!');
		var id     = result[0].normalize(); 
		var text   = result[1].normalize();
		var dest   = result[2].normalize();
		state      = "quicknav"
		document.write('<a id="'+ id +'" class="'+state+'" href="'+relpath+dest+'">'+text+'</a>' +nl);
		}
	}
}


// Footer Navigation (note year is a variable)
var date = new Date();
var year = date.getFullYear();
function FooterNav(theNav) {
	var afooternav = theNav.split(sep);
	document.write('<p><img src="'+relpath+'images/spacer.gif" width="1" height="3" alt="" border="0"><hr align="center" noshade size="1" width="100%" color="#336699"><div align="center" class="footer">');
	// Insert top of global navigation 
	for (var i = 0; i < afooternav.length; i++) {
		var result = afooternav[i].split('!');
		var id     = result[0].normalize();
		var text   = result[1].normalize(); 
		var dest   = result[2].normalize();
		if (id == global_nav_id) { state = 'navfooter'; }
		else { state = 'footer' }
		document.write('<a class="'+state+'" href="'+relpath+dest+'">'+text+'</a>')
		if (i < afooternav.length) { document.write(' | ') }				
	}
	document.write('<a href="'+relpath+'home.htm" class="footer">home</a>');	
	document.write(' | <a href="#top" class="footer">top of page</a><br>');
	document.write('<p class="footer">Copyright &copy; '+year+' Roosevelt Chiropractic<br>About your <a class="footer" href="'+relpath+'privacy.htm">Privacy</a> | Please read our <a class="footer" href="'+relpath+'disclaimer.htm">Disclosure Form</a><br><img src="'+relpath+'images/spacer.gif" width="1" height="5" border="0"><br><a class="footer" href="'+relpath+'info/siteby.htm">Site design by</a><br>&nbsp;</div>');
}	

// Footers
Footerhome = '<P ALIGN="center" CLASS="footer">' +
'Copyright &copy; ' +year+ ' Washington Physicians for Social Responsibility<BR>Digital Imagery &copy; Copyright ' +year+ ' WPSR and PhotoDisc, Inc.<BR>' + '<A HREF\=' + 'mailto:wpsr@wpsr.org\ CLASS="footer">' + 'wpsr@wpsr.org</A><br>&nbsp;'


// Build the "Also In This Section" Navigation function
function AlsoNav(theNav) {
	var aleftnav = theNav.split(sep);
	document.write('<table align="right" width="150" cellspacing="0" cellpadding="2" border="1" bordercolor="#9999cc">' +
'<tr><td bgcolor="#9999cc" class="white" align="center">ALSO IN THIS SECTION</td></tr>' +
'<tr><td><table border="0" cellpadding="2" cellspacing="0" width="100%">');
	// Insert top of left navigation 
	for (var i = 0; i < aleftnav.length; i++) {
		var result = aleftnav[i].split(':');
		var id     = result[0].normalize();
		var text   = result[1].normalize();
		var url    = result[2].normalize();
		if (id == tertiary_nav_id) { state = 'tertnavstate'; }
		else { state = 'tertnav' }
		document.write('<tr><td><a class="'+state+'" href="'+url+'">'+text+'</a></td></tr>');
	}
	document.write('</table>' + '</td></tr></table><span class="body">');
}

// This text determines the widths of the 3 main columns on each page
var interiorspacer = '' +
'<tr>' +
	'<td><img src="' + relpath + 'images/spacer.gif" width="145" height="1" alt="" border="0"></td>' +
	'<td><img src="' + relpath + 'images/spacer.gif" width="35" height="1" alt="" border="0"></td>' +
	'<td><img src="' + relpath + 'images/spacer.gif" width="420" height="1" alt="" border="0"></td>' +
'</tr>';
