function showSubnav(indx) {
	if (obj=findObj("sidenav"+indx)) { obj.className = "on"; }
}

function checkLocatorType(oObj1,oObj2) {
	if (oContObj = findObj(oObj2)) {
		if (oObj1.options[oObj1.selectedIndex].value == "contractor") { oContObj.style.display = 'block'; } 
		else { oContObj.style.display = 'none'; }
	}
}

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function showHideCompare(strObjName,strSH) {
	if (strObjName) {
		if (obj = findObj(strObjName)) {
			if (strSH=="show") {
				obj.style.display = "block";
			} else {
				obj.style.display = "none";
			}
		}
	}
}




function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	obj.visibility=v; }
}

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 CreateFeatureText(theText) {
	this.Features[this.indx] = theText;
	this.indx++;
}

function WriteFeatureText(objName,theIndx) {
	if ((obj=MM_findObj('feature_textblock'))!=null) {
		MM_showHideLayers('feature_textblock','','hide');
		tempHTML = this.Features[theIndx]
		if (this.Features.length > 1) { 
			tempHTML += "<p class='features_text1' style='clear:both;'>read more {&nbsp;&nbsp;"
			for (i=0;i<this.Features.length;i++) {
				if (theIndx == i) { tempHTML += "<b>" + (i+1) + "</b>" } 
				else { tempHTML += "<a class='feature_numlinks' href=\"javascript:stopCount();" + objName + ".WriteFeatureText('" + objName + "'," + i + ");\">" + (i+1) + "</a>" } 
				tempHTML += "&nbsp;&nbsp;"
			}
			tempHTML += "}</p>"
		}
		obj.innerHTML = tempHTML
		MM_showHideLayers('feature_textblock','','show');
	}
}

function feature(name,title,imgsrc,imgOsrc,imgXsrc) {
	this.name = name;
	this.title = title;
	this.imgsrc = imgsrc;
	this.imgOsrc = imgOsrc;
	this.imgXsrc = imgXsrc;
	this.CreateFeatureText = CreateFeatureText
	this.WriteFeatureText = WriteFeatureText
	this.indx = 0
	this.Features  = new Array;
}

var currentClicked = "";

function MM_swapClickedImage() { //v3.0
  var i,j=0,x,a=MM_swapClickedImage.arguments;
  document.MM_sr2=new Array;
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null) {
	document.MM_sr2[j++]=x;
	if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
	}
}

function MM_swapClickedImgRestore() { //v3.0
  var i,x,a=document.MM_sr2;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function restoreTitleImg(imgTitle) {
	if (currentClicked != imgTitle ) { MM_swapImgRestore(); }
}

function changeTitleOver(imgTitle,imgSrc) {
	if (currentClicked != imgTitle ) { MM_swapImage(imgTitle,'',imgSrc,0); }
}

function changeTitleImg(imgTitle,imgSrc) {
	if ((x=MM_findObj(imgTitle))!=null) {
		MM_swapClickedImgRestore();
		currentClicked = imgTitle;
		MM_swapClickedImage(imgTitle,'',imgSrc,0);
	}
}

var running = null
var slideindx1 = 0;
var slideindx2 = 0;

function startCount() {
	if (running == null) { running = setTimeout("slideshowFeatures()",6000) }
}
function stopCount() {
	if (running != null) {
		clearTimeout(running);
		running = null;
		}
}	

function slideshowFeatures() {
	stopCount();
	if (myFeatures.length > slideindx1) {
		if (myFeatures[slideindx1].Features.length > slideindx2) { 
			if ((obj=MM_findObj(myFeatures[slideindx1].title))!=null) {
				changeTitleImg(myFeatures[slideindx1].title,myFeatures[slideindx1].imgXsrc);
			}
			myFeatures[slideindx1].WriteFeatureText(myFeatures[slideindx1].name,slideindx2)
			slideindx2++;
		} else { 
			slideindx2 = 0;
			slideindx1++;
			slideshowFeatures();
		}
	} else {
		slideindx2 = 0;
		slideindx1 = 0;
		slideshowFeatures();
	}
	startCount();
}

var popUpWin=0;
function popUpWindow(URLStr, URLstyle)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', URLstyle);
}
function aboutColorLife() {
		window.open("colorlifepopup.html","colorlife","HEIGHT=400, WIDTH=320");
}