
		
function openWindow(loc, winWd, winHt, winCen, winSize, winScroll) {
	var winLeft = (winCen) ? (screen.width  - winWd) / 2 : 0;
	var winTop  = (winCen) ? (screen.height - winHt) / 2 : 0;
	var winName = (loc.indexOf("/") == -1) ? loc.split(".")[0] : (loc.indexOf(".") == -1) ? loc.split("/")[loc.split("/").length-1].split(".")[0] : '';

	winSize     = (winSize)   ? "yes" : "no";
	winScroll   = (winScroll) ? "yes" : "no";

	var popWin  = window.open(loc, winName, "toolbar=no,location=no,status=no,resizable=" + winSize + ",scrollbars=" + winScroll + ",width=" + winWd + ",height=" + winHt + ",left=" + winLeft + ",top=" + winTop);

	popWin.focus();
}
	
function checkValue(obj,e){
	//This will return an error if the user does not enter a numaric value
	var kCode = (((e)&&(e.which))?e.which:self.event.keyCode);
	if (obj.value!='') 
		if ((kCode<48||kCode>57)&&(kCode<96||kCode>105)&&kCode!=188){
			//alert(kCode);
			//alert('you must enter a numaric value.');
			obj.value='';
		}
	
}

function coursecheck2(cid) {
	var cid;
	var checkedcourses="";
	for (var i = 0; i < document.theform.elements.length; i++) {
		if (document.theform.elements[i].name == "courses") {
			if (document.theform.elements[i].checked) {
				if (checkedcourses == "") {
					checkedcourses = document.theform.elements[i].value
				}
				else {
					checkedcourses = checkedcourses + "," + document.theform.elements[i].value	
				}
			}	
		}		
	}
	open_description2(cid, checkedcourses)
}

function open_description2(cid, checkedcourses) {
	CourseDescription  = window.open('./coursedescription.asp?checked=' + checkedcourses + '&cid=' + cid, 'CourseDescription', 'height=400,width=500,left=0,top=0,location=0,scrollbars=1,menubar=0,resizable=0,status=0,directories=0');
}

// webcounter 

var SERVER_CONTROLLER = "/common/control.asp";

function startTicker() {
	
	refreshFunction = 'executeRequest(\'action=refresh\')';
	eval(refreshFunction);
	setInterval(refreshFunction, 60000);
	
}

function executeRequest(params) {
	
	var head = document.getElementsByTagName('head').item(0);
	var old  = document.getElementById('lastLoadedCmds');
	if (old) head.removeChild(old);
	
	script = document.createElement('script');
	
	parameters = new String(params).split(',');
	
	var scriptUrl = SERVER_CONTROLLER + '?rnd=' + Math.random();
	for (var i = 0; i < parameters.length; i++) {
		scriptUrl += "&" + parameters[i];
	}
	
	script.src = scriptUrl;
	script.type = 'text/javascript';
	script.defer = true;
	script.id = 'lastLoadedCmds';
	
	void(head.appendChild(script));
	
} 

function update(id, html) {
	var doc = eval('document');
	var l;
	var r;
	if (doc.layers) {
		l = doc[id];
		l.document.open();
		l.document.write(html);
		l.document.close();
	} else if (doc.all && doc.all[id]) {	//IE
		doc.all[id].innerHTML = html;
	} else if (doc.createRange) {			//Netscape
		l = doc.getElementById(id);
		r = doc.createRange();
		while (l.hasChildNodes()) {
			l.removeChild(l.lastChild);
		}
		r.setStartAfter(l);
		var docFrag = r.createContextualFragment(html);
		l.appendChild(docFrag);
		}
	
}

function updateMessages(id, html) {
	update(id, html);
}

function flash_pod(file, xsize, ysize)
{
	ex_line='<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="' + xsize + '" height="' + ysize + '"><param name="movie" value="/images/' + file + '"><param name="quality" value="high"><embed src="/images/' + file + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + xsize + '" height="' + ysize + '"></EMBED></object>'
	document.write(ex_line);
}

