//Utility functions to be included in all USPS national pages
//  
function setGlobalNav(url,txt){
document.write('| <A href=\"http://www.usps.org/\">Home</A>');
//document.write('| <A href=\"http://www.usps.org/newpublic2/index.html\">Home</A>');
document.write('| <A href=\"http://www.usps.org/newpublic2/about.html\">About USPS</A>');
document.write('| <A href=\"http://www.usps.org/newpublic2/boating.html\">Boating Info</A>');
if(url.length > 0) {
  document.write('|<A href="' + url + '">' + txt + '</A>');
} 
document.write('| <A href=\"http://www.usps.org/newpublic2/sitex.html\">Site Index</A>');
document.write('| <a href =\"http://www.usps.org/newpublic2/howto.html\">How Do I...|</A>');
}

function osetSearch(){
document.write('<div id="search">');
document.write('<form action="/cgi-bin/nsearch.cgi?national" method="POST">');
document.write('<input type="hidden" name="simple" value="simple"><center>');
document.write('<label>Site Search </label>');
document.write('<input type="text" size="20" name="search1" value="Search for..." onFocus="if(this.value==\'Search for...\')this.value=\'\';" >');
document.write('<input type="submit" value="Search"> <input type="reset" value="Clear">');
document.write('</center>');
document.write('</form>');
document.write('</div>');
}
function setGlobalNav2(url,txt){
var u = url + " ";
var t = txt + " ";

s = '| <A href=\"http://www.usps.org/\">Home</A>\n';
//document.write('| <A href=\"http://www.usps.org/national/natsec/newhome/index.html\">Home</A>');
s += '| <A href=\"http://www.usps.org/national/natsec/newhome/about.html\">About USPS</A>\n';
s += '| <A href=\"http://www.usps.org/national/natsec/newhome/boating.html\">Boating Info</A>\n';
if(u.length > 0) {
  s += '|<A href="' + u + '">' + t + '</A>\n';
} 
s += '| <A href=\"http://www.usps.org/national/natsec/newhome/sitex.html\">Site Index</A>\n';
s += '| <a href =\"http://www.usps.org/national/natsec/newhome/howto.html\">How Do I...|</A>\n';
alert(s);
document.write(s);
}

//4 Apr 2007 - added sx parameter to facilitate adjusting for 120DPI vs 96DPI
//			 - larger width of "search" div is detected and number of characters
//			 - reduced from 20 to 15.
function getSearch2(sx){
//s = '<div id="search">\n';
s = '<form action="/cgi-bin/nsearch.cgi?national" method="POST">\n';
s += '<input type="hidden" name="simple" value="simple"><center>\n';
s += '<label>Site Search </label>\n';
s += '<input type="text" size="';
s += sx;
s += '" name="search1" value="Search for..." onFocus="if(this.value==\'Search for...\')this.value=\'\';" >\n';
s += '<input type="submit" value="Search"> <input type="reset" value="Clear">\n';
s += '</center>\n';
s += '</form>\n';
s += '</div>\n';
//alert(s);
//document.write(s);
return s
}
// 9 Jan 2008 - added Google Search
function getSearch3(sx){
s = '<!-- Google CSE Search Box Begins  -->\n';
s += '<form action="http://www.usps.org/newpublic2/search.htm" id="searchbox_011540401323218179971:ar8e5zzw5re">\n';
s += '<input type="hidden" name="cx" value="011540401323218179971:ar8e5zzw5re" />\n';
s += '<input type="hidden" name="cof" value="FORID:11" />\n';
s += '<input type="text" name="q" size="'
s += sx;
s += '" />\n';
s += '<input type="submit" name="sa" value="Search" />\n';
s += '</form>';
s += '<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_011540401323218179971%3Aar8e5zzw5re&lang=en">\n';
s += '</script>\n';
s += '<!-- Google CSE Search Box Ends -->\n';
return s;
}

function setSearch(){
var d = document.getElementById("search");
var s = "15";
if(d.offsetWidth > 158) s = "25";

//alert(d.innerHTML);
d.innerHTML = getSearch3(s);
//alert(d.innerHTML);
}