var catQuestions = new Array();
var curFlashVal = new Array();
var handleImages = new Array();
var handledItemImages = new Array();

function preLoad(id)
{
	var http = getHTTPObject();
	if(http && id != undefined && id >= -1 && handledItemImages[id] != true)
	{

		handledItemImages[id] = true;

		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
	{
		var text = new Array();
		text[1] = 'Moment geduld aub, positie wordt geladen...';
		text[2] = 'Please wait, position is being calculated...';

		document.getElementById('flashApp').innerHTML = '<span style="color: black;">' + text[languageId] + '</span>';
		changeDivContents('/positie/' + provinceId + '/-1/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)
{
	// id is the menuitem counter (starting with 0)
	if(document.getElementById('flashTestMsg') != undefined)
	{
		document.getElementById('flashTestMsg').style.display = 'none';
	}

	// If intro == 1, the next step will be shown with an intro

	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($('loginForm'))
	{
		$('loginForm').style.display='none';
	}
	
	if(document.getElementById('leftMenuContainer') == undefined)
	{
		changeDivContents('/leftmenu/','leftMenu',-2);
	}

	if(id == 0)
	{

		
	}
	else if(id == 1)
	{
		
	}
	else if(id == 2)
	{
		if(document.getElementById('flashApp') != undefined)
		{
			calculateScore();
		}
		//setProvincieBanner();
	}
	else if(id == 3)
	{
		
	}
	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 s_url = rootDir + '/container/' + id + '/';
	new Ajax(s_url,{update:$('contentFrame'),evalScripts:true,onComplete: function()
			{
				handleContainer(id);
				makeContainerTransparent($('contentFrame'));
			}

	}).request();

}

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 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,1);
										}
										else
										{
											allInfo = http.responseText.split('(())');

											catInfo = allInfo[0].split('[[]]');

											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 handleTrust(o_elt,s_value)
{

	if(typeof(o_elt) == 'object')
	{
		var a_id = o_elt.id.split('_');

		if($('issue_' + a_id[2]))
		{
			$('issue_' + a_id[2]).value = a_id[3];
		}
		o_elt.src = '/images/radio_checked.png';
		makeTransparent(o_elt);
		if($('issue_candidate_' + a_id[2] + '_' + a_trustAnswer[a_id[2]]))
		{
			$('issue_candidate_' + a_id[2] + '_' + a_trustAnswer[a_id[2]]).src = '/images/radio_unchecked.png';
			makeTransparent($('issue_candidate_' + a_id[2] + '_' + a_trustAnswer[a_id[2]]));
		}
		a_trustAnswer[a_id[2]] = a_id[3];

		a_trustAnswers.include(a_id[2]);

		if(a_trustAnswers.length == 4)
		{

			$('tForm').send(
			{
				update: $('contentFrame'),
				evalScripts: true,
				onComplete: function()
				{

					a_trustAnswers = new Array();
					makeContainerTransparent($('contentFrame'));

					if(this.response.text == '')
					{
						changeContent(2,1);
					}
				}
			});
		}
	}
	
}

function makeContainerTransparent(o_container)
{
	
	o_container.getElements('.transparant').each(function(o_img)
		{
			makeTransparent(o_img);
			
		});
}

function makeTransparent(o_img)
{
	if (window.ie6)
	{ 
		o_img.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=\'true\', src=\'' + o_img.src + '\'';
		o_img.src = '/images/blank.gif';
	}
}

function showTrustIssue(i_issueId)
{
	var s_url = '/issue/' + i_issueId + '/';
	new Ajax(s_url,{update:$('contentFrame'),evalScripts:true,onComplete: function()
			{
				a_trustAnswers = new Array();
				makeContainerTransparent($('contentFrame'));

			}}).request();
}

function mouseEventTrust(o_elt, b_type)
{
	if(b_type == 1) // over
	{
		o_elt.src = '/images/radio_checked.png';
	}
	else
	{
		var a_id = o_elt.id.split('_');


		
		if(a_trustAnswer[a_id[2]] != a_id[3])
		{
			o_elt.src = '/images/radio_unchecked.png';
		}
		else
		{
			o_elt.src = '/images/radio_checked.png';
		}
	}
	makeTransparent(o_elt);

}
var a_trustAnswers = new Array();


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);
		
		document.getElementById('mafId').innerHTML = '<img src="/images/zandloper.gif" />';

		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 saveUserForm()
{
	$('userForm').send({
		update: $('saveUserDataId')
	});
}

function cleanSession(self,b_complete)
{
	var http = getHTTPObject();

	if(b_complete == true)
	{
		var s_url = rootDir + "/clearsession/";
	}
	else
	{

		var s_url = rootDir + "/clearuser/";
	}

	http.open("POST", s_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(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)
{
	var text = new Array();
	text[1] = 'Even geduld a.u.b.';
	text[2] = 'Please wait';
	document.getElementById('loginFormText').innerHTML = text[languageId];
	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)
										{
											var text = new Array();
											text[1] = 'Uw gegevens zijn geladen. U wordt over 3 seconden doorverwezen.';
											text[2] = 'Data successfully retrieved. You are being redirected in 3 seconds.';

											document.getElementById('loginForm').innerHTML = '<span style="font-size: 12px;color: white">' + text[languageId] + '</span>';
											(function(){window.location.href='/page/1/position/';}).delay(3000);
										}
										else
										{
											document.getElementById('loginFormText').innerHTML = http.responseText;
										}
									}
								
								};
		http.send(formVal);

	}
}

function requestPassword(form)
{
	var text = new Array();
	text[1] = 'Even geduld a.u.b.';
	text[2] = 'Please wait';
	document.getElementById('loginFormText').innerHTML = text[languageId];
	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()
{
	(function(){new Ajax(rootDir + '/keepalive/', {method: 'get'}).request()}).periodical(sessionLifetime);
}

function changeLanguage(languageShortCode)
{
	var url = rootDir + '/language/' + languageShortCode + '/';
	new Ajax(url, {method: 'get', onComplete: function()
		{
			document.location.reload();
		}
	}).request();
}

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';
	}
}

function initializeLoginForm()
{
	$$('.loginForm').each(function(mooElement)
			{
				var mooId = mooElement.id;
				mooElement.setStyle('overflow', 'hidden');
				mooElement.setStyle('opacity','0');
				mooElement.setStyle('height','0');
				mooElement.setStyle('display','');


				mooElement.fx = new Fx.Styles(mooId, {duration: 500});
				mooElement.o = function()
				{  
					urchinTracker('/loginRequest');
					var opacity = mooElement.getStyle('opacity').toInt();
					 if (opacity > 0) 
					 {
						mooElement.fx.start({'opacity': 0, 'height': 0});

					 }
					 else
					 {
						
						mooElement.fx.start({
									'opacity': [0,1], 'height': mooElement.scrollHeight
						});
					 }
				};

				

				$('saveddiv').onclick = mooElement.o;
			}
		);
}

function showUserForm()
{
	if(document.getElementById('userFormImage') != undefined)
	{
		document.getElementById('userFormImage').style.display = 'block';
	}
}