//  SME website Javascripts		
												
//  Javascripts and comments programmed by 		
//  Todd Swift of Flexware Innovation, inc.					



//   Email - Opens the users email program to send																
//   an email to any SME executive committee member. 																										
//																																								
//   Adding email addresses: Add a new 'case' 																		
//   statement and follow the form of the other 																		
//   case statements																									
																										
//   Example:																							
//   case "FirstLast": { document.location.href = "mailto:first.last@flexwareinnovation.com" } break;	
//   replace 'first' and 'last' with appropriate values													
function Email(name) {
  switch(name) {
    case "ToddSwift": 	      { document.location.href = "mailto:todd.swift@comcast.net"       }  break;
    case "StephenUppfalt":    { document.location.href = "mailto:suppfalt@hotmail.com"                    }  break;
	
    case "DavidGibbs":        { document.location.href = "mailto:david_gibbs@irco.com"                    }  break;
	//case "DavidGibbs":        { document.location.href = "mailto:ahab_us@yahoo.com"                       }  break;
	
	//case "CurtisCrawford":    { document.location.href = "mailto:ccrawford@selcoeng.com"                  }  break;
	case "CurtisCrawford":    { document.location.href = "mailto:curtisacrawford@aol.com"                  }  break;
	case "GaryFarwick":       { document.location.href = "mailto:gtfarwick@iquest.net"                    }  break;
	case "KenLowery":         { document.location.href = "mailto:hklowery@yahoo.com"                    }  break;
	//case "KenLowery":         { document.location.href = "mailto:hklowery@hotmail.com"                    }  break;
	case "JoeBruns":          { document.location.href = "mailto:joseph.a.bruns@rolls-royce.com"          }  break;
	case "CarlMay":           { document.location.href = "mailto:ccmay23@aol.com"                         }  break;
	case "DietraRosenkoetter":{ document.location.href = "mailto:drosenkoetter@bmt.org"	                  }  break;
	case "JimCowden":	      { document.location.href = "mailto:cenmac@aol.com"	                      }  break;
	case "KenRennels":	      { document.location.href = "mailto:rennels@engr.iupui.edu"	              }  break;
	
	//case "MohammedBoudaia":	  { document.location.href = "mailto:jorr1@ittesi.com"	                      }  break;
	case "MohammedBoudaia":   { document.location.href = "mailto:mboudaia@itt-tech.edu"                   }  break;
	
	case "GaryJones":         { document.location.href = "mailto:gjonesemail@comcast.net"                  }  break;
	case "JimRainbolt":     { document.location.href = "mailto:jer121@aol.com"                             }  break;
	case "PeterAckerman":     { document.location.href = "mailto:peter.ackerman@flexwareinnovation.com"                             }  break;
	case "NatalieLowell":     { document.location.href = "mailto:nlowell@sme.org"                             }  break;
	
	//case "BobTaylor":         { document.location.href = "mailto:taylorb@firestoneindustrial.com"         }  break;
	//case "BruceLucas":        { document.location.href = "mailto:jpmboppa@cs.com"                         }  break;
	//case "JimChmelar":        { document.location.href = "mailto:jchmelar@mallorycontrols.com"            }  break;
	//case "JohnCuster":        { document.location.href = "mailto:jcuster@majortool.com"                   }  break;
	//case "GarryYoung":        { document.location.href = "mailto:garryyoung@hotmail.com"                    }  break;
	//case "GaryDavidson":    { document.location.href = "mailto:gwdavidson4@insightbb.com"                 }  break;
	//case "JamesMcNeely":    { document.location.href = "mailto:james.mcneely@gm.com"                      }  break;
	//case "JohnLeBaron":     { document.location.href = "mailto:suejohn87@msn.com"                          }  break;
	//case "WilliamMcCartney": { document.location.href = "mailto:william.mccartney@gm.com"                  }  break;

	//case "JeffAhnafield":     { document.location.href = "mailto:ahnafield@indy.rr.com"                             }  break;

	
	
  }
}



// heading_fade - Fades the main heading from white to gold	
														    
//  The variable 'fadetime' determines the speed at which    
//  the heading fades in.									
//  Higher value = slower fade in							
//  Lower valule = faster fade in							
var lcv = 0, which_loop = 1, fadetime = 100, stylecolor;
function heading_fade() {
  if (which_loop == 1) {
    switch(lcv) { 
	  case 0:  { stylecolor = "#FFFFFF"; lcv++; } break;
	  case 1:  { stylecolor = "#FAF7F0"; lcv++; } break;
	  case 2:  { stylecolor = "#F7F0DF"; lcv++; } break;
	  case 3:  { stylecolor = "#F5EACE"; lcv++; } break;
	  case 4:  { stylecolor = "#F2E3BD"; lcv++; } break;
	  case 5:  { stylecolor = "#F0DDAD"; lcv++; } break;
	  case 6:  { stylecolor = "#EDD69D"; lcv++; } break;
	  case 7:  { stylecolor = "#EBD08D"; lcv++; } break;
	  case 8:  { stylecolor = "#E8CA7D"; lcv++; } break;
	  case 9:  { stylecolor = "#E5C46E"; lcv++; } break;
	  case 10: { stylecolor = "#E2BC5F"; lcv++; } break;
	}
	
	document.getElementById('main_heading').style.color = stylecolor;
	setTimeout("heading_fade()",fadetime);
  }
}


