	
	
	/* ANNA - BASIC JAVASCRIPT (basic.js) - 
	   this file contains basic JavaScript for rollovers, popups, etc
	   and is included on all pages. It also contains the DHTML scripting for
	   the pop-up navigation menu scheme. */

	
	function openmail(raddr) {
		var wURL, wAttrs;
	
		wURL = 'ma' + 'il' + 'to:' + raddr + '@' + 'an' + 'na' + 'demovid' + 'ova' + '.' + 'co' + 'm';
		//wAttrs = "height=464,width=620,resizable=no,scrollbars=no,status=no,toolbar=no,location=no";
		window.open(wURL, "", "");
		window.focus;		
	}

	
	function openJobApp(jid) {
		var wAttrs, wURL;
		
		if (jid.length > 0) {
			wAttrs = "width=800,height=600,menubar=no,toolbar=yes,resizable=yes,scrollbars=yes,status=yes";
			wURL = "http://www.rtkl.com/apply_online.aspx?jobID=" + jid;
			window.open(wURL, "RTKLApp", wAttrs);
			window.focus;				
		}	
	}

	
	function setElementVisibility (obj, mode) {
		// update visibility of element requested
		if (mode == "h")
			var setstyl = "hidden";
		else
			var setstyl = "visible";
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			document.getElementById(obj).style.visibility = setstyl;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				document.all(obj).style.visibility = setstyl;
			}	
		}		
	}	
	
	function setElementText (obj, str) {
		// update HTML of element requested
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			document.getElementById(obj).innerHTML = str;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				document.all(obj).innerHTML = str;	
			}	
		}		
	}	
	
	function getElementText (obj) {
		// get HTML of element requested
		var str;
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			str = document.getElementById(obj).innerHTML;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				str = document.all(obj).innerHTML;	
			}	
		}	
		return str;
	}	
	
	function setElementBkgdColor (obj, clr) {
		// update background-color of element requested
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			document.getElementById(obj).style.backgroundColor = clr;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				document.all(obj).style.backgroundColor = clr;	
			}	
		}		
	}	
	
	function setElementColor (obj, clr) {
		// update background-color of element requested
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			document.getElementById(obj).style.color = clr;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				document.all(obj).style.color = clr;	
			}	
		}		
	}
	
	function showWinH() {
		var winh;
		//winh = window.innerHeight;
		winh = document.body.clientHeight;
		alert(winh);
	}
 
	function RollOnBasic(imgName) {
		if (document.images){
			imgFileName = "";
			imgOld = document.images[imgName].src;
			dotPos = imgOld.lastIndexOf('.');
			imgExt = imgOld.substring(dotPos+1, dotPos+4); 
			imgFileName = imgOld.substring(0, imgOld.lastIndexOf('_'));
			imgFileName = imgFileName + "_2." + imgExt;
			document.images[imgName].src = imgFileName;
		}
	}
	
	function RollOffBasic(imgName) {
		if (document.images){
			imgFileName = "";
			imgOld = document.images[imgName].src;
			dotPos = imgOld.lastIndexOf('.');
			imgExt = imgOld.substring(dotPos+1, dotPos+4); 
			imgFileName = imgOld.substring(0, imgOld.lastIndexOf('_'));
			imgFileName = imgFileName + "_1." + imgExt;
			document.images[imgName].src = imgFileName;
		}
	}

	
	function hideOrShowItem (obj, stat) {
		var vis;
		if (stat == 1) {
			vis = "visible";
			lastVisDiv = obj;
		} else {
			vis = "hidden";
			lastVisDiv = "";
		}
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			document.getElementById(obj).style.visibility = vis;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				document.all(obj).style.visibility = vis;	
			}	
		}
	}
	
	function toggleFldMode(obj, basenm) {
		var stat = null;
		var setstyl = null;
		var fldid;
		
		fldid = obj + '_id';
		//toggle mode from whatever it is now, so need to check current status
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			stat = document.getElementById(obj).style.visibility;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				stat = document.all(obj).style.visibility;	
			}	
		}
				
		//set to opposite of current status
		if (stat == 'visible')
			setstyl = 'hidden';
		else
			setstyl = 'visible';
					
		//now set mode of object	
		if (document.getElementsByTagName && document.getElementById) {
			//Netscape 6+ model (also works in IE 6)
			document.getElementById(obj).style.visibility = setstyl;
			//disable the field if hidden, so only one field passed
			if (setstyl == 'hidden')
				document.getElementById(fldid).disabled = true;
			else
				document.getElementById(fldid).disabled = false;
		} else {
			if (document.all) {
				//IE model (at least, versions prior to 6)
				document.all(obj).style.visibility = setstyl;
				//disable the field if hidden, so only one field passed
				if (setstyl == 'hidden')
					document.all(fldid).disabled = true;
				else
					document.all(fldid).disabled = false;	
			}
		}
		return setstyl;	
	}	
	
	function updateText(obj, str) {
		// update text of element requested - this is for debugging popup script above
		var str;
		str = str + "<br>" + getElementText(obj);
		setElementText (obj, str);
	}
	
	
	
	// *** DMS 5-12-06: pasted in Sarah's IE active content kluge:
	// this function lets javascript output the necessary Flash object and embed tags
	// to workaround IE 6's new 'active content' security warnings 
	// *** DMS 5-13-06: added width & height params so can use for Help or other Flash content as well
	function RunFlash(flashfile, flashW, flashH) {
	   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=6,0,0,0" width="' + flashW + '" height="' + flashH + '">\n');
	    document.write(' <param name=movie value="' + flashfile + '" />\n');
		document.write(' <param name=quality value=high />\n');
		document.write(' <embed src="' + flashfile + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + flashW + '" height="' + flashH + '">\n');
		document.write('</embed>\n');
	    document.write('</object>\n');
	}	
		
		