
var timerID, stoprolltimer;
var menudiv = new Array('corporate', 'products', 'partners', 'support');//external
var disappeardelay = 200;
var rolling = 1;
var navy = 277;//external (page offset height)
var rollheight = 0;
var rolltimer,amount,theTime,thelayer;
var menus = new Array();

// corporate menu
var thismenuname = menudiv[0];
eval("menus." + thismenuname + "= new Array()");
eval("thismenu = menus." + thismenuname);
thismenu.width = 200;
thismenu.x = 9;//external
thismenu.rollheight = 0;
thismenu.text = new Array();
thismenu.text[0] = 'About Us';//external
thismenu.text[1] = 'Investor Relations';//external
thismenu.text[2] = 'Analyst Relations';//external
thismenu.text[3] = 'Company News';//external
thismenu.text[4] = 'Events Calendar';//external
thismenu.text[5] = 'Career Opportunities';//external
thismenu.text[6] = 'Contact Information';//external
thismenu.text[7] = 'Capitol Blog';//external
thismenu.link = new Array();
thismenu.link[0] = 'corpinfo.htm';//external
thismenu.link[1] = 'investors.htm';//external
thismenu.link[2] = 'analystrelations.htm';//external
thismenu.link[3] = 'news.htm';//external
thismenu.link[4] = 'corpinfo_calendar.htm';//external
thismenu.link[5] = 'JobSearch.htm';//external
thismenu.link[6] = 'corpinfo_contact.htm';//external
thismenu.link[7] = 'capitolblog.htm';//external

// products menu
var thismenuname = menudiv[1];
eval("menus." + thismenuname + "= new Array()");
eval("thismenu = menus." + thismenuname);
thismenu.width = 200;
thismenu.x = 117; //external
thismenu.rollheight = 0;
thismenu.text = new Array();
thismenu.text[0] = 'Cable';//external
thismenu.text[1] = 'Enterprise';//external
thismenu.text[2] = 'Government';//external
thismenu.text[3] = 'Telco';//external
thismenu.text[4] = 'Global Network Services';//external
thismenu.text[5] = '';//external
thismenu.text[6] = 'Product Portfolio';//external
thismenu.text[7] = 'Resources';//external
thismenu.text[8] = 'Contact Sales';//external
thismenu.link = new Array();
thismenu.link[0] = 'productsapps_cable.htm';//external
thismenu.link[1] = 'productsapps_enterprise.htm';//external
thismenu.link[2] = 'productsapps_government.htm';//external
thismenu.link[3] = 'productsapps_telco.htm';//external
thismenu.link[4] = 'services.htm';//external
thismenu.link[5] = '';//external
thismenu.link[6] = 'products.htm';//external
thismenu.link[7] = 'resources.htm';//external
thismenu.link[8] = 'contact_sales.htm';//external
// partners menu
var thismenuname = menudiv[2];
eval("menus." + thismenuname + "= new Array()");
eval("thismenu = menus." + thismenuname);
thismenu.width = 200;
thismenu.x = 473;//external
thismenu.rollheight = 0;
thismenu.text = new Array();
thismenu.text[0] = 'Partner Programs';//external
thismenu.text[1] = 'Technology Partner Program';//external
thismenu.text[2] = 'Business Partner Program';//external
thismenu.text[3] = 'Partner Directory';//external
thismenu.link = new Array();
thismenu.link[0] = 'partners.htm';//external
thismenu.link[1] = 'partners_1610.htm';//external
thismenu.link[2] = 'partners_1654.htm';//external
thismenu.link[3] = 'partners_1656.htm';//external
// support menu
var thismenuname = menudiv[3];
eval("menus." + thismenuname + "= new Array()");
eval("thismenu = menus." + thismenuname);
thismenu.width = 200;
thismenu.x = 534;//external
thismenu.rollheight = 0;
thismenu.text = new Array();
thismenu.text[0] = 'Support Contacts';//external
thismenu.text[1] = 'Customer Service Center';//external
thismenu.text[2] = 'Product Documentation';//external
thismenu.text[3] = 'Product Training';//external

thismenu.link = new Array();
thismenu.link[0] = 'support.htm';//external
thismenu.link[1] = 'support_customer_service_center.htm';//external
thismenu.link[2] = 'eduservices_1401.htm';//external
thismenu.link[3] = 'eduservices_3410.htm';//external

function topnav_preload() {
    var preloaded = new Array();
    for (i=0;i<arguments.length;i++) {
        preloaded[i] = new Image();
        // preloaded[i].src = args[i];
        preloaded[i].src = '/images/nav_' + arguments[i] + '_over.gif';
    }
}

