﻿
var agt = navigator.userAgent.toLowerCase();
var ns6 = (!document.all && document.getElementById);
var ie5 = (agt.indexOf('msie') != -1);
var ie4 = document.all;
var ns4 = (document.layers);
var t;
var t1;
var t2;
var submenus = ["about","engineering","careers","projects","contact","quality","technical"];
var currentStory = -1;
var currentLength = 0;
var objTicker;
var characterTimeout = 50;
var storyTimeout = 5000;
var WidgetOne = "_";
var WidgetTwo = "-";
var NoWidget = "";
var headLines = new Array();
var headLineLinks = new Array();
var objTicker;


function jsfnHighlight(obj)
{
  var classString = obj.className;
  if (classString.match("ft_Mtext")==null)	
	  obj.className = "ft_MtextH";

}

function jsfnDimMe(obj)
{
  var classString = obj.className;
  if (classString.match("ft_Mtext")==null)	
	 obj.className = "ft_Mtext";
}



//function jsfnHighlightItem(item,item1)
//{
  //var obj;
  //obj = jsfnfindObj(item);
  //obj.className = "td_popmenuH";	
//}

function jsfnHighlightItem(item)
{
  var obj;
  obj = jsfnfindObj(item);
  obj.className = "td_popmenuH";
}



function jsfnDimItem(item)
{
  var obj;
  obj = jsfnfindObj(item);
  obj.className = "td_popmenu";
}

function jsfnPopUp(menuid,action)
{

var obj,v;

v = action;
if (t) {
      clearTimeout(t);
      t = null;
}
if ((obj=jsfnfindObj(menuid))!=null)  { 
         if (obj.style) {
            obj=obj.style; 
			
            v=(action=='show')?'block':(action=='hide')?'none':action; 
			//alert(v);
          }
        obj.display=v; 
	}	
}



function jsfnPopUp1(menuid,action)
{
     
var obj,v;

v = action;
if (t1) {
      clearTimeout(t1);
      t1 = null;
}
if ((obj=jsfnfindObj(menuid))!=null)  { 
         if (obj.style) {
            obj=obj.style; 
			
            v=(action=='show')?'block':(action=='hide')?'none':action; 
			//alert(v);
          }
        obj.display=v; 
	}	
}


function jsfnfitmainpane(xwidth)
{

var obj;

if (ns6) {
            obj = document.getElementById('mainpane');
}

else if (ie4){
            obj = document.all['mainpane'];
}

else if (ns4) {
            obj = document.layers['mainpane'];
}

 obj.style.width=xwidth;

}

function jsfnsetTimer(menuid)
{ 

 t = setTimeout("jsfnPopUp('" + menuid + "','hide')",1000);

}

function jsfnsetTimer1(menuid)
{ 

 t1 = setTimeout("jsfnPopUp1('" + menuid + "','hide')",1000);

}


function jsfnlayersCloseAll_old(){

for (var i=0;i < submenus.length;i++)
	jsfnPopUp(submenus[i],'hide');
}


function jsfnSubPopUp(menuid,parentid){
	if ((obj=jsfnfindObj(menuid))!=null)  { 
         if (obj.style) {
		 obj=obj.style;
		
           (obj.display=='none') ? (obj.display='block'):((obj.display=='block') ? (obj.display='none') : obj.display='block');
	}
	}
}

function jsfnfindObj(n,d) { //v4.01
  var p,i,x;  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; 
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
    x=jsfnfindObj(n,d.layers[i].document);
  if(!x && d.getElementById) 
	x=d.getElementById(n); 
  return x;
}






function jsfnlayersCloseAll()
{
    var popup = document.getElementById("about");
	popup.style.display="none";
	
	popup = document.getElementById("quality");
	popup.style.display="none";
	
	popup = document.getElementById("engineering");
	popup.style.display="none";
	
	popup = document.getElementById("technical");
	popup.style.display="none";
	
	popup = document.getElementById("careers");
	popup.style.display="none";
	
	popup = document.getElementById("contact");
	popup.style.display="none";
	
	popup = document.getElementById("projects");
	popup.style.display="none";
} 



function searchValidate()
{
if (document.Form1.searchfield.value=="")
{
alert("Please enter a search string");
document.Form1.searchfield.focus();
return false;
}
}


var emailwnd = '';


function emailpage(val1)
	{	
	var url;	
		url="emailpage.asp?url=" +  val1;
		
		if (!emailwnd.closed && emailwnd.location)
				{
					emailwnd.location.href=url;
				}
				else
				{
				emailwnd = window.open(url,'emailwnd','toolbar=no,status=yes,resizable=no,scrollbars=no,width=400,height=300,top=0');
					if (!emailwnd.opener) emailwnd.opener = self;
				}
				if (window.focus) {emailwnd.focus()}				
	}		
	
	
function emailpage1(val)
	{	
	var url;	
		url="emailpage.asp?pid=" +  val;
		
		if (!emailwnd.closed && emailwnd.location)
				{
					emailwnd.location.href=url;
				}
				else
				{
				emailwnd = window.open(url,'emailwnd','toolbar=no,status=yes,resizable=no,scrollbars=no,width=400,height=300,top=0');
					if (!emailwnd.opener) emailwnd.opener = self;
				}
				if (window.focus) {emailwnd.focus()}				
	}		
	
	
	
	var prnwnd = '';
	function print(val1,val2,val3)
			{
			
				if (!prnwnd.closed && prnwnd.location)
				{
					prnwnd.location.href="print.aspx?sec=" + val1 + "&cat=" + val2 + "&subcat=" + val3;
				}
				else
				{
					prnwnd = window.open("print.aspx?sec=" + val1 + "&cat=" + val2 + "&subcat=" + val3,'prnwnd','toolbar=no,status=yes,resizable=no,scrollbars=yes,width=625,height=528,top=0');
					if (!prnwnd.opener) prnwnd.opener = self;
				}
				if (window.focus) {prnwnd.focus()}
				
			}	
			