//by Rick Phillips rick.rnsservices@gmail.com
//This program will menu roll the items at a set interval. When the user
//mouse overs a menu item, the menu roll, surrendering control to the user.
//On mouse out, the menu roll begins again at the beggining.

<!--start of menu roll -->
var t; //interval variable
var i = 0; //count variable
var delay = 5000; //menu delay time
//intialize menu roll slide
function StartTime(){
	document.big.src='images/pic_start.gif';//defualt image
	setText('');
	i = 0;//count reset
	t = setInterval( "slide();" , delay);
}
//function to menu roll
function slide(){
	//change id array
	var menu = ["home", "office", "conference", "system", "seating", "contact"];
	ChangeBack(); //reset images
	Change(menu[i]); //change to current rotation image
	
	i++;//next image
	if(i == 6) i = 0;//check to see if we are at the end of rotation
					 // and start over
}
//function to stop menu roll 
function ClearTime(){
	//clear t time interval
	clearInterval(t);
}
//function to update current image and text
function Change(id){
	ChangeBack(); //function to reset images
	//update images with current selection
	document.getElementById(id).src ='images/h_' + id + '_on.gif';
	document.connect.src='images/line_' + id + '.gif';
	document.big.src = 'images/pic_' + id + '.gif';
	
	setText(id);//function to set currentText to current selection
}
//function to reset images
function ChangeBack() {
	//reset images
	document.getElementById('home').src='images/h_home.gif';
	document.getElementById('office').src='images/h_office.gif';
	document.getElementById('conference').src='images/h_conference.gif';
	document.getElementById('system').src='images/h_system.gif';
	document.getElementById('seating').src='images/h_seating.gif';
	document.getElementById('contact').src='images/h_contact.gif';
	document.connect.src='images/whitepixel.gif';
}
//function to determine text to send to update function
function setText(id){
	var text = ''; //declase string variable
	//evaluate passsed id value and assigne appropriate string to text
	switch (id){
	case 'home': text = 'The Mayer Company, Inc. is an Independent Group, representing quality office furniture manufacturers in New England. We stand ready to support you with fast responses, honest answers, quality products and world-class service. <br><br>Let’s get started!';
	break;
	case 'office' : text = 'Customized offices made to your specifications. Available in many finishes and colors';
	break;
	case 'conference' : text = 'From small meeting rooms to large boardrooms, we have the varied styles, sizes and colors to exceed your expectations.';
	break;
	case 'system' : text = 'Flexibility is the key to meeting office design challenges. The Mayer Company provides the best answers.';
	break;
	case 'seating' : 	text = 'A wide variety of styles that will fulfill your needs, from the reception area to the workstations to the executive offices to the cafeteria and more…';
	break;
	case 'contact' : text = 'Please call us if you have any questions or need help with this. We will answer all your questions with expertise and experience.';
	break;
	default : text = 'The Mayer Company, Inc. is an Independent Group, representing quality furniture manufacturers in New England. We stand ready to support you with fast responses, honest answers, quality products and world-class service. <br><br>Let’s get started!';
		}

	MM_setTextOfLayer('currentText', '', text);//call funtion and pass string value
											   //to update text
}
//fucntion to replace text
function MM_setTextOfLayer(objId,x,newText) { //v9.0
 	//object verification
	with (document) if (getElementById && ((obj=getElementById(objId))!=null))
    	with (obj) innerHTML = unescape(newText); //unespace(replace) currentText with newText
}
<!--end of menu roll -->


<!-- open new window for links -->
function OPENWINDOW(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,height=500,width=650");
}

function HereWeAre(item) {
document.hereweare='document.' + (item) ;
return true;
}

function LogoBack(item) {
document.hereweare='document.' + (item) ;
document.hereweare.src='images/' + (item) + '.gif';
return true;
}

<!-- Begin
function FOOTER() {
document.write(' <hr size="1" color="A3A78D" width="834" noshade> ');
document.write('<a class="body2">');
document.write(' © 2005-2007 The Mayer Company, Inc.  All Rights Reserved. Site Created by ');
document.write(' <a class="link2" href="http://www.elliottgraphics.net" OnFocus="this.blur()"> ');
document.write(' WSI ');
document.write(' </a> ');
document.write('<a class="body2">');
document.write(' .&nbsp &nbsp Site Maintained by ');
document.write(' <a class="link2" href="mailto:rick.rnsservices@gmail.com" OnFocus="this.blur()"> ');
document.write(' RNS Services');
document.write(' </a> ');
document.write('<a class="body2">');
document.write(' .&nbsp &nbsp Last Site Update December 27, 2011 <br>');
document.write(' <a class="sublink" href="index.html" OnFocus="this.blur()"> ');
document.write(' Home ');
document.write(' </a> ');
document.write(' <a class="header2"> ');
document.write(' &nbsp | &nbsp ');
document.write(' <a class="sublink" href="home.html" OnFocus="this.blur()"> ');
document.write(' Reception ');
document.write(' </a> ');
document.write(' <a class="header2"> ');
document.write(' &nbsp | &nbsp ');
document.write(' <a class="sublink" href="offices.html" OnFocus="this.blur()"> ');
document.write(' Offices ');
document.write(' </a> ');
document.write(' <a class="header2"> ');
document.write(' &nbsp | &nbsp ');
document.write(' <a class="sublink" href="conference.html" OnFocus="this.blur()"> ');
document.write(' Conference & Training ');
document.write(' </a> ');
document.write(' <a class="header2"> ');
document.write(' &nbsp | &nbsp ');
document.write(' <a class="sublink" href="systems.html" OnFocus="this.blur()"> ');
document.write(' Systems / Modular ');
document.write(' </a> ');
document.write(' <a class="header2"> ');
document.write(' &nbsp | &nbsp ');
document.write(' <a class="sublink" href="seating.html" OnFocus="this.blur()"> ');
document.write(' Seating ');
document.write(' </a> ');
document.write(' <a class="header2"> ');
document.write(' &nbsp | &nbsp ');
document.write(' <a class="sublink" href="contact.html" OnFocus="this.blur()"> ');
document.write(' About Us / Contact ');
document.write(' </a> ');
}
// End -->


