var url=unescape(document.location); 
var mainurlstart="";
if(url.indexOf('/adriana/')!=-1){
	mainurlstart=url.indexOf('krattbrothers/')+14;
}
if(url.indexOf('Site/')!=-1){
	mainurlstart=url.indexOf('Site/')+5;
}
if(url.indexOf('209.250.131.66')!=-1 || url.indexOf('development.decode-ent.com')!=-1){
	mainurlstart=url.indexOf('krattbrothers/')+14;
}
if(url.indexOf('krattbrothers.com')!=-1){
	mainurlstart=url.indexOf('krattbrothers.com/')+18;
}


var structure=url.substr(mainurlstart);

var navigation="";
navigation+='<b>';

var directories=structure.split("/");
for(i=0; i<=directories.length; i++){
	if(i==0){
		var level=getlevel(directories.length-1);
		navigation+='<a href="'+level+'main.html">Home</a> > ';	
	}
	if(i>0 && i!=directories.length){
		var level=getlevel(directories.length-i);
		var mylink=getlink(directories[i-1]);
		if(directories[i]!="index.html"){
			if(directories[i]=="survey.html"){
				navigation+="<a href='../creatureheroes/index.html'>Creature Heroes</a> > <a href='../paw/index.html'>Creature Paw</a> > ";
			}else{
				navigation+='<a href="'+level+mylink[0]+'">'+mylink[1]+'</a> > ';	
			}
		}else{
			navigation+=mylink[1];	
		}
	}
	if(i==directories.length ){
		var mylink=getlink(directories[i-1]);
		if(mylink[1]!="index.html"){
			navigation+=mylink[1];	
		}
	}
}

navigation+='</b>';
document.write(navigation);

/////////////////////////////////////////////////
function getlevel(thislength){
var level="";
	for(j=0; j<thislength; j++){
		level+="../";
	}
return level;	
}
/////////////////////////////////////////////////////
function getlink(directory){
var mylink=new Array();
	mylink[0]=directory+"/index.html";
	mylink[1]=directory;
	mylink[2]="";

	if(directory=="aboutkratts"){
		mylink[0]="aboutkratts/index.html";
		mylink[1]="About Kratt Brothers";
	} 
	if(directory=="creatureheroes"){
		mylink[0]="creatureheroes/index.html";
		mylink[1]="Creature Heroes";
	}
	if(directory=="credits"){
		mylink[0]="credits/index.html";
		mylink[1]="Credits";
	}
	if(directory=="gulch"){
		mylink[0]="gulch/index.html";
		mylink[1]="Grizzly Gulch";
	}
	if(directory=="jointeam"){
		mylink[0]="jointeam/index.html";
		mylink[1]="Join the Team";
	}
	if(directory=="legal"){
		mylink[0]="legal/legal.html";
		mylink[1]="Legal Pages";
	}
	if(directory=="paw"){
		mylink[0]="paw/index.html";
		mylink[1]="<a href='../creatureheroes/index.html'>Creature Heroes</a> > Creature Paw";
	}
	if(directory=="questions"){
		mylink[0]="questions/index.html";
		mylink[1]="Creature Questions";
	}
	if(directory=="store"){
		mylink[0]="store/index.html";
		mylink[1]="Creature Store";
	}
	if(directory=="talk"){
		mylink[0]="talk/index.html";
		mylink[1]="Creature Talk";
	}
	if(directory=="creature_show"){
		mylink[0]="creature_show/index.html";
		mylink[1]="Creature Show Page";
	}
	if(directory=="btc_show"){
		mylink[0]="btc_show/index.html";
		mylink[1]="Be The Creature Show Page";
	}
	if(directory=="zoboo_show"){
		mylink[0]="zoboo_show/index.html";
		mylink[1]="Zoboo Show Page";
	}
	if(directory=="legal.html"){
		mylink[0]="";
		mylink[1]="Legal";
	}
	if(directory=="credits.html"){
		mylink[0]="";
		mylink[1]="Credits";
	}
	if(directory=="privacy.html"){
		mylink[0]="";
		mylink[1]="Privacy";
	}
	if(directory=="gulch_story.html"){
		mylink[0]="";
		mylink[1]="Story of Grizzly Gulch ";
	}
	if(directory=="grizz_video.html"){
		mylink[0]="";
		mylink[1]="Grizzly Gulch Cub Release Video";
	}
	if(directory=="behero.html"){
		mylink[0]="";
		mylink[1]="Be a Creature Hero";
	}
	if(directory=="learn.html"){
		mylink[0]="";
		mylink[1]="Learn about Endangered Species";
	}
	if(directory.match(/creaturehood\.html/g) || directory.match(/story\.php/g)){
		mylink[0]="";
		mylink[1]="<a href='creaturehood_list.html'>Creaturehood Menu</a> > Creaturehood Stories";
	}
	if(directory=="creaturehood_list.html"){
		mylink[0]="";
		mylink[1]="Creaturehood Menu";
	}
	if(directory=="sendstory.html"){
		mylink[0]="";
		mylink[1]="<a href='creaturehood_list.html'>Creaturehood Menu</a> > Send in Story";
	}
	if(directory=="survey.html"){
		mylink[0]="";
		mylink[1]="Survey";
	}
	if(directory=="kali.html"){
		mylink[0]="";
		mylink[1]="Kali Creature Poll";
	}
	if(directory=="stories.html"){
		mylink[0]="";
		mylink[1]="Hero Stories";
	}

return mylink;	
}
//////////////////////////////////////////////////////////////////////
function showimg(src, width, height){
	if(src!="" && width!="" && height!=""){
		width=width+20;
		height=height+25;
		showimages=window.open('images/'+src, 'question', 'width='+width+',height='+height+',location=0');
		showimages.resizeTo(width+15, height+30);
		showimages.focus();
	}
}
function opnew(src, width, height){
	
		newwin=window.open(src, 'paw', 'width='+width+',height='+height+',location=0,scrollbars=yes');
		newwin.focus();
	
}

