

//$(document).ready(function(){
//    var n = 0;
//    $("li.level1").mouseenter(function()
//    {
// 
//     var navID = this.id.replace("li","s");
//     $('.level2').hide();
//     $('#'+navID).show();
//      
//    }).mouseleave(function()
//    {
//     
//        var navID = this.id.replace("li","s");
//        $('#'+navID).hide();
//        
//        if($('.nav_about_selected').length>0)
//        {
//            $('#s_nav_about').show();
//        }
//        else if($('.nav_workinghere_selected').length>0)
//        {
//            $('#s_nav_workinghere').show();
//        }
//        else if($('.nav_careerareas_selected').length>0)
//        {
//            $('#s_nav_careerareas').show();
//        }
//        else if($('.nav_campus_selected').length>0)
//        {
//            $('#s_nav_campus').show();
//        }
//        else if($('.nav_searchjobs_selected').length>0)
//        {
//            $('#s_nav_search_jobs').show();
//        }
//        //$('.nav_about').removeClass("nav_about_selected");
//        
//    });
//});


function openPopup(vURL,vWidth,vHeight)
{
   window.open(vURL,"popup","menubar=1,resizable=1,top=120,width="+vWidth+",height="+vHeight+",scrollbars=yes");
}

function fnSearch()
{
     var q = document.getElementById('ctl00_tbxUserName').value;
     window.location = "/search.aspx?cx=011507282648940707954%3Ay%2D4skixjj4s&client=google-csbe&output=xml_no_dtd&q=" + q + "&proxyreload=1&start=0"
}





//espn: 011507282648940707954%3Ay%2D4skixjj4s
//005554692015213564881%3Abzmeiejr4no
function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;


if (keycode == 13)
   {
   fnSearch();
   return false;
   }
