dloc = ((local = document.location.href.indexOf('reorg')) != -1) ? document.location.href.substr(local + 6) : document.location.href.substr(document.location.href.indexOf(document.domain)+document.domain.length);
$("div.head li > a[href='"+(topOn = dloc.substring(0,dloc.substring(1).indexOf('/')+2))+"']").addClass("on");
$("div.head #products div a[href='"+dloc.substring(0,(dloc.substring(topOn.length)).indexOf('/')+topOn.length+1)+"'], div.head #products div a[href='"+dloc+"']").addClass("on");
$("div.head a").bind("click", function() {
	$("div.head a.on").removeClass("on");
	$(this).addClass("on");
})
/*function upDir(lihref) {
	comp2 = dloc.substrs(0,dloc.lastIndexOf('/')+1);
	while (lihref.indexOf('../') == 0) {
		lihref=lihref.substr(3);
		comp2 = comp2.substr(0,comp2.lastIndexOf('/'));
	}
	return comp2 + lihref;
}
function compLink(li) {
	if (comp = $('a',$(li))) {
		//if (compHref == comp.attr('href')).indexOf('http://') != -1) {
		//	if (compHref.replace('/..\//')) {
		//	}
		//}
//		console.log(upDir(comp.attr('href')) + ' = ' + dloc);
		if (upDir(comp.attr('href')) == dloc || comp.attr('href') == 'index.htm') {
			offset = $(li).offset();
			$('div.rightCol').scrollTop(offset.top-160);
			$(li).find("a").css({color: '#F00'}).find("img").css({opacity:100});
		}
	}
}
$('div.rightCol li:has(a)').each(function() {
							   compLink(this);
							   });
*/
offset = $('div.rightCol li a[href="'+dloc+'"]').css({color: '#F00'}).find("img").css({opacity:100}).offset();
if (offset) $('div.rightCol').scrollTop(offset.top-180);
bread = dloc.split('/');
if (bread.pop() == '') bread.pop();
var crumb = new Array();
if (bread.length > 1) {
domain = document.location.href.substr(0,document.location.href.indexOf(dloc));
$(bread).each(function(i) {
							domain += bread[i] + '/';
parentTitle = bread[i].replace(/pet-/,'PET ');
parentTitle = parentTitle.replace(/pe-/,'PE ');
parentTitle = parentTitle.replace(/pvc-/,'PVC ');
parentTitle = parentTitle.replace(/-/,' ');
							crumb[crumb.length] = '<a href="' + domain + '">' + parentTitle + '</a>';
					   })
breadcrumb = '<p id="breadcrumb">' + crumb.join(' &raquo; ') + '</p>';
$('div.main div.line').prepend(breadcrumb);
}
//$("a[href='index.htm']").click(function() {return false;});
