document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
}; 

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function browser_specific_amendments() {
	if(navigator.userAgent.indexOf("MSIE 6")!=-1)
		{
			if(document.getElementById("ecom_nav")!==null)
				{
				document.getElementById("ecom_nav").style.marginLeft = "275px";
				}
			if(document.getElementById("drill_container")!==null)
				{
					document.getElementById("drill_container").style.marginLeft = "-260px";
					document.getElementById("drill_container").style.top = "209px";
				}
			if(document.getElementById("zoom_btn")!==null)
				{
					document.getElementById("zoom_btn").style.marginLeft = "41px";
				}
		}
	if(navigator.userAgent.indexOf("MSIE 7")!=-1)
		{
			document.getElementById("main_container").style.marginTop = "-4px";	
			if(document.getElementById("zoom_btn")!==null)
				{
					document.getElementById("zoom_btn").style.marginTop = "527px";
				}
		}
	if(navigator.userAgent.indexOf("Safari")!=-1)
		{
			if(document.getElementById("ecom_nav")!==null)
				{
				document.getElementById("ecom_nav").style.top = "180px";
				}
			if(document.getElementById("drill_container")!==null)
				{
					document.getElementById("drill_container").style.marginLeft = "-210px";
					document.getElementById("drill_container").style.top = "209px";
				}
		}
	if(navigator.userAgent.indexOf("Opera")!=-1)
		{
			if(document.getElementById("ecom_nav")!==null)
				{
				document.getElementById("ecom_nav").style.marginLeft = "316px";
				}
			if(document.getElementById("drill_container")!==null)
				{
					document.getElementById("drill_container").style.marginLeft = "140px";
					document.getElementById("drill_container").style.top = "200px";
				}
			if(document.getElementById("zoom_btn")!==null)
				{
					document.getElementById("zoom_btn").style.marginTop = "520px";
					document.getElementById("zoom_btn").style.marginLeft = "553px";
				}
		}
	if(navigator.userAgent.indexOf("Firefox")!=-1)
		{
			if(document.getElementById("ecom_nav")!==null)
				{
				document.getElementById("ecom_nav").style.top = "180px";
				}
			if(document.getElementById("drill_container")!==null)
				{
					document.getElementById("drill_container").style.marginLeft = "-210px";
					document.getElementById("drill_container").style.top = "209px";
				}
			if(document.getElementById("zoom_btn")!==null)
				{
					document.getElementById("zoom_btn").style.marginTop = "525px";
				}
		}
		
	
	if(window.location.href.indexOf("department=")==-1 && window.location.href.indexOf("browse.php")!=-1)
		{
			if(document.getElementById("browse_template_container_top")!==null)
				{
					document.getElementById("browse_template_container_top").style.display="block";
				}
			if(document.getElementById("browse_template_container_bottom")!==null)
				{
					document.getElementById("browse_template_container_bottom").style.display="block";
				}
		}
	if(window.location.href.indexOf("=")!=-1 && window.location.href.indexOf("browse.php")!=-1)
		{
			if(document.getElementById("browse_department_sections_summary")!==null)
				{
					document.getElementById("browse_department_sections_summary").style.display="none";
				}
			if(document.getElementById("drill_container")!==null)
				{
					document.getElementById("drill_container").style.display="block";
				}
		}
//View Item		
	if(window.location.href.indexOf("=")!=-1 && window.location.href.indexOf("viewitem.php")!=-1)
		{
			if(document.getElementById("browse_department_sections_summary")!==null)
				{
					document.getElementById("browse_department_sections_summary").style.display="none";
				}
			if(document.getElementById("drill_container")!==null)
				{
					document.getElementById("drill_container").style.display="block";
					document.getElementById("drill_container").style.width="590px";
				}
			if(document.getElementById("view_item_drill_container")!==null)
				{
					var prodName = document.getElementById("product_name").innerHTML
					var winTitle = document.title
					document.getElementById("view_item_drill_container").style.display="block";
					document.getElementById("view_item_drill_item").innerHTML = prodName;
					document.title = winTitle + " » " + prodName; 
				}
		}
	if(window.location.href.indexOf("account.php")!=-1)
		{
			var pageName = window.location.href.split("=")
			var pageName = pageName[1]
			if(pageName.indexOf("&")!=-1)
				{
					pageName = pageName.split("&")
					pageName = pageName[0]
				}
			var btnName = "account_btn_" + pageName
			if(document.getElementById("accounts_nav_container")!==null)
				{
					document.getElementById(btnName).className = "accounts_nav_links_on";
				}
			return
		}
	else{return}

}