function setVideoPrefCookie(flag) {
	var choice = "";
	var radios = document.getElementById('videoPrefForm');
	var inputs = radios.getElementsByTagName('input');
	for (var i = 0; i < inputs.length; ++i) {
		if(inputs[i].name == 'videoPref' && inputs[i].checked) {
			choice = inputs[i].value;
		}
	}

	//video pref
	cookieVal = "videoPref=" + choice + "; ";
	
	//date
	var in10yrs = new Date();
	in10yrs.setFullYear(in10yrs.getFullYear() + 10);
	cookieVal += "expires=" + in10yrs.toGMTString();
	
	//set cookie
	document.cookie = cookieVal;
	//go to page
	if(flag){ 
		window.location = "default.aspx";	
	} else {
		document.getElementById('btn-setPref').innerHTML = "Saved.";
	}
}

/* return openWindow('url',width,height,'scrollbars=no') */

function openWindow(href, width, height, extras){
	window.open(href,"","width="+width+",height="+height+","+extras)
	return false
}