function prettyCheckbox(a,b) {
	curBox = a + "Label";
	if (b.checked == true) {
		document.getElementById(curBox).style.backgroundImage = "url(/content/swagbucks-com/images/chkBoxSlct.jpg)";
	} else {
		document.getElementById(curBox).style.backgroundImage = "url(/content/swagbucks-com/images/chkBox.jpg)";
	}
}
function sendEmailTBLocal() {
	xmlHttp=getAjaxObjectTB()
	if (xmlHttp==null) {
		alert ('Your browser does not support HTTP Request. Please contact us at "info@prodege.com" to get your password.')
		return;
	}
	txtEmail = document.getElementById("emailAddressLocal").value;
	if (txtEmail == "") {
		alert ("Please enter your Email Address.")
		return;
	}
	url="/?cmd=sb-pswd-reminder&email=" + txtEmail;
	url=url+"&amp;sid="+Math.random();
	xmlHttp.onreadystatechange=getPResultTBLocal;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function getPResultTBLocal() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		result = xmlHttp.responseText
		if (result == 1) {
			alert("Your Password has been sent.");
		} 
		else  if (result == 2) {
			alert("Your Email Address was not found on our system.");
		}
		else if (result == 3) {
			alert("Please enter a valid Email Address.");
		} 
		else  {
			alert("There was an unexpexted error sending your password." +
			String.fromCharCode(10) + String.fromCharCode(10) + "Please try again or contact us at info@prodege.com");
		} 
	}
}

function logInTBLocal() {
	txtEmail = document.getElementById("emailAddressLocal");
	txtPswd = document.getElementById("pswdLocal");
	valid = true;
	if (txtEmail.value == "") {
		alert("Please enter your Email Address");
		return;
	}
	if (txtPswd.value == "") {
		alert("Please enter your Password");
		return;
	}
	document.getElementById("signInBoxLocal").submit();
}
function enterLoginTBLocal(evt) {
	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
	if(charCode == 13) {
		logInTBLocal();
		return false;
	}  
}

//feature tout controls

var curFeature = 0;
var opacNum = 100;
var isPlaying = true;

function togglePlay() {
    togglePlayAuto(!isPlaying, 10);
}
function togglePlayAuto(isPlay, intval) {
    if (isPlay) {
        featureTimer = setTimeout(changeFeature, intval);
        document.getElementById("toggle").style.backgroundImage = "url(/content/swagbucks-com/images/toutPause.png)";
    }
    else {
        clearTimeout(featureTimer);
        document.getElementById("toggle").style.backgroundImage = "url(/content/swagbucks-com/images/toutPlay.png)";
    }
    isPlaying = isPlay;
}
    
function showFeature(featureNum, auto) {
    
	document.getElementById("ftrTab" + curFeature).className = "altOption" + (curFeature == 3 ? " clearBkd" : "");
	document.getElementById("ftrTab" + featureNum).className = "altOption altOptionSlct" + (curFeature == 3 ? " clearBkd" : "");
	var ftrBkdDiv = document.getElementById("ftrBkd");
	ftrBkdDiv.style.backgroundImage = "url(/content/clients/swagbucks/images/features/feature" + images[featureNum] + ")";
	var ftrLinkA = document.getElementById("ftrLink");
	ftrLinkA.href = hrefs[featureNum];
	ftrLinkA.target = targets[featureNum];
	ftrLinkA.style.display = (targets[featureNum] == "none" ? "none" : "");
    opacNum = 0;
    changeOpac(ftrBkdDiv, 0);
    ftrFader = setInterval(fadeIn, 40);        
    curFeature = featureNum;
    togglePlayAuto(auto, 5000);
}
function changeFeature() {
    var newFeature = (curFeature == 3 ? 0 : curFeature + 1);
    showFeature(newFeature, true);
}
function fadeIn() {
    if (opacNum < 100) {
        opacNum += 4;
        changeOpac(document.getElementById("ftrBkd"), opacNum);
    }
    else {
        clearInterval(ftrFader);        
    }
}
function changeOpac(elm, opacity) {
    elm.style.opacity = (opacity / 100);
    elm.style.MozOpacity = (opacity / 100);
    elm.style.KhtmlOpacity = (opacity / 100);
    elm.style.filter = "alpha(opacity=" + opacity + ")";
}

function loadImages() {
	document.getElementById("imageLoader1").src = "/content/clients/swagbucks/images/features/feature" + images[1];
	document.getElementById("imageLoader2").src = "/content/clients/swagbucks/images/features/feature" + images[2];
	document.getElementById("imageLoader3").src = "/content/clients/swagbucks/images/features/feature" + images[3];
	document.getElementById("imageLoader1").style.display = "none";
	document.getElementById("imageLoader2").style.display = "none";
	document.getElementById("imageLoader3").style.display = "none";
}	
function startToutsScroll() {
	featureTimer = setTimeout(changeFeature, 3000);       
}	
//end feature tout controls