//  statusArray - Toggles the visibility of the submenus     
															
//  The array holds the 'visibile' and 'hidden 'values		
//  that are used to change the visibility attribute			
var VisibilityArray=new Array("visible","hidden");
function subMenus(name, onoff) {
  document.getElementById(name).style.visibility = VisibilityArray[onoff];
}



//  bgchange - Toggles the background color of the submenus	
															
// The background colors are stored in the array and are	
// applied to each of the submenu items when moused over	
var BgColorArray=new Array("#7194BA","#EBEBEB");
var TxtColorArray=new Array("#E2BD61","#2D6195");
var txt_name;
function bgchange(sub_name, on_off) {
  txt_name = "txt"+sub_name;
  document.getElementById(sub_name).style.backgroundColor = BgColorArray[on_off];
  document.getElementById(txt_name).style.color = TxtColorArray[on_off];
}



//  openpopup - Pops up a new window 						
															
// The size of the window is controlled by the 'hori_px'  	
// and 'verti_px' parameters (widths and heights in pixels).
// The position of the window is controlled by the 'top_px'	
// and 'left_px' parameters (also in pixels). 				
// 'If' statements used to determine the center of the 		
// center of the window, and places the popup there.		
function openpopup(popurl, hori_px, verti_px, scrl_brs){
  var top_px=0, left_px=0;
  if(navigator.appName == "Microsoft Internet Explorer") {
    left_px = (document.body.clientWidth - hori_px)/2;
	top_px  = (document.body.clientHeight - verti_px)/2;
	
	if(scrl_brs == "yes") {
      window.open(popurl,"","left="+left_px+",top="+top_px+",width="+hori_px+",height="+verti_px+",scrollbars");
    }
    else {
      window.open(popurl,"","left="+left_px+",top="+top_px+",width="+hori_px+",height="+verti_px);
    }
  }
 
  else {
    left_px = (window.innerWidth - hori_px)/2;
	top_px  = (window.innerHeight - verti_px)/2;
  
    if(scrl_brs == "yes") {
      window.open(popurl,"","screenX="+left_px+",screenY="+top_px+",width="+hori_px+",height="+verti_px+",scrollbars");
    }
    else {
      window.open(popurl,"","screenX="+left_px+",screenY="+top_px+",width="+hori_px+",height="+verti_px);
    }
  }
}



//  submenu_left - Aligns the submenu depending on 			
//  the size of the browser window (independent of resolution
 															
//  Only the widths determine the placement of the submenu.	
//  Screen widths below 800 are listed as a default.			
function submenu_left(submenu_name) {
  var left_dist;

  if(navigator.appName == "Microsoft Internet Explorer") {
    if(document.body.clientWidth >= 800) { left_dist = 398-((1280-document.body.clientWidth )/2); }
	else if(document.body.clientWidth < 800) { left_dist = 162; }
  }
  else {
    if(window.innerWidth >= 800) { left_dist = 396-((1280-window.innerWidth)/2); }
	else if(window.innerWidth < 800) { left_dist = 160; }
  }
  
  document.getElementById(submenu_name).style.left = left_dist;
}


//  submenu_down - Positions the submenus down more if Netscape is loaded
function submenu_down() {
  if(navigator.appName != "Microsoft Internet Explorer") {
    document.getElementById('CompanyProfile').style.top  = "42px"
	document.getElementById('PartnerServices').style.top = "67px"
	document.getElementById('ServiceDelivery').style.top = "92px"
	document.getElementById('Employment').style.top      = "117px"
	document.getElementById('Contact').style.top         = "142px"
  }
}



//  printdoc, closedoc - These two functions print and 		
//  close the current window.  Useful with pop up windows	
function printdoc(){ 
  document.getElementById('btnPrint').style.visibility = "hidden";
  print(document);
  document.getElementById('btnPrint').style.visibility = "visible";
}

function closedoc(text) { 
  close(document); 
}


//  newWindow - Opens a new window		
function newWindow(address) {
  window.open(address);
}

// Goto a new location
function newLocation(address) {
  document.location = address;
}

