// JavaScript Document

// Tab Fix between FF and IE
$j(document).ready(function(){
    $j(".tabtext").hover(
      function () { //over
        $j(this).css("cursor", "pointer");
      }, 
      function () { //out
        $j(this).css("cursor", "auto");
      }
    );
});


// THE CODE BELOW IS USED FOR THE EXPANDING / COLLAPSING SECTIONS
function ExpandNCollapse(sectionId, imageName)
{
	expandit(sectionId);
	changeImage(imageName);
}

function expandit(sectionId)
{
	var folder = document.all ? document.all[sectionId].style : document.getElementById(sectionId).style;
	if (folder.display=="none")
		folder.display="block";
	else
		folder.display="none";
}

function changeImage(name)
{
	if (document[name].src != null && document[name].src == minusImage.src)
	{
		document[name].src = plusImage.src;
		document[name].alt = plusImage.alt;
	}
	else
	{
		document[name].src = minusImage.src;
		document[name].alt = minusImage.alt;
	}
}

function FULLexpandNcollapse()
{
	for (i=0; i<13; i++)
		if ((document.getElementById("section["+i+"]").style.display=="none" && !fullExpand) ||
			(document.getElementById("section["+i+"]").style.display=="block" && fullExpand))
				ExpandNCollapse("section["+i+"]","drop["+i+"]");
	fullExpand = !fullExpand;
}

function formatDates()
{
	var monthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

	var TDs = document.all ? document.all.tags("td") : document.getElementsByTagName("td");
	for (t=0; t<TDs.length; t++)
	{
		var text = TDs[t].innerHTML;
		if (TDs[t].className.indexOf("Content") > -1 && text.indexOf("00:00:0") > -1)
		{
			text = text.split("00:00:0")[0];

			var year = text.split("-")[0];
			var month = text.split("-")[1];
			var day = text.split("-")[2].split(" ")[0];
			
			if (location.href.toString().indexOf("en_US") > -1)
				text = month + " / " + day + " / " + year;
			else
				text = day + " / " + month + " / " + year;

			TDs[t].innerHTML = text;			
		}
	}
}

function truncateBreadCrumb()
{
	var oldBreadCrumb = document.getElementById("cShellBcrumb").innerHTML.split("&nbsp;");
	var newBreadCrumb = "";
	for (i=0; i<oldBreadCrumb.length; i++)
	{
		temp = oldBreadCrumb[i].toLowerCase();
		if (temp.indexOf("></a>") < 0 && temp.indexOf("> </a>") < 0 && temp.indexOf("not used</a>") < 0)
			newBreadCrumb += oldBreadCrumb[i] + " ";
		if (location.href.indexOf("hu_HU") > -1 && i == oldBreadCrumb.length-2)
			newBreadCrumb += " &gt; <a href='/wps/portal/3M/hu_HU/3M-ESPE/dental-professionals/products/new/'>&Uacute;j term&eacute;kek</a> ";
	}
	document.getElementById("cShellBcrumb").innerHTML = newBreadCrumb;
	
//	window.alert(oldBreadCrumb + "\n\n\n" + newBreadCrumb);
}
