function getNextCard(){
	window.location = "/learn/index.php";
}

function unsubscribeAlert(popling_id){
	var unsub = confirm("Are you sure you want to unsubscribe from this Popling? (Your settings will not be deleted.)");
	if (unsub == true){
	   window.location="../poplings/view_popling.php?popling_id="+popling_id+"&unsub=1";
	}
}

function closeWindow() {
	//window.open('javascript:window.close();','_self','');
	window.open('','_parent','');
	window.close();
}

function setPopState(state){
	popState = state;
}

function goCreated(){
	window.location = "../my/created_poplings.php";
}


function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function goToCreatedPage(){
			window.location = "../my/created_poplings.php?deleted=1";
		}

function deletePoplingAlert(pid){
	var unsub = confirm("Are you sure you want to this popling, its questions, comments, etc?");
	if (unsub == true){
		 $("#ajaxReturn").load("../afunc/delete_popling.php?popling_id="+pid,'',goToCreatedPage);
		
	}
}


function proOnly(){
	var m = "<a href='/pro'>Go Pro now</a> to get access to audio, multiple popling subscriptions and more!";
	$("#ajaxReturn").show().html(m);
}