var selected = null;

//alert(IsMainPage(location.pathname));

//function ChangeLocationMain(o,s) {
/*	if (s != "") {
		alert(s);
	}
	if (s != "") {
		var dirname = GetDirName(s.substr(1));
		
		if (dirname == "about") { link_id = 0; link='general_information.html'; image_id = 1; } else
		if (dirname == "products") { link_id = 1; link='products.html'; image_id = 2; } else
		if (dirname == "activities") { link_id = 2; link='activities.html'; image_id = 3; } else
		if (dirname == "relations") { link_id = 3; link='relations.html'; image_id = 4; } else
		if (dirname == "contact") { link_id = 4; link='contact_information.html'; image_id = 5; };
		
		frames["main"].location.href = "./" + GetDirName(s.substr(1)) + "/index.html" + s;*/
//		alert("./" + GetDirName(s.substr(1)) + "/index.html" + s);
		
//	} else {
//		o.frames["main"].location.href = "./" + GetDirName(s.substr(1)) + "/index.html" + s;
		
//		alert("IN CLM!");
//	};
//};

//function ChangeLocation(o,s) {
//	if (s != "") {
//		frames["main"].location.href = "./" + GetDirName(s.substr(1)) + "/index.html" + s;
//	} else {
//		o.frames["data"].location.href = s.substring((s.lastIndexOf("/")+1));
//	};
//};

/*function IsMainPage(page) {
	var dir = GetDirName(page);
	if (dir == "WebSite") {
		return true;
	};
	return false;
};*/

/*function GetDirName(page) {
	var dir = page.substring(page.lastIndexOf("\\",page.lastIndexOf("\\")-1)+1,page.lastIndexOf("\\"));
	if (dir == "") {
		dir = page.substring(page.lastIndexOf("/",page.lastIndexOf("/")-1)+1,page.lastIndexOf("/"));
	};
	return dir;
};*/

function FollowLink_MainMenu(linkid,link,image) {
	if (linkid != 99) {
		if (selected != null) {
			if (selected.highlight_1 != null) {
				selected.src = selected.highlight_1;
			}
		}
		selected = image;
		if (selected.highlight_0 != null) {
			selected.src = selected.highlight_0;
		}
		if (linkid == 0) {
         logo.src = "http://www.brcommunity.com/images/spacer.gif";
			parent.frames['main'].location.href = link;
		} else if(linkid == 1) {
         logo.src = "http://www.brcommunity.com/images/spacer.gif";
			parent.frames['main'].location.href = link;
		} else if(linkid == 2) {
         logo.src = "http://www.brcommunity.com/images/spacer.gif";
			parent.frames['main'].location.href = link;
		} else if(linkid == 3) {
         logo.src = "http://www.brcommunity.com/images/spacer.gif";
			parent.frames['main'].location.href = link;
		} else if(linkid == 4) {
         logo.src = "http://www.brcommunity.com/images/spacer.gif";
			parent.frames['main'].location.href = link;
		}
	} else {
      logo.src = "http://www.brcommunity.com/images/spacer.gif";
		parent.frames['main'].location.href = link;
	};
};

function UpdateMainMenu(image, logo, logocolor) {
	if (image != null) {
		if (selected != null) {
			if (selected.highlight_1 != null) {
				selected.src = selected.highlight_1;
			}
		}
		
		selected = image;
		if (selected.highlight_0 != null) {
			selected.src = selected.highlight_0;
		}
		
	}
	
	if (logo != null) {
		if (logocolor != null) {
/*         logo.src = './pics/LogoLibRT/' + logocolor + '.jpg';
*/
         logo.src = 'http://www.brcommunity.com/images/spacer.gif';
		}
	}
}

function Debug_Props(obj) {
	var ret = "";
	for(var x in obj) {
		ret += x + " - " + obj[x] + "<BR>";
	}
	return ret;
}

function Debug(obj) {
		var newwindow = window.open("","debug");
		var t = Debug_Props(obj);
		newwindow.document.write("<HTML><BODY>");
		newwindow.document.write(t);
		newwindow.document.write("</BODY></HTML>");
}

/*
function LinkTo(parentframe, link, Dir) {
	if (parentframe != null) {
		if (link != "") {
			if (Dir != "" && Dir != null) {
				parentframe.init = link;
				parentframe.parent.init = Dir;
				parentframe.parent.frames['menu'].location = '../menu.html';
				parentframe.frames['secondmenu'].location = '../' + Dir + '/menu.html';
				parentframe.frames['data'].location = '../' + Dir + '/' + link;
			} else {
				parentframe.init = link;
				parentframe.frames['secondmenu'].location = 'menu.html';
				parentframe.frames['data'].location = link;
			}
		}
	}
}
*/
