window.onerror = null;

//initialise all variables

var olddiv = new Array();    //this will become a reference to the objects that are being shown or were last shown

function getRefToDivNest( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return document.getElementById(divID); }
	if( document.all ) { return document.all[divID]; }
	return document[divID];
}

function showdiv(thisdiv,mylevel) {
	//this function shows the div and sets the level that the div exists at to 'mylevel'
	hideDivsToLevel(mylevel); //first, hide the last one
	olddiv[mylevel] = getRefToDivNest(thisdiv);
	//Make the object visible
	if( olddiv[mylevel].style ) {
		//DOM compliant
		olddiv[mylevel].style.visibility = 'visible';
	} else {
		if( olddiv[mylevel].visibility ) {
			//Netscape and old versions of Mozilla compliant
			olddiv[mylevel].visibility = 'show';
		} else {
			//Nothing found, no known way of changing the style
			olddiv[mylevel] = false;
			notifyFail();
			return;
		}
	}
}

function hideDivsToLevel(mylevel) {
	//hide all the divs that are showing this level and higher
	if( olddiv[mylevel] ) {
		//try the next level up first
		hideDivsToLevel(mylevel+1);
		//hide the last hidden object that was shown in the current level
		if( olddiv[mylevel].style ) {
			//DOM compliant
			olddiv[mylevel].style.visibility = 'hidden';
		} else {
			//Netscape and old versions of Mozilla compliant
			olddiv[mylevel].visibility = 'hide';
		}
		//No need for else notifyFail()
		//If it was going to fail, it would have failed while it was being shown
	}
	olddiv[mylevel] = false;
}

function hideDivSpecial(specialDiv) { //hide a div, bypassing levels
	specialDiv = getRefToDivNest(specialDiv);
	if( specialDiv.style ) {
		//DOM compliant
		specialDiv.style.visibility = 'hidden';
	} else {
		if( specialDiv.visibility ) {
			//Netscape and old versions of Mozilla compliant
			specialDiv.visibility = 'hide';
		} else {
			//Nothing found, no known way of changing the style
			notifyFail();
			return;
		}
	}
}

function notifyFail() {
	//oops, I guess nothing works in this browser
	if( window.myalternative ) {
		if( window.confirm( "You are having problems displaying some components of this page.\n"+
			"\nWould you like to try the other page design?" ) ) { location.href = myalternative; }
	} else {
		window.alert( "You are having problems displaying some components of this page.\n\n"+
			"Sorry, but there is not yet an alternative page." );
	}
}

var preloadFlag = false;
function preloadImages() {
  //var newImage = new Array;
	if (document.images) {
        a_why2 = newImage("images/a_why2.gif");
		news2 = newImage("images/news2.gif");
		jobs2 = newImage("images/jobs2.gif");
		friends2 = newImage("images/friends2.gif");
		green2 = newImage("images/green2.gif");
		manufacturing2 = newImage("images/manufacturing2.gif");
		view_prod2 = newImage("images/view_prod2.gif");
		view_app2 = newImage("images/view_app2.gif");
		fabrics2 = newImage("images/fabrics2.gif");
		finishes2 = newImage("images/finishes2.gif");
		hardware2 = newImage("images/hardware2.gif");
		preloadFlag = true;
	}
}



function e_friend()
{
var e_add= prompt('Enter your friend\'s email address:',' ');
var subj= prompt('Enter the subject of your message:',' ');
if ((subj==" ") || (subj==null))
 subj="Hi! I am sending a link from Nemschoff.com";
window.location="mailto:"+e_add+"?subject="+subj;
}


 function openmypage()
 {
 window.open ("emailform6.asp","openmypage","width=325,height=520,location=0,menubar=0,resizable=0,scrollbars=1,status=1,titlebar=1,toolbar=0,screenX=100,left=100,screenY=30,top=60");
 }
 

<!-- 
var browser     = '';
var version     = '';
var entrance    = '';
var cond        = '';
// BROWSER?
if (browser == ''){
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
else browser = 'IE';
}
if (version == ''){
version= navigator.appVersion;
paren = version.indexOf('(');
whole_version = navigator.appVersion.substring(0,paren-1);
version         = parseInt(whole_version);
}
if (browser == 'IE' && version >= 4) document.write('<'+'link rel="stylesheet" href="nemschoff.css" />');
if (browser == 'Netscape' && version >= 2.02) document.write('<'+'link rel="stylesheet" href="nemschoff_net.css" />');
// -->

