// JavaScript Document


<!-- MM Built-ins 
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_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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
	if(winName == 'parent' || winName == '_parent'){
		window.opener.location = theURL;
	}else{
		window.open(theURL,winName,features);
	}
  
}

//-->



// Slide Viewer Image Display - image count 
function tngSlideViewer(totalSlides,SubSection,SubFolder){

	if (!SubFolder){
		var mySubSubSection = SubSection;
		var docWriteLine2 = "/products/images/index.php?sub=0&name=";
		var docWriteLine4 = "<img src=\"/images/slideshow/"+mySubSubSection+"/"+SubSection;
		var tmpAltText = SubSection;
	} else {
		var mySubSubSection = SubSection + "/" + SubFolder;
		var docWriteLine2 = "/products/images/index.php?sub="+SubFolder+"&name=";
		var docWriteLine4 = "<img src=\"/images/slideshow/"+mySubSubSection+"/"+SubFolder;
		var tmpAltText = SubFolder;
	}


	if (!totalSlides ){totalSlides == 0}
	for (var currentSlide = 1; currentSlide <= totalSlides; currentSlide++){
		document.writeln("<li><a href=\"javascript:MM_openBrWindow('");
		document.writeln(docWriteLine2);
		document.writeln(SubSection + "&id="+currentSlide+"','slideShow','width=500,height=500');\" title=\""+tmpAltText.toUpperCase()+"\">");
		document.writeln(docWriteLine4);
		document.writeln("SM"+currentSlide+".jpg\"");
		document.writeln("alt=\""+tmpAltText.toUpperCase()+"\" width=\"99\" height=\"98\" /></a></li>");
	}
}


// Select None / Select All for multiple select list
// e.g. javascript:listClear(document.form.colors, 0);
function listClear(listname, action){
if(action == 0){
	selectem = false;
  }else{
	selectem = true};
	for (i=0; i<listname.length; i++) { 
	listname.options[i].selected = selectem;
	} 
}

// Show / Hide function
//	function docsListShowHide(theID, toDo, toShow, toHide){
	function docsListShowHide(theID, toDo, toShow){
		var showClass = toShow;
		var hideClass = toHide;

		var tmpElementShown = theID + '_shown';
		var tmpElementHidden = theID + '_hidden';

		if (toDo == 1){ // Plus-sign was clicked
			MM_findObj(tmpElementShown).className = showClass;
		} else if (toDo == 0) { // Minus-sign was clicked
			MM_findObj(tmpElementShown).className = hideClass;
		}
	
	}


<!-- show / hide scripot 
	var isIE=document.all?true:false;
	var isDOM=document.getElementById?true:false;
	var isNS4=document.layers?true:false;
	
	/* _w : which ID (1) or (2) */
	/* _h : (h)ide or (s)how */
	function toggleT(_w,_h) {
	  if (isDOM)
	  {
		if (_h=='s') document.getElementById(_w).style.visibility='visible';
		if (_h=='h') document.getElementById(_w).style.visibility='hidden';
	  }
	  else if (isIE) {
		if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
		if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
	  }
	  else if(isNS4)
	  {
		if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
		if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
	  }
	}
	function toggleDisplay(_w,_h) {
	  if (isDOM)
	  {
		if (_h=='s') document.getElementById(_w).style.display='block';
		if (_h=='h') document.getElementById(_w).style.display='none';
	  }
	  else if (isIE) {
		if (_h=='s') eval("document.all."+_w+".style.display='block';");
		if (_h=='h') eval("document.all."+_w+".style.display='none';");
	  }
	  else if(isNS4)
	  {
		if (_h=='s') eval("document.layers['"+_w+"'].display='block';");
		if (_h=='h') eval("document.layers['"+_w+"'].display='none';");
	  }
	}
//-->


