//prevent Enter key from submitting form
function noenter() {
  return !(window.event && window.event.keyCode == 13); 
}

function openScreenshot(appID,appImageID) {
	var url, name, opt;
	url = '/industry/applicationScreenshot.asp?appID=' + appID + '&appImageID=' + appImageID;
	name = 'appScreenshot';
	opt = 'directories=no,height=600,width=800,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no'
	window.open(url, name , opt);
}

function openClassDetail(courseID) {
	var url, name, opt;
	url = '/class/class_detail.asp?courseID=' + courseID;
	name = 'courseDetail';
	opt = 'directories=no,height=400,width=600,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no'
	window.open(url, name , opt);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function mOver(image, dir) {
	if (document.images && (preloadFlag == true)) {
		document[image].src = '/images/' + dir + image + '-over.gif';
	}
	return true;
}

function mOut(image, dir) {
	if (document.images && (preloadFlag == true)) {
		document[image].src = '/images/' + dir + image + '.gif';
	}
	return true;
}

function mOverDot(image) {
	if (document.images && (preloadFlag == true)) {
		document[image].src ="/images/leftnav3/bar-over.gif";
	}
	return true;
}
function mOutDot(image) {
	if (document.images && (preloadFlag == true)) {
		document[image].src ="/images/leftnav3/bar.gif";
	}
	return true;
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		p_topnav_commercial_over = newImage("/images/topnav/g_commercial-over.gif");
		p_topnav_specialty_over = newImage("/images/topnav/g_specialty-over.gif");
		p_topnav_realestate_over = newImage("/images/topnav/g_realestate-over.gif");
		p_topnav_residential_over = newImage("/images/topnav/g_residential-over.gif");
		leftnav_dot = newImage("/images/leftnav3/bar.gif");
		leftnav_dot_over = newImage("/images/leftnav3/bar-over.gif");
		preloadFlag = true;
	}
}

var rc = 0;
function resizeElements() {
	if (rc < 1000) {
		var wh, ww, oh, ow, nh, nw, fh, obj;
		if (navigator.appName.indexOf('Microsoft') != -1) {
			wh = document.body.clientHeight; ww = document.body.clientWidth; 
			oh = 162; ow = 170;
		} else {
			wh = innerHeight; ww = innerWidth;
			oh = 162; ow = 170;
		}
		obj = null;	obj = document.getElementById('navLocation'); if(obj) { nh = wh - oh; obj.style.height = nh + 'px'; obj.style.width = 170 + 'px';}
		obj = null;	obj = document.getElementById('contentLocation');	 if(obj) { nw = ww - ow; obj.style.width  = nw + 'px'; nh = wh - oh; obj.style.height = nh + 'px';}
		obj = null;	obj = document.getElementById('contentContainer');	 if(obj) { nw = ww - ow; obj.style.width  = nw + 'px'; nh = wh - oh; obj.style.height = nh + 'px';}
	
		//window.status = "  wh: " + wh + "  ww: " + ww + "  oh: " + oh + "  ow: " + ow + "  nh: " + nh + "  nw: " + nw;
	} else {
		//window.status = "no more."
	}
	rc++;
}

window.onresize = resizeElements;