<!--
function set_cookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function get_cookie(name) {
    var name_eq = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(name_eq) == 0) return c.substring(name_eq.length,c.length);
    }
    return null;
}


if(get_cookie("page_size") != null){   
    document.write('<style>');
    document.write('body{');
    document.write('font-size:'+ get_cookie("page_size") + '%');
    document.write('}');
    document.write('</style>')
}

function checkComment()
{
	var errorMess = "";
	if (document.frmComment.strName.value.length < 2)
	{
		document.frmComment.strName.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt namn måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmComment.strName.style.backgroundColor='#FFFFFF';
	}

	if (document.frmComment.strComment.value.length < 10 || document.frmComment.strComment.value.length > 250)
	{
		document.frmComment.strComment.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt kommentar måste innehålla 10-250 tecken.\n';
	}
	else
	{
		document.frmComment.strComment.style.backgroundColor='#FFFFFF';
	}
	
	if (document.frmComment.strCode.value.length < 1)
	{
		document.frmComment.strCode.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit något svar på frågan.\n';
	}
	else
	{
		document.frmComment.strCode.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length > 1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkCommentPost()
{
	var errorMess = "";
	if (document.frmCommentPost.strName.value.length < 2)
	{
		document.frmCommentPost.strName.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt namn måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmCommentPost.strName.style.backgroundColor='#FFFFFF';
	}
	
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.frmCommentPost.strEmail.value)))
	{
		document.frmCommentPost.strEmail.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit en giltig e-postadress.\n';
	}
	else
	{
		document.frmCommentPost.strEmail.style.backgroundColor='#FFFFFF';
	}
	
	if (document.frmCommentPost.strComment.value.length < 10 || document.frmCommentPost.strComment.value.length > 250)
	{
		document.frmCommentPost.strComment.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt kommentar måste innehålla 10-250 tecken.\n';
	}
	else
	{
		document.frmCommentPost.strComment.style.backgroundColor='#FFFFFF';
	}
	
	if (document.frmCommentPost.strCode.value.length < 1)
	{
		document.frmCommentPost.strCode.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit något svar på frågan.\n';
	}
	else
	{
		document.frmCommentPost.strCode.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length > 1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkMessage()
{
	var errorMess = "";
	if (document.frmMessage.strName.value.length < 2)
	{
		document.frmMessage.strName.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt namn måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmMessage.strName.style.backgroundColor='#FFFFFF';
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.frmMessage.strEmail.value)))
	{
		document.frmMessage.strEmail.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit en giltig e-postadress.\n';
	}
	else
	{
		document.frmMessage.strEmail.style.backgroundColor='#FFFFFF';
	}
	if (document.frmMessage.strMessage.value.length < 10)
	{
		document.frmMessage.strMessage.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt meddelande måste innehålla minst 10 tecken.\n';
	}
	else
	{
		document.frmMessage.strMessage.style.backgroundColor='#FFFFFF';
	}
	if (document.frmMessage.intProtect.value.length < 1)
	{
		document.frmMessage.intProtect.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit svaret på frågan.\n';
	}
	else
	{
		document.frmMessage.intProtect.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

// -->