var keywords1 = ['aarp','adultdaycare','alc','autorepair','bsa','cac','cactuscafe','clearimagewindows','cmn','cody','cody','credits','cunt','demo','desertshadows','dick','egg','employment','fadetoblack','francoscafe','fuck','fuentes','help','hometeam','hotel','hotels','icd','jacksons','joe','koronas','mall','mommies','moms','monsterrain','motel','motels','murals','outback','photographer','photography','poop','porn','pussy','rv','saaf','saaha','sahf','samfa','sex','shit','silverbelle','slater','sonrisas','southland','studioeleven','sunset','thebluffs','tits','vcc','veribestumc','weather','webcam','westernsky','xxx','ymca'];
var keywords2 = ['h4x','hosting','mediajaw','msi','nin','pinkfloyd','tool'];

function check_keyword() {
	var field = document.getElementById('keyword_field');
	var word = field.value;
	var word_lower = word.toLowerCase();

	for (i = 0; keywords1[i]; i++) {
		if (word_lower == keywords1[i].toLowerCase()) {
			window.location = "http://www.sanangelo.com/" + word_lower;
			return 1;
		}
	}

	for (i = 0; keywords2[i]; i++) {
		if (word_lower == keywords2[i].toLowerCase()) {
			var foo = window.open("http://www.sanangelo.com/" + word_lower, '_blank');
			foo.focus();
			field.value = '';
			return 2;
		}
	}

	alert("'"+ word +"' is not a valid keyword.");
	field.value = '';
	return 0;
}

function init_keywords(id) {
	var tmp = document.getElementById(id);
	if (!tmp) return false;
	tmp.innerHTML = "<form action=\'http://www.sanangelo.com/\' method=\'GET\' onsubmit=\'check_keyword(); return false;\'><table id=\'sa_key_table\' border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'width: 100%\'><tr> <td align=\'right\'>SanAngelo.com Keyword &nbsp;<input type=\'text\' size=\'15\' name=\'keyword\' id=\'keyword_field\'>&nbsp;<input type=\'submit\' value=\'Go\'> </td></tr></table></form>";
	return true;
}
init_keywords('box_keywords');
//==================================================================
var bindex = 0;
var bimages = new Array(
	"<a href='http://www.koronasformalwear.com' target='_blank'><img src='/images/bimages/468-Koronas.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.bodegademilagro.com' target='_blank'><img src='/images/bimages/468milagro.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.horizonbuilder.com' target='_blank'><img src='/images/bimages/468horizon.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.bapmem.com' target='_blank'><img src='/images/bimages/468bapmem2.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.marybutlerrealtor.com' target='_blank'><img src='/images/bimages/marybutlerbanner.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='/page.php?kei=205' target='_blank'><img src='/images/bimages/486tcc.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.billfeist.com/idx.php?page=search' target='_blank'><img src='/images/bimages/468bfeist.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.spoontsrealty.com' target='_blank'><img src='/images/bimages/468rocky.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.aaronrents.com' target='_blank'><img src='/images/bimages/468aarons.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.dierschke.com/' target='_blank'><img src='/images/bimages/Dierschke_468.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.remaxsanangelo.com' target='_blank'><img src='/images/bimages/TopBanner.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.westernskysteakhouse.org' target='_blank'><img src='/images/bimages/WesternSky.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.glassjewelers.com' target='_blank'><img src='/images/bimages/Glass-468Banner.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.sanangelovenue.com' target='_blank'><img src='/images/bimages/Venue-468x60.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='/page.php?kei=201' target='_blank'><img src='/images/bimages/SADC-Banner.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.shopsugarbakers.com' target='_blank'><img src='/images/bimages/sugarbakers-468x60.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.francoscafe.org' target='_blank'><img src='/images/bimages/FrancosCafe.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.sitel.com/' target='_blank'><img src='/images/bimages/468sitel2007.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='/page.php?kei=177' target='_blank'><img src='/images/bimages/Studio11-468x60.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.tejasranchrealty.com' target='_blank'><img src='/images/bimages/tejas468.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='http://www.invinoveritaswines.com' target='_blank'><img src='/images/bimages/468ivv.gif' alt='Click to Visit!' class='banner'></a>",
	"<a href='/page.php?kei=186' target='_blank'><img src='/images/bimages/468ch.gif' alt='Click to Visit!' class='banner'></a>"
);

function rotate_image() {
	bindex++;
	if (bindex >= bimages.length) bindex = 0;
	document.getElementById('main_banner').innerHTML = bimages[bindex];
}

function init_top_banner(id) {
	var tmp = document.getElementById(id);
	if (!tmp) return false;
	tmp.innerHTML = "<div id='main_banner'><a href='http://www.koronasformalwear.com' target='_blank'><img src='/images/bimages/468-Koronas.gif' alt='Click to Visit!' class='banner'></a></div>";
	window.setInterval(rotate_image, 10000);
	return true;
}
init_top_banner('main_top');
//==================================================================
function init_side_banners1(id) {
	var tmp = document.getElementById(id);
	if (!tmp) return false;
	tmp.innerHTML = "<div class=\'side_banner\'><a href=\'/real_estate.php\'><img src=\'/images/sb_images/househunt.jpg\' border=\'0\' class=\'border\'></a></div>";
	return true;
}
init_side_banners1('box_side_banners1');
//==================================================================
/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
		year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
		daym="0"+daym
	var hours=mydate.getHours()
	var minutes=mydate.getMinutes()
	var seconds=mydate.getSeconds()
	var dn="AM"
	if (hours>=12)
		dn="PM"
	if (hours>12){
		hours=hours-12
	}
	if (hours==0)
		hours=12
	if (minutes<=9)
		minutes="0"+minutes
	if (seconds<=9)
		seconds="0"+seconds
	//change font size here
	var cdate=dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn

	if (document.all)
		document.all.clock.innerHTML=cdate
	else if (document.getElementById)
		document.getElementById("clock").innerHTML=cdate
	else
		document.write(cdate)
}

function init_current_time(id) {
	var tmp = document.getElementById(id);
	if (!tmp) return false;
	tmp.innerHTML = "<div id='clock' style='color: #DDDDDD; font-size: 10px; padding-left: 2pt;'>&nbsp;</div>";

	if (!document.all&&!document.getElementById) getthedate()

	if (document.all||document.getElementById)
		setInterval("getthedate()",1000)

	return true;
}
init_current_time('box_time');
//==================================================================
function burst(url, target, width, height) {
	if (width > window.screen.width - 50) width = window.screen.width - 50;
	if (height > window.screen.height - 100) height = window.screen.height - 100;

	var x = (window.screen.width - width) / 2;
	var y = (window.screen.height - height) / 3;
	var toolbar = (target == 'printer') ? 'yes' : 'no';
	var foo = window.open(url, target, 'width='+width+',height='+height+',left='+x+',top='+y+',menubar=no,toolbar='+toolbar+',location=no,scrollbars=yes,resizable=yes,status=yes');
	foo.focus();
	return 0;
}

function image_swap(id, src) {
	document.getElementById(id).src = src;
	return 0;
}

function replace_html(id, html) {
	document.getElementById(id).innerHTML = html;
	return 0;
}