else
   return true;
}
    
    
 function HandleTestimonialDisplay(layerid1,layerid2)
	{
	    
	    var Ctr1 = document.getElementById(layerid1);
	    Ctr1.style.display = 'block';
	    var Ctr2 = document.getElementById(layerid2);
	    Ctr2.style.display = 'none';
	}
	
	// Check Browser CSS Compatibility
	
	// alert(document.compatMode);
	
	// Supress BOM Script Errors	
	
	function errorsuppressor(){
	return true;
	}

	if(location.href.indexOf("localhost") == -1)
	{
		window.onerror = errorsuppressor;
	}

	// Multiple Onload Utility

	function addLoadEvent(func) {

		var oldonload = window.onload;

		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
			oldonload();
			func();
			}
		}
	}



	// Insert-after Function

	function insertAfter(newElement, targetElement) {

	var parent = targetElement.parentNode;

	if (parent.lastChild == targetElement) {
		parent.appendChild(newElement);
	} else {
		parent.insertBefore(newElement, targetElement.nextSibling);
		}
	}
	
	// Secondary Nav (IE 6 only)

	secondarynavhover = function() {

		if (!document.getElementById) return false;
		if (!document.getElementById("secondarynav")) return false;

		var listElements = document.getElementById("secondarynav").getElementsByTagName("li");

		for (var i=0; i < listElements.length; i++) {

			listElements[i].onmouseover = function() {
			this.className+=" iehover";
			}

			listElements[i].onmouseout = function() {
			this.className = this.className.replace(new RegExp(" iehover\\b"));
			}

		}
	}

	if (window.attachEvent) window.attachEvent("onload", secondarynavhover);
	
	// Global Pop-up (parse through DOM, if viewpage class exists, append event)

	function newWinLinks() {

		for (var i=0; i < document.links.length; i++) {

			if (document.links[i].className == "viewpage") {
			document.links[i].onclick = displayJob;
			}
			
			if (document.links[i].className == "newpage") {
			document.links[i].onclick = displayNewPage;
			}
			
			if (document.links[i].className == "viewvideo") {
			document.links[i].onclick = displayVideo;
			}
			
			if (document.links[i].className == "openingvid") {
			document.links[i].onclick = viewOpening;
		
			}

		}
	}
	
	addLoadEvent(newWinLinks);

	function displayJob() {

		var pageWindow = window.open(this.href,"win", 'toolbar=1,location=1,directories=0,status=0,menubar=1,scrollbars=yes,resizable=1,top=150,left=250,width=488,height=500');
		pageWindow.focus();
		return false;
	}
	
	function displayNewPage() {

		var pageWindow = window.open(this.href,"win", 'toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=yes,resizable=1,top=50,left=100,width=1124,height=668');
		pageWindow.focus();
		return false;
	}
	
	function displayVideo() {

		var pageWindow = window.open(this.href,"win", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=100,left=200,width=640,height=482');
		pageWindow.focus();
		return false;
	}
	
    function displayVideoFromFlash(vidurl) {

		var pageWindow = window.open(vidurl,"win", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=100,left=200,width=640,height=482');
		pageWindow.focus();
		//return false;
	}
	
	function viewOpening() {
        var pageWindow = window.open(this.href,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=100,left=200,width=440,height=330');
        pageWindow.focus();
        return false;
    }
	
	// Show/Hide Divs
	
	function initShowHide() {
	
	if (!document.getElementById("profilename")) return false;
	
	var para = document.createElement("p");
	var strtxt = document.createTextNode("We think we're a great company. But don't take our word for it. Click on a picture of our employees on the right and see what they have to say."); //Tokenize this
	para.setAttribute("id", "defaultcontent");
	para.appendChild(strtxt);
	
	var lastnode = document.getElementById("p1");
	var parentnode = lastnode.parentNode;
	parentnode.insertBefore(para, lastnode);	
	
	
	if (document.getElementById && document.getElementsByTagName && document.createTextNode) {
	
		hide();
	
		var profilename = document.getElementById('profilename');
		var as = profilename.getElementsByTagName('a');
	
		for (var i = 0; i < as.length; i++) {
			
				as[i].onclick = function() {
				show(this);
				//window.status = "Testimonial"; 
				return false;
				}
	
				//as[i].onmouseout = function() {
				//hide(this);
				//window.status = ""; 
				//return true;
				//}
				
				//as[i].onclick = function() {
				//return false;
				//}
					
			}			
		}
	}
		
	function show(s) {
	
	hide();
	
	var id = s.href.match(/#(\w.+)/)[1];
	document.getElementById(id).style.display = 'block';
	document.getElementById("defaultcontent").style.display = 'none';
	
	}
	
	function hide() {
	
	var profilecontent = document.getElementById('profilecontent').getElementsByTagName('div');
	
	for (var i = 0; i < profilecontent.length; i++) {
		profilecontent[i].style.display = 'none';
		}
	
	document.getElementById("defaultcontent").style.display = 'block';
	
	}
		
	addLoadEvent(initShowHide);
	
	// Why ATT - Movie Afterthought
		
	function createFlash() {
	
	var flashvars = {};
	var params = {menu: "false", wmode: "opaque", base: "media/videoplayer/"};
	var attributes = {};
	
	swfobject.embedSWF("media/videoplayer/videoplayer.swf", "loader", "351", "241", "8", "media/flash/app_expressinstall.swf", flashvars, params, attributes);
	
	}
	
	function createATTVideoFlash(vSWF) {
	
	var flashvars = {};
	var params = {menu: "false", salign: "TL", wmode: "opaque", base: "media/videoplayer/"};
	var attributes = {};
	
	swfobject.embedSWF(vSWF, "flashcontent",  "351", "351", "8", "media/flash/app_expressinstall.swf", flashvars, params, attributes);
	
	}
		
	function createATTVideoBlank() {
	
	var flashvars = {};
	var params = {menu: "false", salign: "TL", wmode: "opaque", base: "media/videoplayer/"};
	var attributes = {};
	
	swfobject.embedSWF("media/videoplayer/aaa.swf", "flashcontent",  "351", "351", "8", "media/flash/app_expressinstall.swf", flashvars, params, attributes);
	
	}
		
	function toggle(elemnt1, elemnt2){

	var container1 = document.getElementById(elemnt1); 
	var container2 = document.getElementById(elemnt2);
	var flash = document.getElementById("movie");

	container1.style.display = 'none';
	container2.style.display = 'block';
	
	if (elemnt1 == "movie") {
	
	flash.innerHTML = "";
	
	} else {
	
	/* Create Object Div */
	
	var newdiv = document.createElement("div");
	newdiv.setAttribute("id", "loader");
	
	/* Create Link */
		
	var para = document.createElement("p");
	var anchor = document.createElement("a");
	var strtxt = document.createTextNode("Close Video");
	anchor.className = "close";
	para.appendChild(anchor);
	anchor.appendChild(strtxt);
	anchor.onclick = function() {
	toggle('movie', 'media')
	return false;
	}
	
	flash.appendChild(newdiv);
	flash.appendChild(para);
	createFlash();
		
	}
	
	}
	
	
	/* Begin code for Bookmark  Icon*/

	function appendAddThis() {
	
		if (!document.getElementById) return false;
		if (!document.getElementById("bookmark")) return false;
	
		var list_addthis = document.getElementById("bookmark").getElementsByTagName("a")[0];

		list_addthis.onmouseover = function() {
			return addthis_open(this, '', '[URL]', '[TITLE]');
		}

		list_addthis.onmouseout = function() {
			addthis_close();
		}

		list_addthis.onclick = function() {
			return addthis_sendto();
			return false;
		}
	
	}
	
	addLoadEvent(appendAddThis);
	
	/* Addthis variables*/
	
	var addthis_pub = "attjobs"; // Replace with ATT Variables
	var addthis_brand = "att.jobs";
	var addthis_options = "email, favorites, print, delicious, digg, google, myspace, live, facebook, linkedin, twitter, more"; 
	var addthis_offset_top = -15;
	var addthis_offset_left = -108;




    /* End Bookmark Code */
    
    
    /* Award Popup */
    
    function closeAwardPopup(divname)
    {
        var obj = document.getElementById(divname);
        obj.style.visibility = "hidden";
    }
    
    function showPopup(popupID)
    {
        var listElements = document.getElementById("popup").getElementsByTagName("div");
        for (var i=0; i < listElements.length; i++) {listElements[i].style.visibility= "hidden";}
        document.getElementById(popupID).style.visibility= "visible";
    }
    
    /* End Award Popup */
    
    function createFlashVideo(vWidth,vHeight,vFLV,vIMG) 
    {
     
	    var flashvars = false;
	    var params = {
	        codebase: "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'",
	        quality: "high",
	        menu: "false",
	        align: "middle",
            wmode: "opaque",	
            scale: "noScale",    
            bgcolor: "#EBBE0D",
            salign: "TL",
	        flashvars : "videoURL=/flash/"+vFLV+"&autoPlay=false&startPhotoSource=/flash/"+vIMG+"&hideControls=false&backgroundColor1=0x333333&backgroundColor2=0x222222"
	    };
	    var attributes = {};
	    swfobject.embedSWF("/flash/Player.swf", "flashContent", vWidth, vHeight, "8", "media/app_expressinstall.swf", flashvars, params, attributes);
    }