// Write 360tg banner if not within frame.

if (window.top==window.self) {
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="575">');
	document.write('<a href="http://www.360travelguide.com/"><img src="grafix/banner.jpg" width="575" height="72" alt="360TravelGuide.com, leaders in interactive travel information" border="0" name="banner"></a>');
	document.write('</td><td align="left" style="background: #9999cc url(grafix/banner_back.jpg)" valign="top">');
	document.write('<img src="blank.gif" width="60" height="30" alt="" border="0"><br clear="all">');
	document.write('<!-- SiteSearch Google --><form method="get" action="search2.asp" target="_top" class="close">');
	document.write('<div><input type="hidden" name="cx" value="014900305735567323056:hrbu6p58o88" />');
	document.write('<input type="hidden" name="cof" value="FORID:9" />');
	document.write('<input type="hidden" name="ie" value="UTF-8" />');
	document.write('<input type="text" name="q" size="21" />');
	document.write('<input type="submit" name="sa" value="GO" class="btn" /></div>');
	document.write('<!-- SiteSearch Google -->');
	document.write('</td></tr></table>');
	document.write('<script type="text/javascript" src="http://www.google.com/jsapi"></script>');
	document.write('<script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>');
	document.write('<script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script>');
	document.write('<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>');
}

//Establish current filename
cur_file_url = document.URL;
path_elements = cur_file_url.split("/");
i = path_elements.length - 1;
cur_filename = path_elements[i];

// Read blog data from blogs.xml
var blog_xml=null;
if (window.ActiveXObject)
    {// code for IE
    blog_xml=new ActiveXObject("Microsoft.XMLDOM");
} else if (document.implementation.createDocument)
        {// code for Mozilla, Firefox, Opera, etc.
        blog_xml=document.implementation.createDocument("","",null);
        }
        else
        {
	        alert('Your browser cannot handle this script');
        }
    if (blog_xml!=null)
    {
	blog_xml.async=false;
	blog_xml.load("blogs.xml");

// Find blog file name in xml
    var blogfiles=blog_xml.getElementsByTagName("FILENAME");
    checkfile: for (i=0;i<blogfiles.length;i++) {
    	if (blogfiles[i].childNodes[0].nodeValue == cur_filename) {
			curfile_index = i;
    		break checkfile;
		}
    }
// Establish blog group and number of blogs, get current, next and previous blog titles
	bloggroup = blogfiles[curfile_index].parentNode.parentNode;
	var blogs_in_group = bloggroup.getElementsByTagName("BLOG");
	var number_of_blogs = blogs_in_group.length
	var grouptitle = bloggroup.getElementsByTagName("GROUPTITLE");
	var blogtitle = bloggroup.getElementsByTagName("SUBTITLE");
	var blogfile = bloggroup.getElementsByTagName("FILENAME");
    checkfile: for (i=0;i<blogs_in_group.length;i++) {
		if (i > 0) {
			prev_title = blogtitle[i-1].childNodes[0].nodeValue;
		}
		if (blogfile[i].childNodes[0].nodeValue == cur_filename) {
			cur_title = blogtitle[i].childNodes[0].nodeValue;
			curfile_index = i;
    		break checkfile;
		}
	}
	if (curfile_index < (blogs_in_group.length-1)) {
		next_title = blogtitle[i+1].childNodes[0].nodeValue;
	}
// Write breadcrumb trail
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td align="left">');
	document.write('<a href="http://www.360travelguide.com/" class="breadcrumb">Home</a> &gt; ');
	document.write('<a href="blog.asp" class="breadcrumb">TravelBlogs</a> &gt; ');
	document.write(grouptitle[0].childNodes[0].nodeValue + ' ' + cur_title + '</td><td align="left">');
// Write prev and next blog links	
	if (curfile_index > 0) {
		i = curfile_index - 1;
		document.write('<a href="' + blogfile[i].childNodes[0].nodeValue + '" class="breadcrumb">&lt;&lt;' + prev_title + '</a> ');
	}
	if (curfile_index < (blogs_in_group.length-1)) {
		i = curfile_index + 1;
		document.write(' &nbsp;&nbsp;<a href="' + blogfile[i].childNodes[0].nodeValue + '" class="breadcrumb">' + next_title + '&gt;&gt;</a> ');
	}
	document.write('</td></tr></table>');

}