function swapMenu(name, mouse_is_on) {
    alignMenus();
    if (mouse_is_on) {
        clearTimeout(timerID);
        clearTimeout(stoprolltimer);
        turnOff(name);
        showIt(name,1);
        if (rolling == 1) rollIt(name, 6, 7);
    } else {
        clearTimeout(timerID);
        clearTimeout(stoprolltimer);
        timerID = setTimeout('turnOff("")', disappeardelay);
        stoprolltimer = setTimeout('stopRoll("' + name + '")', disappeardelay);
    }
}
function rollInit(layid) {
    eval("thismenu = menus." + layid);
    rt = thismenu.width;
    //clipIt(layid,tp,rt,bt,lf)
    clipIt (layid, 0, rt, 0, 0);
    thismenu.rollheight = 0;
}
function rollIt(layid, delay, amt) {
    layr = handleIt(layid);
    eval("thismenu = menus." + layid);
    amount = amt;
    theTime = delay;
    thelayer = layid;
    realrollIt();
}
function realrollIt() {
    rt = thismenu.width;
    maxheight = thismenu.height;
    thismenu.rollheight = thismenu.rollheight + amount;
    //alert (rollheight);

    if (thismenu.rollheight > maxheight) {
        thismenu.rollheight = maxheight;
        clipIt (thelayer, 0, rt, thismenu.rollheight, 0);
    } else {
        clipIt (thelayer, 0, rt, thismenu.rollheight, 0);
        rolltimer = setTimeout('realrollIt("")', theTime);
    }
}
function stopRoll(name) {
    eval("thismenu = menus." + name);
    thismenu.rollheight = 0;
    clearTimeout(rolltimer);
}
function turnOff(name) {
    for (i=0; i<menudiv.length; i++) {
        if (name.indexOf(menudiv[i])==-1) {
            moveIt(menudiv[i],-400, navy);
            showIt(menudiv[i],0);
            stopRoll(menudiv[i]);
        }
    }
}
function alignSize() {
    //document.location.href = document.location.href;
    location.reload(true);
    //window.onresize = alignSize;
}

function alignMenus() {
    offset_value=0;
    adjust=0;

    if (document.layers) {  // for netscape 4.x
        placerimageloc = findPosition('navlocateimg');
        offset_value = placerimageloc[0];
    } else {
        placerimageloc = findPosition('navlocate');
        offset_value = placerimageloc[0];
    }
    for (i=0; i<menudiv.length; i++) {
        if (i==menudiv.length-1) {
            adjust=0;  // set the negative offset for the last pulldown here
        }
        moveIt(menudiv[i],menus[menudiv[i]].x + offset_value - adjust, navy);
        adjust=0;
    }
}



/*****************from common JS***********************/
function truncate (a) {
	var truncateString;
    if (document.getElementById) {
    	truncateString=document.getElementById(a).innerHTML;
	} else {
    	truncateString=a.innerHTML;
    }
    truncateString = truncateString.substring(0,201);
    iPos = truncateString.lastIndexOf(" ");
    truncateString = truncateString.substring(0,iPos);

    if (document.getElementById) {
    	document.getElementById(a).innerHTML=truncateString;
	} else {
    	a.innerHTML=truncateString;
    }
}

function swapQuote(image) {
	document.hmQuote.src = image;
}

function openWindow(location,width,height,attributes) {
	if ((typeof wNew != "object")||(wNew.closed)) {
		var sAttrib = "width="+parseInt(width)+",height="+parseInt(height);
		if (typeof attributes!="undefined") sAttrib += ","+attributes;
			wNew = window.open(location,"wNew",sAttrib);
		}
		wNew.location = location;
		wNew.focus();
	}

function check() {
  if (document.resumeForm.firstname.value == "" ||
   document.resumeForm.lastname.value == "" ||
   document.resumeForm.street.value == "" ||
   document.resumeForm.city.value == "" ||
   document.resumeForm.homephone.value == "" ||
   document.resumeForm.resumefile.value == "" ||
   document.resumeForm.email.value == "") {
    alert ("Please fill out all required fields.");
  } else {
  	if (document.resumeForm.joblist.value == ""){
		alert("There are no positions currently in your job cart. You must choose at least one position to apply for.");
	}else{
    	document.resumeForm.submit();
	}
  }
}

function setJobList() {
   var pairs = document.cookie.split(";");
   var joblistValue = document.resumeForm.joblist.value;

   for (var i=0; i<pairs.length; i++)
   {
   		var pairSplit = pairs[i].split("=");
      	if (pairSplit[0].indexOf("jobs") >= 0)
      	{
        	if (joblistValue.indexOf(pairSplit[1]) >= 0) return;

        	if ((joblistValue.length > 0) && (pairSplit[1].indexOf(joblistValue) < 0)) {
        		document.resumeForm.joblist.value = unescape(pairSplit[1] + "," + joblistValue);
  			}
        	else
       			document.resumeForm.joblist.value =  unescape(pairSplit[1]);
   		}
   }
}

