function openWindow(theURL,winName,features) { 
	window.open(theURL,winName,features);
}

// This function is necessary to work arounnd the ID "Click to activate issue"
function loadFlashApp(path,width,height) {
  document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
  document.write("  <param name='movie' value='"+path+"'>");
  document.write("  <param name='quality' value='high'>");
  document.write("  <embed src='"+path+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>");
  document.write("</object>");
}

/* The following controls the timer to ensure that
  there is only one timer running at all times */
  
var countDown = null;     //the name of the timer itself

function setTimerFlag() {
  countDown = setTimeout("hideDirector()",1000);
}
           
function hideDirector() {
  document.getElementById("directorBox").style.visibility = "hidden";
}

function holdDirector() {
  clearTimeout(countDown);
}

/* The following determines the anchor's x and y coordinates,
  sets the div's position accordingly, and populates the link
  values within the div */

function showDirector(anchorname,path) {
  clearTimeout(countDown);

	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;

  document.getElementById("directorBox").innerHTML = "<p><a href='"+path+"?area=europe' onmouseover='javascript:holdDirector();' class='europeStuBullet'>European Students</a><a href='"+path+"?area=asia' onmouseover='javascript:holdDirector();' class='asiaStuBullet'>Asian Students</a><a href='"+path+"?area=la' onmouseover='javascript:holdDirector();' class='laStuBullet'>Latin American Students</a><a href='"+path+"?area=row' onmouseover='javascript:holdDirector();' class='rowStuBullet'>Students in Other Regions</a></p>";
  document.getElementById("directorBox").style.left = x;
  document.getElementById("directorBox").style.top = y+14;
  document.getElementById("directorBox").style.visibility = "visible";
}

function showFeatDirect(anchorname,area,bullet) {
  clearTimeout(countDown);

	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;

  document.getElementById("directorBox").innerHTML = "<p><a href='/featured/index_grad_prog.jsp?area="+area+"' onmouseover='javascript:holdDirector();' class='"+bullet+"StuBullet'>Graduate Programs</a><a href='/featured/index_four_year.jsp?area="+area+"' onmouseover='javascript:holdDirector();' class='"+bullet+"StuBullet'>Four-Year Schools</a><a href='/featured/index_two_year.jsp?area="+area+"' onmouseover='javascript:holdDirector();' class='"+bullet+"StuBullet'>Community Colleges and Two-Year Schools</a><a href='/featured/index_esl.jsp?area="+area+"' onmouseover='javascript:holdDirector();' class='"+bullet+"StuBullet'>ESL Schools</a><a href='/featured/index_art_design.jsp?area="+area+"' onmouseover='javascript:holdDirector();' class='"+bullet+"StuBullet'>Performing and Visual Arts Schools</a></p>";
  document.getElementById("directorBox").style.left = x;
  document.getElementById("directorBox").style.top = y+14;
  document.getElementById("directorBox").style.width = "230px";
  document.getElementById("directorBox").style.visibility = "visible";
}

function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
}

function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
}