
//detect browser
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;

function setDivText(div, text)
{
    if (isNS4){
        document.layers[div].document.open();
        document.layers[div].document.write(text);
        document.layers[div].document.close();
    }
    else if (isIE4) {
       document.all[div].innerHTML = text;
    }
    else if (isIE5 || isNS6) {
       document.getElementById(div).innerHTML = text;
    }
}

var navbar = new Array ( 'map.htm', 'contents', 'index.htm', 'about', 'services.htm', 'services', 'gallery.htm', 'gallery', 'quotes.htm', 'quotes', 'faq.htm', 'faq', 'links.htm', 'links', 'contact.htm', 'contact' );
    
function printNavBar(me)
{
   document.writeln( '<hr>' );
   document.writeln( '<p>' );
   for ( var i = 0; i < navbar.length/2; i++ )
   {
		if ( navbar[i*2+1] != me )
		{
			document.write( '<a href="' + navbar[i*2] + '">' + navbar[i*2+1] + '</a>' );
		}
		else
		{
			document.write( navbar[i*2+1] );
		}
		if ( i < navbar.length/2-1 )
		{
			document.write( '&nbsp;&nbsp;&nbsp;' );
		}
   }
   document.writeln();
   document.writeln( '</p>' );
   document.writeln( '<hr>' );
}

function printFooter()
{

   document.writeln( '<p><em>Mandy Oldroyd - 28<sup>th</sup> March, 2009</em> <br>' );
   document.writeln( '  <font size=-2>Site design by Ian Oldroyd</font></p>' );
   document.writeln();
   document.writeln( '<noscript>' );
   document.writeln( '<hr>' );
   document.writeln( '<p>Your browser does not support JavaScript.' );
   document.writeln( '<br>This means that you will be unable to view the galleries and the FAQ page.' );
   document.writeln( '<br>You may still view the rest of site, but your experience will be somewhat curtailed.' );
   document.writeln( '</noscript>' );

}

function printEmail(who)
{
	var mailString = who	+ '@'	+ 'mandy' + 'oldroyd' + '.' + 'com';
	document.write(mailString);
}

function printMailtoTag(who)
{
	document.write('<a href="mailto:' );
	printEmail(who);
	document.write('">' );
	printEmail(who);
	document.write('</a>' );
}

function printRecipientField(who)
{
	document.write('<input type="hidden" name="recipient" value="' );
	printEmail(who);
	document.write('">' );
}

