function setBackground(value) {
	setCookie("bgcolor", value);
	document.body.style.backgroundColor = '#' + escape(value);
	document.getElementById('mcroundtl').style.backgroundColor = '#' + escape(value);
	document.getElementById('mcroundtr').style.backgroundColor = '#' + escape(value);
	document.getElementById('mcroundbl').style.backgroundColor = '#' + escape(value);
	document.getElementById('mcroundbr').style.backgroundColor = '#' + escape(value);
	var linkcolor;
	if (value=="ed3a3a" || value=="054a89") {
		linkcolor = "white";
	}
	else {
		linkcolor = "black";
	}
	document.getElementById('top_text').style.color = linkcolor;
	document.getElementById('menu').style.color = linkcolor;
	document.getElementById('sudoku_link').style.color = linkcolor;
	document.getElementById('options_link').style.color = linkcolor;
	document.getElementById('highscore_link').style.color = linkcolor;
}
function setLevel(value) {
	setCookie("level", value);
}
function setShowTime(str, str2) {
	var showtime = document.getElementById('showtime');
	if (showtime.checked===true) {
		setCookie("showtime", "on");
		document.getElementById('showtimeinfo').innerHTML = str;
	}
	else {
		setCookie("showtime", "off");
		document.getElementById('showtimeinfo').innerHTML = str2;
	}
}
function setPerPage(value, str) {
	setCookie("perpage", value);
	document.getElementById('perpageinfo').innerHTML = str;
}
function setPrintSol(str, str2) {
	var printsol = document.getElementById('printsol');
	if (printsol.checked===true) {
		setCookie("printsol", "on");
		document.getElementById('printsolinfo').innerHTML = str;
	}
	else {
		setCookie("printsol", "off");
		document.getElementById('printsolinfo').innerHTML = str2;
	}
}
function setFlashSize(value) {
	var currWidth = parseInt(document.getElementById('theswf').style.width);
	var newWidth;
	switch (currWidth) {
		case 282:
			if (value==1) {
				newWidth = 372;
			}
			else {
				newWidth = 282;
			}
			break;
		case 372:
			if (value==1) {
				newWidth = 462;
			}
			else {
				newWidth = 282;
			}
			break;
		case 462:
			if (value==1) {
				newWidth = 552;
			}
			else {
				newWidth = 372;
			}
			break;
		case 552:
			if (value==1) {
				newWidth = 642;
			}
			else {
				newWidth = 462;
			}
			break;
		case 642:
			if (value==1) {
				newWidth = 642;
			}
			else {
				newWidth = 552;
			}
			break;
	}
	var newHeight;
	switch (newWidth) {
		case 282:
			newHeight = 329;
			break;
		case 372:
			newHeight = 433;
			break;
		case 462:
			newHeight = 539;
			break;
		case 552:
			newHeight = 643;
			break;
		case 642:
			newHeight = 749;
			break;
	}
	var newDim = newWidth + "x" + newHeight;
	setCookie("flashsize", newDim);
	document.getElementById('theswf').style.width = newWidth + "px";
	document.getElementById('theswf').style.height = newHeight + "px";
	document.movie.drawBackground(newWidth, newHeight);
}
function openSolution(sol_url) {
	var solid = document.solution.solnum.value;
	var url = "/" + sol_url + "/" + solid;
	var solwindow = window.open(url, "Solution", "width=400, height=420");
	solwindow.moveTo(0,0);
}
function launchSWF(lang, highscore, puzzle, level_title, level, levelurl, rand, id, width, height, showtime, printsol, perpage, print_wd, check_wd, hint_wd, new_wd, restart_wd, regular_sudoku_wd, start_over_wd, play_with_high_score_wd, id_wd, printed_from_wd, host_wd, high_score_link, well_done_wd, you_finished_wd, you_did_not_wd, view_high_score_wd, new_high_score_wd, grats_wd, you_made_it_wd, name_wd, save_wd, new_sudoku_wd, high_score_wd, anonymous_wd, flashfile, bad_words_warning) {
	var flashstr = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" '
				 + 'width="100%" height="100%" id="movie"><param name="movie" value="/flash/' + flashfile + '"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">'
				 + '<param name="menu" value="false" /><param name="flashvars" value="lang=' + lang + '&puzzle=' + puzzle + '&level_title=' + level_title + '&level=' + level + '&levelurl=' + levelurl + '&rand=' + rand + '&id=' + id + '&width=' + width
				 + '&height=' + height + '&showtime=' + showtime + '&printsol=' + printsol + '&perpage=' + perpage + '&highscore=' + highscore + '&print=' + print_wd + '&check='
				 + check_wd + '&hint=' + hint_wd + '&new=' + new_wd + '&restart=' + restart_wd + '&regular_sudoku=' + regular_sudoku_wd + '&start_over=' + start_over_wd
				 + '&play_with_high_score=' + play_with_high_score_wd + '&id_wd=' + id_wd + '&printed_from=' + printed_from_wd + '&host=' + host_wd + '&high_score_link='
				 + high_score_link + '&well_done_wd=' + well_done_wd + '&you_finished_wd=' + you_finished_wd + '&you_did_not_wd=' + you_did_not_wd + '&view_high_score_wd='
				 + view_high_score_wd + '&new_high_score_wd=' + new_high_score_wd + '&grats_wd=' + grats_wd + '&you_made_it_wd=' + you_made_it_wd + '&name_wd=' + name_wd
				 + '&save_wd=' + save_wd + '&new_sudoku_wd=' + new_sudoku_wd + '&high_score_wd=' + high_score_wd + '&anonymous_wd=' + anonymous_wd + '&bad_words_warning=' + bad_words_warning + '"><embed src="/flash/' + flashfile + '" '
				 + 'flashvars="lang=' + lang + '&puzzle=' + puzzle + '&level_title=' + level_title + '&level=' + level + '&levelurl=' + levelurl + '&rand=' + rand + '&id=' + id + '&width=' + width + '&height=' + height + '&showtime=' + showtime
				 + '&printsol=' + printsol + '&perpage=' + perpage + '&highscore=' + highscore + '&print=' + print_wd + '&check=' + check_wd + '&hint=' + hint_wd + '&new='
				 + new_wd + '&restart=' + restart_wd + '&regular_sudoku=' + regular_sudoku_wd + '&start_over=' + start_over_wd + '&play_with_high_score=' + play_with_high_score_wd
				 + '&id_wd=' + id_wd + '&printed_from=' + printed_from_wd + '&host=' + host_wd + '&high_score_link=' + high_score_link + '&well_done_wd=' + well_done_wd
				 + '&you_finished_wd=' + you_finished_wd + '&you_did_not_wd=' + you_did_not_wd + '&view_high_score_wd=' + view_high_score_wd + '&new_high_score_wd=' + new_high_score_wd
				 + '&grats_wd=' + grats_wd + '&you_made_it_wd=' + you_made_it_wd + '&name_wd=' + name_wd + '&save_wd=' + save_wd + '&new_sudoku_wd=' + new_sudoku_wd + '&high_score_wd='
				 + high_score_wd + '&anonymous_wd=' + anonymous_wd + '&bad_words_warning=' + bad_words_warning + '" menu="false" quality="high" bgcolor="#FFFFFF" width="100%" height="100%" name="movie" align="" '
				 + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
	document.getElementById('theswf').innerHTML = flashstr;
}
function setCookie(name, value) {
	var exdate = new Date();
	exdate.setDate(exdate.getDate() + 365);
	document.cookie = escape(name) + "=" + escape(value) + ";expires=" + exdate.toUTCString() + ";path=/";
}
