//  Flexware innovation website Javascripts		
												
//  Javascripts and comments programmed by 		
//  FlexPuppie Eric Vaughan.					



//   Email - Opens the users email program to send																
//   an email to any FlexDog. 																										
//																																								
//   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 "ScottWhitlock":  { document.location.href = "mailto:scott.whitlock@flexwareinnovation.com"   }  break;
	case "RandyHilarides": { document.location.href = "mailto:randy.hilarides@flexwareinnovation.com"  }  break;
	case "MikeNeibler":    { document.location.href = "mailto:mike.neibler@flexwareinnovation.com"     }  break;
	case "MikeKessel":    { document.location.href = "mailto:mike.kessel@flexwareinnovation.com"     }  break;
	case "JasonToschlog":  { document.location.href = "mailto:jason.toschlog@flexwareinnovation.com"   }  break;
	case "DwayneButcher":  { document.location.href = "mailto:dwayne.butcher@flexwareinnovation.com"   }  break;
	case "LindaFry":	   { document.location.href = "mailto:linda.fry@flexwareinnovation.com"	       }  break;
  }
}





//  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;
}


