
// checkSurvey
function checkSurvey() {
	survey=getCookie('surveyID');
	survey2=getCookie('noSurvey3');
	if (survey==null || survey!="3") {
		//added 2/17/10 nick
		//this overrides the survey option
		document.location = 'https://www.netteller.com/fwbt/login.cfm';
		
		//if (survey2==null || survey2=="") {
		//	var divbox = document.getElementById("surveyQuestion");
		//	divbox.style.left = (document.body.clientWidth / 2) - 150;
		//	divbox.style.top = (document.body.clientHeight / 2) - 75 + f_scrollTop();
		//	//alert(f_scrollTop());
		//	divbox.style.visibility = "visible";
		//} else {
		//	setCookie('noSurvey3','noSurvey3',365);
		//	document.location = 'https://www.netteller.com/fwbt/login.cfm';
		//}
	} else {
		//setCookie('noSurvey3','noSurvey3',365);
		document.location = 'https://www.netteller.com/fwbt/login.cfm';
	}
}

// f_scrollTop
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

// f_filterResults
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}


// sendSurvey
function sendSurvey() {
	document.location = '/survey.asp?survey_id=3&answer=y';
	document.getElementById("surveyQuestion").style.visibility = "hidden";
}
// noSurvey
function noSurvey() {
	setCookie('noSurvey3','noSurvey3',365);
	document.location = '/noSurvey.asp?survey_id=3';
	document.getElementById("surveyQuestion").style.visibility = "hidden";
}

function getCookie(c_name) {
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1) {
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
		    if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
    	}
  	}
	return "";
}

function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