// changeClass(item string, color string-hexvalue)
//  Use this function to change the background color of a table cell on rollover
//  To use, the <td> tag needs to have 'id' and 'name' attributes defined specific to the cell.
//  <td id="aboutsection_leftnav" name="aboutsection_leftnav" onMouseover="changeBg('aboutsection_leftnav', '#ededed');" onMouseout="changeBg('aboutsection_leftnav', '#ffffff');"></td>
//
function changeClass(item, newclass) {
	var cell = document.getElementById(item);
	cell.className = newclass;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(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&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&id.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


/**********dhtml.js**********************************************/
var ml = new Array();
var vz = new Array();
var lszix = new Array();
var lsziy = new Array();

var sho=new Array();
var indx;
var delayit;

var donechk = 0;

if (document.layers){
	sho[0]="hide";
	sho[1]="show";
} else {
	sho[0]="hidden";
	sho[1]="visible";
}

function handleIt(layid) {
	if (document.layers){
  		rtn = eval('document.' + layid);
	  	return(rtn);
    } else if (document.getElementById){
     	rtn1 = document.getElementById(layid).style;
     	return(rtn1);
	} else if (document.all) {
	  	eval("rtn = document.all." + layid + ".style");
  		return(rtn);
  	}

  	else return(null);
}

function makeIt(layid, lposx, lposy, lsizx, lsizy, layon, incode, opacity) {
	if (opacity == '') opacity = 100;
	indx = ml.length;
	ml[indx] = layid;
	vz[indx]=layon;
	lszix[indx]=lsizx;
	lsziy[indx]=lsizy;

	if (document.layers) {
		document.writeln('<layer name="' + layid + '" left=' + lposx + ' top=' + lposy + ' width=' + lsizx + ' height=' + lsizy +  ' visibility=' + (layon ? '"show"' : '"hide"') + ' z-index=' + indx + '>');
		document.writeln(incode);
		document.writeln('</layer>');
		layer = handleIt(layid);
		layer.width = lsizx;
		layer.height = lsizy;
	} else {
		document.writeln('<div id="' + layid + '" style="filter:alpha(opacity=' + opacity + '); -moz-opacity:' + opacity/100 + '; opacity:' + opacity/100 + '; position:absolute; overflow:none; left: ' + lposx + 'px; top: ' + lposy + 'px; width: ' + lsizx + 'px; height: ' + lsizy + 'px;' + ' visibility:' + (layon ? 'visible;' : 'hidden;') + ' z-index:' + indx + ';">');
		document.writeln(incode);
		document.writeln('</div>');
  	}
}

function moveIt(layid,mx,my) {
	layr = handleIt(layid);
	layr.left = mx;
	layr.top = my;
}

function clipIt(layid,tp,rt,bt,lf) {
	layr = handleIt(layid);
	if (document.layers) {
    	layr.clip.top = tp;
		layr.clip.right = rt;
		layr.clip.bottom = bt;
		layr.clip.left = lf;
	} else {
		layr.clip = 'rect(' + tp + ' ' +  rt + ' ' + bt + ' ' + lf +')';
	}
}

function showIt(layid, shm) {
	layr = handleIt(layid);
	layr.visibility = sho[shm];
}

function remakeIt(name, content) {
	if (document.layers) {
		var layer = eval('document.' + name);
		layer.document.open();
		layer.document.writeln(content);
		layer.document.close();
	} else if (document.all) {
    	document.all(name).innerHTML = content;
	} else if (document.getElementById){
		document.getElementById(name).innerHTML = content;
	}
}

function stackIt(layid, zlv) {
	layr = handleIt(layid);
	layr.zIndex = zlv;
}

function sizeIt(layid,mx,my) {
	layr = handleIt(layid);
	layr.width = mx;
	layr.height = my;
}

function findPosition( oLink ) {
	if (document.layers) {
		theobj = document.eval(oLink);
	}

	if ((!document.all) && (document.getElementById)) {
		theobj = document.getElementById(oLink);
	}

	if (document.all) {
		theobj = document.all[oLink];
	}

	if( theobj.offsetParent ) {
		for( var posX = 0, posY = 0; theobj.offsetParent; theobj = theobj.offsetParent ) {
			posX += theobj.offsetLeft;
			posY += theobj.offsetTop;
		}
		return [ posX, posY ];
	} else {
		return [ theobj.x, theobj.y ];
	}
}

donechk=1;


//***************function for onmouseover on firefox*****************//

//function fnOverOut(obj,attr,val){
function fnOverOut(obj,attr){
	var p = getParentObj(obj,"TABLE");
	
	var t = getNextSibling(p);
			t.style.display = attr;
	//getNextSibling(stam).style.display = "block";
}

function getNextSibling(startBrother){
  var endBrother=startBrother.nextSibling;
  while(endBrother.nodeType!=1){
    endBrother = endBrother.nextSibling;
  }
  return endBrother;
}

function getParentObj(o,par){
	var tPar = o.parentNode;
	while(tPar.tagName!=par){
		tPar = tPar.parentNode;
	}
	return tPar;
}
//fnOverOut(this.parentNode.parentNode.parentNode.parentNode.childNodes[1],'display','');

//***************function for onmouseover on firefox*****************//