//  ISA 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 "info@indyisa.org":  { document.location.href = "mailto:info@indyisa.org"                               }  break;
	case "PeterAckerman":     { document.location.href = "mailto:peter.ackerman@insightbb.com"                   }  break;
    case "LeeSaberson":       { document.location.href = "mailto:lee.saberson@us.endress.com"                    }  break;
	case "MarkBeasley":       { document.location.href = "mailto:mbeas46143@yahoo.com"                           }  break;
	case "BrianHenke":        { document.location.href = "mailto:brian@acmeprocess.com"                          }  break;
	case "ThomasScott":       { document.location.href = "mailto:tom.scott@ieee.org"                             }  break;
    case "NormanWewetzer":    { document.location.href = "mailto:norm.wewetzer@cornerstonecontrols.com"          }  break;
	case "LaruaCrumpler":     { document.location.href = "mailto:lcrumpler@isa.org"                              }  break;
    case "CharlesMertes":     { document.location.href = "mailto:cmertes@hntb.com"                               }  break;
    case "BrettBenson":       { document.location.href = "mailto:brett.benson@cinergy.com"                       }  break;
    case "FernandoOtero":     { document.location.href = "mailto:fernando.otero@cornerstonecontrols.com"         }  break;
    case "DickJudkins":       { document.location.href = "mailto:jrjassoc@iquest.net"                            }  break;
    case "NormWewetzer":      { document.location.href = "mailto:norm.wewetzer@cornerstonecontrols.com"          }  break;
    case "MikeNeibler":       { document.location.href = "mailto:mneibler@comcast.net"                           }  break;
    case "Webmaster":         { document.location.href = "mailto:webmaster@indyisa.org"                          }  break;
    case "SuggestionBox":     { document.location.href = "mailto:comments@indyisa.org"                           }  break;
	case "JoeHeitz":		  { document.location.href = "mailto:joeheitz@comcast.net"							 }  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;
}

