function WM_netscapeCssFix() {
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}

WM_netscapeCssFixCheckIn()

function showItem(item){
  if (document.getElementById && document.body.style) {
    theLast = document.getElementById(lastItem);
    theItem = document.getElementById(item);
    theLast.style.visibility = "hidden";
    theItem.style.visibility = "visible";
  }
  else if (document.all) {
    theLast = document.all(lastItem).style;
    theItem = document.all(item).style;
    theLast.visibility = "hidden";
    theItem.visibility = "visible";
    } 
  else if (document.layers) {
    theLast = document.layers[lastItem];
    theItem = document.layers[item];
    theLast.visibility = "hide";
    theItem.visibility = "show";
    } 
  lastItem = item;  
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

var states = new Array("AL","AK","AZ","AR","CA","CO","CT","DC","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY")


function buildStateSelect() {
  var str = "<select name='state'>";
  var thisState = "TX";
  for(var i = 0; i < states.length; i++ ) {
    if(thisState == String(states[i]))
      str += "<option value='" + states[i] + "' selected>" + states[i] + "</option>\n";    
    else
      str += "<option value='" + states[i] + "'>" + states[i] + "</option>\n";    
  }   
  str += "</select>";
  document.write(str);
}

function validateForm(f) {
  if((f.name.value == "") || ((f.dayphone.value == "") && (f.evephone.value == "") && (f.email.value = "")) ) {
    alert("Please give us your name and a way to contact you.");
    return false;
    }
  return true;
  }
	
function writeNav() {
	str = "<table id='main-nav' cellspacing='0' align='center'>\n";
	str += "<tr><td class='nav'><a href='index.php'>HOME</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='customers.html'>WHAT CUSTOMERS SAY</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='DMN_article.pdf'>PRESS COVERAGE</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='personnel.html'>PERSONNEL</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='service.html'>CARS WE SERVICE</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='services.html'>MAINTENANCE & SERVICES</a></td></tr>\n";
<!--	str += "<tr><td class='nav'><a id='menu0' href='#' onMouseOver='showMenu(event)' onMouseOut='hideMenu(event)'>SEE OUR SHOP</a></td></tr>\n";
	//str += "<tr><td class='nav'><img name='menu0' id='menu0' src='images/button-bg.jpg' width='158' height='32' border='0' onMouseOver='showMenu(event)' onMouseOut='hideMenu(event)'></td></tr>\n"; -->
	str += "<tr><td class='nav'><a href='links.html'>LINKS & INFORMATION</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='location.html'>MAP</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='appointments.html'>MAKE AN APPOINTMENT</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='contact.html'>CONTACT US</a></td></tr>\n";
	str += "<tr><td class='nav'><a href='artist.html'>FEATURED ARTIST<BR>OF THE MONTH</a></td></tr>\n";
	str += "<tr><td>&nbsp;</td></tr>\n";
	str += "</table>\n";
	document.write(str);
}

function writeCredit() {
  str = "<tr><td id='credit' colspan='3'>Site designed and produced by <a href='http://www.wrabbit.com' target='new'>White Rabbit Communications</a></td></tr>";
  document.write(str);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function preloadImages() {
	if (document.images) {
		img1 = newImage("images/logo.jpg");
		img2 = newImage("images/header-spacer.jpg");
		img3 = newImage("images/phone.jpg");
		img4 = newImage("images/nav-image-1.jpg");
		img5 = newImage("images/tagline.gif");
		img6 = newImage("images/car-care-clinic.gif");
		img7 = newImage("images/button-bg.jpg");
		preloadFlag = true;
	}
}

//<img name="menu0" id="menu0" src="images/partners.gif" width="158" height="32" border="0" onMouseOver="showMenu(event)" onMouseOut="hideMenu(event)">
