function rollPic(strOffSrc, strOverSrc) {
	if (document.images) {
		this.off = new Image();
		this.over = new Image();
		this.off.src = strOffSrc;
		this.over.src = strOverSrc;
	}
}
function roll(strPic, strAction, strMsg) {
	if (document.images) {
		document.images[strPic].src = eval(strPic + '.' + strAction + '.src')
	}
	if (strMsg) {
		window.status = strMsg;
		return true;
	}
}

function togglePic(field) {
	if (field.src.indexOf('_over.gif') > 0) {
		field.src = field.src.replace(/_over.gif/i, '.gif');
	} else {
		field.src = field.src.replace(/.gif/i, '_over.gif');
	}
}

function toggleClass(field) {
	if (field.className.indexOf('_over') > 0) {
		field.className = field.className.replace(/topnavi_over/i, 'topnavi');
	} else {
		field.className = field.className.replace(/topnavi/i, 'topnavi_over');
	}
}

function CheckForm(f_objForm)
{
	f_objForm.frm_strMoreSubjectData.value = CheckFormElement(f_objForm.frm_strMoreSubjectData.value);
	f_objForm.frm_strName.value = CheckFormElement(f_objForm.frm_strName.value);
	f_objForm.frm_strAge.value = CheckFormElement(f_objForm.frm_strAge.value);
	f_objForm.frm_strAddress.value = CheckFormElement(f_objForm.frm_strAddress.value);
	f_objForm.frm_strPhone.value = CheckFormElement(f_objForm.frm_strPhone.value);
	f_objForm.frm_strEmail.value = CheckFormElement(f_objForm.frm_strEmail.value);
	f_objForm.frm_strEducation.value = CheckFormElement(f_objForm.frm_strEducation.value);
	f_objForm.frm_strMoreSelfData.value = CheckFormElement(f_objForm.frm_strMoreSelfData.value);
	
	f_objForm.submit();
}

function CheckFormNN(f_objForm)
{
	for (var i = 0; i<f_objForm.elements.length; i++) {
		if (f_objForm.elements[i].type == 'text') {
			f_objForm.elements[i].value = CheckFormElement(f_objForm.elements[i].value);
		};
		if (f_objForm.elements[i].type == 'textarea') {
			f_objForm.elements[i].value = CheckFormElement(f_objForm.elements[i].value);
		};
    }
}

function CheckSelected(f_objSelected)
{
	if (f_objSelected.options[f_objSelected.selectedIndex].value != ""){ 
		location.href=f_objSelected.options[f_objSelected.selectedIndex].value;
	}
}

function CheckFormElement(f_strValue)
{
	var strContent;
	
	strContent = f_strValue;
	
	while (strContent.search("\u00E4") >= 0)
	{
		strContent = strContent.replace( "\u00E4", "&auml;" );
	}
	while (strContent.search("\u00F6") >= 0)
	{
		strContent = strContent.replace( "\u00F6", "&ouml;" );
	}
	while (strContent.search("\u00E5") >= 0)
	{
		strContent = strContent.replace( "\u00E5", "&aring;" );
	}
	while (strContent.search("\u00C4") >= 0)
	{
		strContent = strContent.replace( "\u00C4", "&Auml;" );
	}
	while (strContent.search("\u00D6") >= 0)
	{
		strContent = strContent.replace( "\u00D6", "&Ouml;" );
	}
	while (strContent.search("\u00C5") >= 0)
	{
		strContent = strContent.replace( "\u00C5", "&Aring;" );
	}
	return(strContent);
}

function CheckFormOld()
{

	var strSubject;
	var strContent;
	var i;
				
	strContent = document.all.Client.Content.value;
	strSubject = document.all.Client.Subject.value;

	for(i=1;i<1000;i++) /* hmm.. maybe not very nice implementation */
	{
		strContent = strContent.replace( "\u00E4", "&auml;" );
		strContent = strContent.replace( "\u00F6", "&ouml;" );
		strContent = strContent.replace( "\u00E5", "&aring;" );

		strContent = strContent.replace( "\u00C4", "&Auml;" );
		strContent = strContent.replace( "\u00D6", "&Ouml;" );
		strContent = strContent.replace( "\u00C5", "&Aring;" );

		strSubject = strSubject.replace( "\u00E4", "&auml;" );
		strSubject = strSubject.replace( "\u00F6", "&ouml;" );
		strSubject = strSubject.replace( "\u00E5", "&aring;" );

		strSubject = strSubject.replace( "\u00C4", "&Auml;" );
		strSubject = strSubject.replace( "\u00D6", "&Ouml;" );
		strSubject = strSubject.replace( "\u00C5", "&Aring;" );

	}

	document.all.Client.Content.value = strContent;
	document.all.Client.Subject.value = strSubject;

	document.all.Client.submit();
}
