// JavaScript Document

//-------------------------------------------------------------------------------------------
function changeImgs( x,y ) {
	a = document.getElementById( 'LImg' );
	b = document.getElementById( 'SImg' );
	a.src=x;
	b.src=y;
}

function toggleLayer(whichLayer) 
 { 
 if (document.getElementById) 
 { 
 // this is the way the standards work 
 var style2 = document.getElementById(whichLayer).style; 
 style2.display = style2.display? "":"block"; 
 } 
 else if (document.all) 
 { 
 // this is the way old msie versions work 
 var style2 = document.all[whichLayer].style; 
 style2.display = style2.display? "":"block"; 
 } 
 else if (document.layers) 
 { 
 // this is the way nn4 works 
 var style2 = document.layers[whichLayer].style; 
 style2.display = style2.display? "":"block"; 
 } 
 }
 
 var lastDiv = "";
function showDiv(divName) {
	// hide last div
	if (lastDiv) {
		document.getElementById(lastDiv).className = "hiddenDiv";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divName && document.getElementById(divName)) {
		document.getElementById(divName).className = "visibleDiv";
		lastDiv = divName;
	}
}


//---------------------------------------------------------------------------------------------------//
//here you place the ids of every element you want.
var ids=new Array('div1','div2','div3','div4','div5','div6','div7');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
//-----------------------------------------------------------------------------------------//
// Create array to hold four URLs;
var dest = new Array(15);
dest[0] = window.location.href;
dest[1] = "/solutions/sol.asp";
dest[2] = "/solutions/direct.asp";
dest[3] = "/solutions/voice.asp";
dest[4] = "/solutions/mtech.asp";
dest[5] = "/solutions/mop.asp";
dest[6] = "/solutions/ecrm.asp";
dest[7] = "/solutions/onlinem.asp";
dest[8] = "/services/serv.asp.asp";
dest[9] = "/services/strat.asp";
dest[10] = "/services/analyt.asp";
dest[11] = "/services/datab.asp";
dest[12] = "/services/content.asp";
dest[13] = "/services/create.asp";
dest[14] = "/services/techdev.asp";




function go(d) {

// Change location of current window one selected from menu
// d.menu.options.selectedIndex returns a number that corresponds
// to the choice they selected in the pop up menu on the form
// If a user selected the first choice, selectedIndex = 0 and the 
// URL will be set to dest[0] or http://www.utexas.edu


window.location.href = dest[d.destination.options.selectedIndex];     
   

// Open new window with selected location
// var x = window.open(dest[d.destination.options.selectedIndex],"New Window");

// To set the URL for another frame in this frameset
// top.framename.location.href = dest[d.menu.options.selectedIndex]);

}

// PopUp window function
function popUp(URL) {
	base="/";
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(base + URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=700,left = 312,top = 184');");
}

//--------------------------------------------------------------------------//

function jumptolink(what) {
var selectedopt=what
if (document.getElementById && selectedopt.getAttribute("target")=="self") {
window.open(selectedopt.value)
}
else {
window.location=selectedopt.value
}
}


