
dom = (document.getElementById)? true : false;
nn4 = (document.layers)? true : false;
ie4 = (!dom && document.all)? true : false;


function spawn(expr,qty,reversed){  
	var spawnee=[expr];  
	for(s=1;s<qty;s++){    
		spawnee[s]=expr+spawnee[s-1]  
	}  
	if(reversed){    
		return spawnee.reverse()  
	}else{    
		return spawnee  
	}
}

function generateTrail(divider){
	if(!divider) {
		divider=" : "
	}  
	var m=location.toString(),h="";  
	m=m.substring(m.indexOf("/")+1);  
	m=m.split("/");  
	var howmany=spawn("../",m.length,true);  
	howmany[m.length]="";  
	for(i=1;i<m.length-1;i++){    
		h+=("<a href="+howmany[i+2]+">"+unescape( m[i]+"</a>"+divider))  
	}  
	h += document.title;  
	return h
}

function goHREF(elemId) {

if (dom) document.location.href(document.getElementById(elemId).href);
   else if (ie4) document.location.href(document.all[elemId].href);
      else if (nn4) document.location.replace(document.layers[elemId].href);

//alert(dom + " " + nn4 + " " + ie4);
return false;
}


function menuMouseOver(item, level, elemId) {
//alert("Over >> " + "lsmenu"+level+"over");
	item.style.backgroundColor=item.clr;
	item.className = "lsmenu"+level+"over";
	item.style.cursor='hand';

if (elemId != null) {
if (dom) document.getElementById(elemId).className = 'lmOver';
else if (ie4) document.location.href(document.all[elemId].href);
else if (nn4) document.location.replace(document.layers[elemId].href);
}
}

function menuMouseOut(item, level, elemId) {
//alert("Out >>" + item + "Id=" + item.id + "TR" + item.myref);
	item.style.backgroundColor=item.bgclr;
	var clName = "lsmenu"+level;
	item.className = clName;
if (elemId != null) {
if (dom) document.getElementById(elemId).className = 'lm';
else if (ie4) document.location.href(document.all[elemId].href);
else if (nn4) document.location.replace(document.layers[elemId].href);
}
}

function menuMouseOutsel(item, level, elemId) {
//alert("Out >>" + item + "Id=" + item.id + "TR" + item.myref);
	item.style.backgroundColor=item.bgclr;
	var clName = "lsmenu"+level+"sel";
	item.className = clName;
if (elemId != null) {
if (dom) document.getElementById(elemId).className = 'lmsel';
else if (ie4) document.all[elemId].className = 'lmsel';
else if (nn4) document.layers[elemId].className = 'lmsel';
}
}

function menuClick(item) {
  var url = item.url;
alert("Parent=" + document.parentWindow.location + " New URL " + url + "?menuitem=" + item.id);
//alert("New Parent=" + document.parentWindow.location + "?menuitem=" + item.id);
  if(url.indexOf("?") < 0)
		document.parentWindow.location=url + "?id=" + item.id;
		//document.location=document.location + "?article_id=" + item.id;
	else
		document.parentWindow.location=url + "&menuitem=" + item.id;		
}
