var catQuestions = new Array();
var curFlashVal = new Array();
var handleImages = new Array();

function preLoad(id)
{


	var http = getHTTPObject();

	if(http && id != undefined)
	{
		url = rootDir + '/allimages/' + id + '/';
		http.open("GET", url, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function(){
								if (http.readyState==4  && http.status == 200)
								{
									if(http.responseText != '')
									{
										var plImages = http.responseText.split('[[]]');

										plImageObj = new Array();
										var j = 0;
										var i = 0;
										for(i=0;i<plImages.length;i++)
										{
											if(handleImages[plImages[i]] == undefined)
											{
												handleImages[plImages[i]] = true;
												j = plImageObj.length;
												plImageObj[j] = new Image(); 
												plImageObj[j].src = plImages[i];
											}

										}
									}
								}
							};
		http.send(null);
	}
}



function calculateScore()
{
	var hasReqestedVersion = DetectFlashVer(6, 0, 0);
	if(hasReqestedVersion)
	{
		var so = new SWFObject("/result/result.swf", "sdLoader", "699","467", "6", "#ffffff"); 
	    so.write("flashApp");
	}
	else
	{
		document.getElementById('flashApp').innerHTML = '<span style="color: blue">Moment geduld aub, positie wordt geladen...</span>';
		changeDivContents('/positie/' + provinceId + '/' + sessionId + '/1/','contentFrame');
	}
}






function requestPw(id)
{
	var http = getHTTPObject();

	http.open("GET", rootDir + "/requestpw/" + id + "/", true);
	http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange=function()
							{
								if (http.readyState==4  && http.status == 200)
								{
									document.getElementById('registerForm').innerHTML = http.responseText;

									window.opener.location.reload();
								}
								
							};
	http.send(null);
}



function changeContent(id, intro)
{
	if(document.getElementById('flashTestMsg') != undefined)
	{
		document.getElementById('flashTestMsg').style.display = 'none';
	}

	if(intro == undefined)
	{
		intro = -1;
	}

	changeDivContents('/menuitem/' + provinceId + '/' +id + '/' + intro + '/','contentFrame',id);
}

function setProvince(pId)
{

	var http = getHTTPObject();
	if(http)
	{
		divObj = document.getElementById('mainDiv');
		url = rootDir + '/setprovince/' + pId + '/';
		http.open("GET", url, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function(){
								if (http.readyState==4  && http.status == 200)
								{
									provinceId = pId;
									if(document.getElementById('leeuwarder_courant_logo') != undefined)
									{
										if(provinceId == 3)
										{
											document.getElementById('leeuwarder_courant_logo').style.display= '';
										}
										else
										{
											document.getElementById('leeuwarder_courant_logo').style.display= 'none';
										}
									}

									if(document.getElementById('bannerFrame') != undefined)
									{
										document.getElementById('bannerFrame').src='/phpAds.php?provinceId=' + provinceId;
									}
									else
									{
										window.location.href='/page/Thema+s/0';
									}

									changeContent(0);

								}
							};
		http.send(null);
	}


}

var currentMenuItem = '';
function setDefaultState(id)
{

	
	preLoad(id);
	
	if(document.getElementById('leftMenuContainer') == undefined)
	{
		changeDivContents('/leftmenu/','leftMenu',-2);
	}
	if(id == 0)
	{
		
	}
	else if(id == 1)
	{
		
	}
	else if(id == 2)
	{
		//setProvincieBanner();
	}
	else if(id == 3)
	{
		if(document.getElementById('flashApp') != undefined)
		{
			calculateScore();
		}
	}
	else if (id == 11)
	{
		getCategoryStatus(true);
	}


	if(id != 11) 
	{
		if(id != -2)
		{
			if(id == -1)
			{
				currentMenuItem = 0;
			}
			else
			{

				currentMenuItem = id;
			}
		}
	

		for(i = 0;i < 4;i++)
		{

			obj = document.getElementById('menuItemTD' + i);
			if(obj != undefined)
			{
				typeAr = obj.className.split('_');
				changeMenuImage(i,1);
			}
		}
	}
}

function setProvincieBanner()
{
	var retVal = '';

    retVal = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="234" height="60" id="wereldbol" align="middle">';
    retVal += '<param name="allowScriptAccess" value="sameDomain" />';
    retVal += '<param name="movie" value="/result/wereldbol.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/result/wereldbol.swf" quality="high" bgcolor="#ffffff" width="234" height="60" name="wereldbol" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
    retVal += '</object>';
	document.getElementById('provincieFlash').innerHTML = retVal;

}



function logTopMenu(id)
{
	var http = getHTTPObject();

	http.open("GET", rootDir + "/logtopmenu/" + id + "/", true);
	http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.send(null);

}



function showContainer(id)
{

	var http = getHTTPObject();
	if(http)
	{
		divObj = document.getElementById('contentFrame');
		url = rootDir + '/container/' + id + '/';
		http.open("GET", url, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

		http.onreadystatechange=function(){
								if (http.readyState==4  && http.status == 200)
								{
									divObj.innerHTML = http.responseText;
									handleContainer(id);

								}
							};
		http.send(null);
	}
}

function handleContainer(id)
{

	var http = getHTTPObject();
	if(http)
	{
		divObj = document.getElementById('contentFrame');
		url = rootDir + '/handlecontainer/' + id + '/';
		http.open("GET", url, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

		http.onreadystatechange=function(){
								if (http.readyState==4  && http.status == 200)
								{

									retVal = http.responseText.split('[[]]');
									eval('handle' + retVal[0] + '(' + retVal [1] + ',1);');




								}
							};
		http.send(null);
	}
}


function handleRetrospective(qId,answer)
{



	var divObj = document.getElementById('contentFrame');

	if(divObj != undefined)
	{
		var http = getHTTPObject();
		if(http)
		{ 
			if(answer != undefined)
			{
				radioValue = answer;
			}
			else
			{
				radioValue = '';
			}


			currentQIDd = document.getElementById('currentQId').value;

			url = rootDir + '/retro/' + provinceId + '/' + qId + '/' + currentQIDd + '/' + radioValue + '/';
			http.open("GET", url, true);
			http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
			http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
			http.onreadystatechange=function(){
									if (http.readyState==4  && http.status == 200)
									{
										httpText = http.responseText;
										retVal = httpText.split('[[]]');
										if(retVal[0] == -4)
										{
											changeContent(2);

										}
										else
										{
											
											question = retVal[0];
											qID = retVal[1];
											answer = retVal[2];

											handleTopMenuContents('/topmenu/1/' + qID + '/');


											document.getElementById('currentQId').value = qID;
											document.getElementById('retroQuestion').innerHTML = question;
											for(var i=1;i<=10;i++)
											{
												if(document.getElementById('nF_' + i) != undefined)
												{
													if(answer == i)
													{
														currentNFClasses['nF_' + i] = 'numberform_selected';
													}
													else
													{
														currentNFClasses['nF_' + i] = 'numberform';
													}
													mouseEventNumberForm(1,'nF_' + i);
												}

											}

											if(answer == -1)
											{
												currentBgColors['-1'] = 'eventFormSelected';

											}
											else
											{
												currentBgColors['-1'] = 'eventFormMouseNoAnswer';
											}

											mouseEventAnswers(1,'-1');
											document.getElementById('mainDiv').style.display="";							
											
										}

									}
						}
			http.send(null);
		}
	}
}

function handlePrimeMinisters(pmId, answer, valId)
{
	var divObj = document.getElementById('contentFrame');

	if(divObj != undefined)
	{
		var http = getHTTPObject();
		if(http)
		{ 
			if(answer != undefined)
			{
				radioValue = answer;
			}
			else
			{
				radioValue = '';
			}


			currentPMd = document.getElementById('currentPM').value;
			url = rootDir + '/pm/' + provinceId + '/' + pmId + '/' + currentPMd + '/' + radioValue + '/' + valId;
			http.open("GET", url, true);
			http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
			http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
			http.onreadystatechange=function(){
									if (http.readyState==4  && http.status == 200)
									{
										httpText = http.responseText;
										retVal = httpText.split('[[]]');
										if(retVal[0] == -4)
										{
											changeContent(3,1);
										}
										else
										{
											
											pmName = retVal[0];
											pmID = retVal[1];
											handleTopMenuContents('/topmenu/2/' + pmID + '/');
											var currentVal = new Array();
											currentVal[1] = retVal[2];
											currentVal[2] = retVal[3];
											prtName = retVal[4];
											identifier = retVal[5];




											document.getElementById('currentPM').value = pmID;
											document.getElementById('pmName1').innerHTML = pmName;
											document.getElementById('pmName2').innerHTML = pmName;
											document.getElementById('pmName3').innerHTML = pmName;
											document.getElementById('partyName').innerHTML = prtName;

												
											for(var i=1;i<=2;i++)
											{

												for(var j=1;j<=10;j++)
												{
													if(document.getElementById('nF_' + i + '_' + j) != undefined)
													{
														if(currentVal[i] == j)
														{
															currentNFClasses['nF_' + i + '_' + j] = 'numberform_selected';
														}
														else
														{
															currentNFClasses['nF_' + i + '_' + j] = 'numberform';
														}
														mouseEventNumberForm(1,'nF_' + i + '_' + j);
													}

												}

												if(currentVal[i] == -1)
												{
													currentBgColors['-1' + i] = 'eventFormSelected';

												}
												else
												{
													currentBgColors['-1' + i] = 'eventFormMouseNoAnswer';
												}

												mouseEventAnswers(1,'-1' + i);
											}
											if(document.getElementById('pmImg') != undefined)
											{
												document.getElementById('pmImg').src = '/images/prime_ministers/' + identifier + '_62b.png';
											}
											document.getElementById('mainDiv').style.display="";
										}


	
									}
						}
			http.send(null);
		}
	}
}

function handleTheme(qId,answer)
{
	catId = -1;

	var divObj = document.getElementById('contentFrame');

	if(divObj != undefined)
	{
		var http = getHTTPObject();
		if(http)
		{ 
			if(answer != undefined)
			{
				radioValue = answer;
			}
			else
			{
				radioValue = '';
			}
			currentQId = document.getElementById('currentQuestion').value;
			url = rootDir + '/theme/' + provinceId + '/' + catId + '/'+qId+'/'+currentQId+ '/'+ radioValue + '/';
			http.open("GET", url, true);
			http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
			http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
			http.onreadystatechange=function(){
									if (http.readyState==4  && http.status == 200)
									{
										if(http.responseText == -4)
										{
											changeContent(1);
										}
										else
										{
											allInfo = http.responseText.split('(())');

											catInfo = allInfo[0].split('[[]]');
											if(1)
											{
		

												cInfo = allInfo[1].split('[[]]');
												
												question = catInfo[0];
												nextQuestion = catInfo[1];
												questionAnswer = catInfo[2];
												qLinks = catInfo[3];
												skipLink = catInfo[4];
												nextCat = catInfo[5];
												qId = catInfo[6];
												catName = catInfo[7];
												provName = catInfo[9];

	//											changeCategoryStatus(cInfo,catInfo[8]);
												handleTopMenuContents('/topmenu/0/' + qId + '/');

												currentCatClasses[catInfo[8]] = 'bar_question_current';

												//document.getElementById('themeName').innerHTML = catName;

												for(i = -1;i<=5;i++)
												{
													if(document.getElementById('answer' + i) != undefined)
													{
														if(i == questionAnswer)
														{
															currentBgColors[i] = 'eventFormSelected';
														}
														else if(i != -1)
														{
															currentBgColors[i] = 'eventFormMouse';
														}
														else
														{
															currentBgColors[i] = 'eventFormMouseNoAnswer';
														}
												

														mouseEventAnswers(1,i);
													}
												}
												document.getElementById('questionLinks').innerHTML = catName + '&nbsp;' + qLinks;

												document.getElementById('questionDiv').innerHTML = question;

												document.getElementById('currentQuestion').value = qId;
												
												document.getElementById('questionForm').style.display="";
												if(document.getElementById('questionTable') != undefined)
												{
													document.getElementById('questionTable').style.display="";
												}
												document.getElementById('mainDiv').style.display="";
											}
										}
									}
								};
			http.send(null);
		}
	}
}



function getCategoryStatus()
{
	var http = getHTTPObject();
	return 1;

	if(http)
	{
		url = rootDir + '/categoryinfo/' + provinceId + '/';
		http.open("GET", url, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function(){
								if (http.readyState==4  && http.status == 200)
								{
									cInfo = http.responseText.split('[[]]');
									changeCategoryStatus(cInfo);
								}
							};
		http.send(null);
	}
}

var currentRmColors = new Array();









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 registerUser(form)
{
	if(form != undefined)
	{

		var http = getHTTPObject();
		formVal = getFormValues(form);

		http.open("POST", rootDir + "/registeruser/", true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function()
								{
									if (http.readyState==4  && http.status == 200)
									{
										responseText = http.responseText.split('[[]]');
										document.getElementById('registerForm').innerHTML = responseText[0];
										if(responseText[1] != undefined)
										{
											document.getElementById('formElt').value = responseText[1];
										}
									}
									
								};
		http.send(formVal);

	}

}

function sendMaf(form)
{
	if(form != undefined)
	{

		var http = getHTTPObject();
		formVal = getFormValues(form);

		http.open("POST", rootDir + "/sendmaf/", true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function()
								{
									if (http.readyState==4  && http.status == 200)
									{
										document.getElementById('mafId').innerHTML = http.responseText;
									}
									
								};
		http.send(formVal);

	}

}

function cleanSession(self)
{
	var http = getHTTPObject();


	http.open("POST", rootDir + "/clearuser/", true);
	http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange=function()
							{
								if (http.readyState==4  && http.status == 200)
								{
									if(document.getElementById('saveId') != undefined)
									{
										document.getElementById('saveId').innerHTML = http.responseText;
									}
									//document.location.reload();
									if(window.opener != undefined && self == undefined)
									{
										window.opener.location.reload();
									}
									else
									{		
										document.location.reload();

									}
								}
								
							};
	http.send(null);
}


function userLogin(form)
{
	document.getElementById('loginFormText').innerHTML = 'Even geduld a.u.b.';
	if(form != undefined)
	{

		var http = getHTTPObject();
		formVal = getFormValues(form);

		http.open("POST", rootDir + "/userlogin/", true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function()
								{
									if (http.readyState==4  && http.status == 200)
									{
										if(http.responseText == -1)
										{
											document.getElementById('loginForm').innerHTML = '<span style="font-size: 12px;color: red">Uw gegevens zijn geladen. U wordt over 3 seconden doorverwezen.</span>';
											setTimeout("window.location.reload();", 3000);
										}
										else
										{
											document.getElementById('loginFormText').innerHTML = http.responseText;
										}
									}
								
								};
		http.send(formVal);

	}
}

function requestPassword(form)
{
	document.getElementById('loginFormText').innerHTML = 'Even geduld a.u.b.';
	if(form != undefined)
	{

		var http = getHTTPObject();
		formVal = getFormValues(form);

		http.open("POST", rootDir + "/requestpassword/", true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange=function()
								{
									if (http.readyState==4  && http.status == 200)
									{
										document.getElementById('loginFormText').innerHTML = http.responseText;
									}
								};
		http.send(formVal);

	}
}


function showInfoLayer()
{
	var currentQ = document.getElementById('currentQuestion').value;
	document.getElementById('qInfoContainer').innerHTML='<img src="/images/zandloper.gif" />';
//	document.getElementById('qInfoHref').href='javascript:showQuestionInfo(' + currentQ + ');';
	document.getElementById('qInfoDiv').style.display="";
	
	changeDivContents('/questioninfo/' + provinceId + '/' + currentQ + '/','qInfoContainer');

}

var new_window = null;

function open_new_window(url,width,height) 
{
	new_window = window.open(url,"popWindow","menubar=no,scrollbars=1,width="+width+",height="+height+",left=0,top=0,resizable=1");
    new_window.focus();
}

function showPopupClear()
{
	window.open('/clear',"popWindow","menubar=no,scrollbars=1,width=523,height=183,left=0,top=0,resizable=1");
}

function showPopupSave()
{
	window.open('/save',"popWindow","menubar=no,scrollbars=1,width=523,height=450,left=0,top=0,resizable=1");
}

function showPopupHelp()
{
	window.open('/help',"popWindow","menubar=no,scrollbars=1,width=787,height=523,left=0,top=0,resizable=1");
}

function showPopupMaf()
{
	window.open('/maf',"popWindow","menubar=no,scrollbars=1,width=523,height=440,left=0,top=0,resizable=1");
}

function showQuestionInfo(qId)
{
	window.open('/stelling/' + qId + '/',"popWindow","menubar=no,scrollbars=1,width=786,height=323,left=0,top=0,resizable=1");
}

function showProvinceInfo(pId)
{
	window.open('/provincie/' + pId + '/',"popWindow","menubar=no,scrollbars=1,width=786,height=323,left=0,top=0,resizable=1");
}

function showPopupHP()
{
	window.open('/homepageinfo/',"popWindow","menubar=no,scrollbars=1,width=786,height=323,left=0,top=0,resizable=1");
}

function showPopup(url,width,height,leftPos,topPos)
{
	if(url != undefined)
	{
		if(width == undefined)
			width = 687;			// Default width
		if(height == undefined)
			height = 500;			// Default height
		if(leftPos == undefined)
			leftPos = 100;			// Default left position
		if(topPos == undefined)
			topPos = 100;			// Default top position

		window.open(url,"popWindow","menubar=no,scrollbars=1,width=" + width + ",height=" + height + ",left=" + leftPos + ",top=" + topPos + ",resizable=1");
	}
}



/*
// Disable back button in browser
window.onbeforeunload = bunload;

function bunload(){
    return 'Met de Vorige knop, kunt u niet een stap terug in het kieskompas.\nDat doet u via de navigatie op de pagina zelf.\n\n';
}
*/

var emptiedElements = new Array();
function js_in_array(the_needle, the_haystack)
{
	var the_hay = the_haystack.toString();
	if(the_hay == '')
	{
		return false;
	}
	var the_pattern = new RegExp(the_needle, 'g');
	var matched = the_pattern.test(the_haystack);
	return matched;
}

function emptyValue(element)
{
	if(!js_in_array(element.id,emptiedElements))
	{
		emptiedElements[emptiedElements.length] = element.id;
		element.value='';
	}
}

function keepAlive()
{
	var http = getHTTPObject();

	if(http)
	{
		url = rootDir + '/keepalive/';
		http.open("GET", url, true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.send(null);
	}
	setTimeout("keepAlive()", sessionLifetime);
}

function changeInfoOptions(itemId,optionId, menuId)
{
	if(optionId == 3)
	{
		changeDivContents('/infooption/' + itemId + '/' + optionId + '/','mainDiv',33);
	}
	else
	{
		changeDivContents('/infooption/' + itemId + '/' + optionId + '/','mainDiv');
	}
	
	var i = 1;
	var obj = '';
	while(document.getElementById('infoItem' + i) != undefined)
	{
		obj = document.getElementById('infoItem' + i);
		label = getImageLabel(obj);

		if(i == menuId)
		{
			bgImages['infoItem' + i] = "url('/images/" + label + "_active.gif')";
		}
		else
		{
			bgImages['infoItem' + i] = "url('/images/" + label + "_normal.gif')";
		}
		mouseEventInfo(obj,1);
		i++;
	}
}


function getImageLabel(elt)
{
	eltImage = elt.style.backgroundImage;
	imgSplit = eltImage.split('_');
	imgSplit = imgSplit[0].split('/');
	return imgSplit[imgSplit.length - 1];
}

// Function used in Flash for opening new JS windows for pop-ups
var newWindow = null;
function openNewWindow(URLtoOpen, windowName, windowFeatures)
{
	newWindow=window.open(URLtoOpen, windowName, windowFeatures);
    newWindow.focus();
}


function writeStatsFlashHtml(xml)
{
	var retVal = '';
    retVal = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="650" HEIGHT="500" id="FC_2_3_Column3D">';
    retVal += '<param name="movie" value="/result/FC_2_3_Pie3D.swf"/>';
    retVal += '<param name="FlashVars" value="&dataURL=/xml/' + xml + '.xml&chartWidth=650&chartHeight=500"/>';
	retVal += '<param name="quality" value="high"/>';
    retVal += '<param name="bgcolor" VALUE="#FFFFFF"/>';
    retVal += '<embed src="/result/FC_2_3_Pie3D.swf" FlashVars="&dataURL=/xml/' + xml + '.xml&chartWidth=650&chartHeight=500" quality=high bgcolor=#FFFFFF WIDTH="650" HEIGHT="500" NAME="FC_2_3_Column3D" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
    retVal += '</object>';
	return retVal;
}


function changeLoginForm(action)	// login: default login form, request: request login data, empty: hide loginForm
{
	if(action == undefined)
	{
		document.getElementById('loginFormElt').style.display = '';
		document.getElementById('loginForm').style.display = 'none';
	}
	else if(action == 'request')
	{
		document.getElementById('loginFormElt').style.display = 'none';
	}
}
