img1on = new Image(); img1on.src="/images/nav2/home_on.gif";
img2on = new Image(); img2on.src="/images/nav2/offers_on.gif";
img4on = new Image(); img4on.src="/images/nav2/news_on.gif";
img5on = new Image(); img5on.src="/images/nav2/free-slots_on.gif";
img6on = new Image(); img6on.src="/images/nav2/fbg_on.gif";

function showGold(){
	elem=document.getElementById("gold_info");
	elem.style.visibility="visible";
}

function hideGold(){
	elem=document.getElementById("gold_info");
	elem.style.visibility="hidden";
}

function wipeDef(obj){
	if (obj.value=="member email" || obj.value=="password" || obj.value=="confirm password" || obj.value=="First Name" || obj.value=="Email address" || obj.value=="Confirm email address" || obj.value=="Friend's First Name" || obj.value=="Their email address" || obj.value=="Confirm their email address" || obj.value=="Personal message"){
		obj.value="";
	}
}

function swapLog(){
	document.getElementById("login").style.backgroundImage="url(/images/login_bg.gif)";
}

function doStarOver(row,score){

	thisrow1=document.getElementById('star1' + row);
	thisrow2=document.getElementById('star2' + row);
	thisrow3=document.getElementById('star3' + row);
	thisrow4=document.getElementById('star4' + row);
	thisrow5=document.getElementById('star5' + row);


	if (score>0){
		thisrow1.src="/images/star.gif";
	}else{
		thisrow1.src="/images/star_off.gif";
	}

	if (score>1){
		thisrow2.src="/images/star.gif";
	}else{
		thisrow2.src="/images/star_off.gif";
	}

	if (score>2){
		thisrow3.src="/images/star.gif";
	}else{
		thisrow3.src="/images/star_off.gif";
	}

	if (score>3){
		thisrow4.src="/images/star.gif";
	}else{
		thisrow4.src="/images/star_off.gif";
	}

	if (score>4){
		thisrow5.src="/images/star.gif";
	}else{
		thisrow5.src="/images/star_off.gif";
	}

}

function doStarOut(row){

	current=eval('document.review.' + row + '.value');
	doStarOver(row,current);

}

function doStarDown(row,score){

	thisrow1=document.getElementById('star1' + row);
	thisrow2=document.getElementById('star2' + row);
	thisrow3=document.getElementById('star3' + row);
	thisrow4=document.getElementById('star4' + row);
	thisrow5=document.getElementById('star5' + row);

	if (score>0){
		thisrow1.src="/images/star.gif";
	}else{
		thisrow1.src="/images/star_off.gif";
	}

	if (score>1){
		thisrow2.src="/images/star.gif";
	}else{
		thisrow2.src="/images/star_off.gif";
	}

	if (score>2){
		thisrow3.src="/images/star.gif";
	}else{
		thisrow3.src="/images/star_off.gif";
	}

	if (score>3){
		thisrow4.src="/images/star.gif";
	}else{
		thisrow4.src="/images/star_off.gif";
	}

	if (score>4){
		thisrow5.src="/images/star.gif";
	}else{
		thisrow5.src="/images/star_off.gif";
	}

	eval ('document.review.' + row + '.value=' + score);

}

function submitEnter(myfield,e){

	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;

	if (keycode == 13){
		document.loginform.submit();
		return false;
 	}else{
 		return true;
	}
}

function loadData(id){
	// Create the XML request
	xmlReq = null;
	if(window.XMLHttpRequest) xmlReq = new XMLHttpRequest();
	else if(window.ActiveXObject) xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
	if(xmlReq==null) return; // Failed to create the request

	// Anonymous function to handle changed request states
	xmlReq.onreadystatechange = function(){
		switch(xmlReq.readyState){

			case 0: // Uninitialized
				break;

			case 1: // Loading
				break;

			case 2: // Loaded
				break;

			case 3: // Interactive
				break;

			case 4: // Done!

				str=xmlReq.responseText;
				var myArray=str.split(',');
				updatePoints(myArray[0],myArray[1],myArray[2],myArray[3]);
				break;

			default:
				break;
		}
	}

	// Make the request
	var URL='http://www.ohmybingo.com/points_ajax.php?r=' + Math.random() + '&id=' + id;
	xmlReq.open ('GET', URL, true);
	xmlReq.send (null);
}

function updatePoints(points,bronze,silver,gold){
	document.getElementById('scoreBox').innerHTML = '<p style="margin: 0 0 2px 0">OhMyPoints: ' + points + '</p><img src="/images/bronze_coin.gif" width="14" height="14" alt="bronze coins" /> ' + bronze + ' &nbsp;&nbsp;<img src="/images/silver_coin.gif" width="14" height="14" alt="silver coins" /> ' + silver + ' &nbsp;&nbsp;<img src="/images/gold_coin.gif" width="14" height="14" alt="gold coins" /> ' + gold;
}

function footerOpen(){
	document.getElementById('footer_closed').style.visibility='hidden';
	document.getElementById('footer_open').style.visibility='visible';
}

function footerClose(){
	document.getElementById('footer_open').style.visibility='hidden';
	document.getElementById('footer_closed').style.visibility='visible';
}

setTimeout(function(){var a=document.createElement("script");
var b=document.getElementsByTagName('script')[0];
a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0011/7961.js";
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
