/**************************************
 Thermos L.L.C. 
 Thermos JavaScript Functions
 ©2009 Method Engine, LLC
 www.methodengine.com
***************************************/


// Copyright 2006-2007 javascript-array.com

var prod_timeout	= 300;
var prod_closetimer	= 0;
var prod_ddmenuitem	= 0;

// open hidden layer
function prod_mopen(id)
{	
	// cancel close timer
	prod_mcancelclosetime();

	// close old layer
	if(prod_ddmenuitem) prod_ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	prod_ddmenuitem = document.getElementById(id);
	prod_ddmenuitem.style.visibility = 'visible';

}

// Close Open layers
function prod_mopenempty()
{	
	// cancel close timer
	prod_mcancelclosetime();

	// close old layer
	if(prod_ddmenuitem) prod_ddmenuitem.style.visibility = 'hidden';

}

// close showed layer
function prod_mclose()
{
	if(prod_ddmenuitem) prod_ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function prod_mclosetime()
{
	prod_closetimer = window.setTimeout(prod_mclose, prod_timeout);
}

// cancel close timer
function prod_mcancelclosetime()
{
	if(prod_closetimer)
	{
		window.clearTimeout(prod_closetimer);
		prod_closetimer = null;
	}
}

// close layer when click-out
document.onclick = prod_mclose; 


// search reset
function resetFld(id, msg){
  	if (id.value == "" || id.value == " ") {
  		id.value = msg;
  	}
}

function showsub(id,num){
	for (i=1; i<num+1;i++){
		document.getElementById("sub"+i).className="hide";
		document.getElementById("li"+i).className="";
	}
	document.getElementById("sub"+id).className="show";
	document.getElementById("li"+id).className="selected";
}


function show_WTB(id,num){
	for (i=1; i<num+1;i++){
		document.getElementById("wtb"+i).className="hide";
		document.getElementById("wtbMenu"+i).className="";
	}
	document.getElementById("wtb"+id).className="show";
	document.getElementById("wtbMenu"+id).className="selected";
}

function 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 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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function turnflashon(){
    document.getElementById('thermos-technology-animation').className = "showAnim";
	var flashvars = {};
	var params = {  wmode: "transparent", quality: "high" };
	var attributes = {};
	swfobject.embedSWF("thermstech.swf", "flashcontent", "565", "460", "9.0.0");
	swfobject.embedSWF("thermstech.swf", "flashcontent", "565", "460", "9.0.0","expressInstall.swf", flashvars, params, attributes);
}
  
function turnflashoff(){
	document.getElementById('thermos-technology-animation').className = "hideAnim";
	swfobject.embedSWF("", "flashcontent", "10", "10", "9.0.0");
}
  
  
  
function preloadImg() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImg.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];}}
}
