var keywords1 = [];
var keywords2 = ['mediajaw','sanangelo'];

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.puroparty.net/" + word_lower;
			return 1;
		}
	}

	for (i = 0; keywords2[i]; i++) {
		if (word_lower == keywords2[i].toLowerCase()) {
			var foo = window.open("http://www.puroparty.net/" + 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.puroparty.net/\' method=\'GET\' onsubmit=\'check_keyword(); return false;\'><table id=\'pp_key_table\' border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'width: 100%\'><tr> <td align=\'right\'>PuroParty Clave &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='mailto:puroparty.net@suddenlink.net' target='_top'><img src='images2/hb_images/anunciagrupotop2.jpg' alt='Click to Visit!' class='border'></a>",
	"<a href='mailto:puroparty.net@suddenlink.net' target='_top'><img src='images2/hb_images/horachidagif.gif' alt='Click to Visit!' class='border'></a>",
	"<a href='page.php?kei=185' target='_top'><img src='images2/hb_images/disquerasgif.jpg' alt='Click to Visit!' class='border'></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='mailto:puroparty.net@suddenlink.net' target='_top'><img src='images2/hb_images/anunciagrupotop2.jpg' alt='Click to Visit!' class='border'></a></div>";
	window.setInterval(rotate_image, 6000);
	return true;
}
init_top_banner('main_top');
//==================================================================
/*
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("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Emero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")

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');
//==================================================================
