var preloadFlag = false;


function updateText(index) {

	var allTitle = new Array();
	allTitle["select"] = '&nbsp;';
	allTitle["district"] = ' the <strong>District</strong>';
	allTitle["campus"] = ' <strong>Tri-Campus</strong>';
	allTitle["south"] = '<strong>Savvy South</strong>';
	allTitle["east"] = '<strong>East Side</strong>';
	allTitle["west"] = '<strong>West Side</strong>';
	allTitle["north"] = '<strong>North</strong>';
	
	var allText = new Array();
	allText["select"] = 'Point to an area on the map to view more information.';
	allText["district"] = 'The must-see cultural epicenter of Columbia featuring eclectic shops, restaurants, museums, galleries, theatres and a &ldquo;bohemian&rdquo; or two.';
	allText["campus"] = 'Walk the hallowed halls and manicured grounds of MU, Stephens, and Columbia College and you&rsquo;re bound to be enlightened.';
	allText["south"] = 'Mix a little old money with a little new and you&rsquo;ve got everything from country clubs to trendy bars to lakeside dining.';
	allText["east"] = 'Live large, shop large. Eat well. The east side&rsquo;s &ldquo;mega&rdquo; centers and restaurants will help you do all three.';
	allText["west"] = 'Scores of restaurant chains and shopping centers, including the Columbia Mall, will keep your &ldquo;plastic&rdquo; occupied';
	allText["north"] = 'Enough forests, parks, fairgrounds, and lakes to satisfy the nature lover in all of us.';

	var titletext = "";
	var messagetext = "";
	
	if (index == '') {
		changeImages('laymapname', '/images/lay/map.gif');
		titletext = 'select';
		messagetext = 'select';
		index = 'map';
	} else {
		titletext = index;
		messagetext = index;
	}
	if (document.all) {
		changeImages('laymapname', "/images/lay/" + index + ".gif");
		laytitle.innerHTML = allTitle[titletext];
		laytext.innerHTML = allText[messagetext];
		
	} else if (document.getElementById) {
		changeImages('laymapname', "/images/lay/" + index + ".gif");
		document.getElementById("laytitle").innerHTML = allTitle[titletext];
		document.getElementById("laytext").innerHTML = allText[messagetext];
		
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		img01_on = newImage("/images/lay/campus.gif");
		img02_on = newImage("/images/lay/district.gif");
		img03_on = newImage("/images/lay/east.gif");
		img04_on = newImage("/images/lay/map.gif");
		img05_on = newImage("/images/lay/north.gif");
		img06_on = newImage("/images/lay/south.gif");
		img06_on = newImage("/images/lay/west.gif");
		preloadFlag = true;
	}
}

function clearIt (xthis) {
	if (xthis.value == '(Enter keywords)') {
		xthis.value='';
	}
}

function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}

function popUp(url_var, name_var, w,h) {
	window.open(url_var, name_var, "status=no,height=" + h + ",width=" + w + ",scrollbars=no,resizable=yes,menubar=no");
	self.status="";
}

function popUpScroll(url_var, name_var, w,h) {
	window.open(url_var, name_var, "status=no,height=" + h + ",width=" + w + ",scrollbars=yes,resizable=yes,menubar=no");
	// self.status="";
}


function popDescription(id) {
	popUpScroll("/web/popup/description.php?id=" + id, "description", 325,400)
}

function popECoupon(id, name_var, w, h) {
	popUpScroll("/web/popup/ecoupon.php?id=" + id, "ecoupon", 325,400)
}

function deleteConfirm(){
	var ret = window.confirm("Are you sure you would like to permanently delete this record?");
	if(ret)	{
		return true;
	}else{
		return false;
	}

}
