
function toprad(txt)
{
        document.write("<DIV id=\"top\">")
        document.write("<H1>"+txt+"</H1>")
        document.write("</DIV>")
}

function rubrikrad()
{
        document.write("<DIV id=\"nav\">")
	document.write("<UL id=\"linklist\">")
           document.write("<LI>Kartor</LI>")
           document.write("<LI>Guidebok</LI>")
        document.write("</UL>")
        document.write("</DIV>")
}



function textsida(vanster,vansterpil,mitt,hoger,hogerpil)
{
        document.write("<DIV id=\"content\">")
        document.write("<table width=\"750\">")
        document.write("<tr><td width=\"20%\" valign=\"top\">")
	if (vanster=="blank")
	{
		document.write("<br>")
	}
	else
	{
	        document.write("<a href="+ vanster +"><img src="+ vansterpil +" border=\"0\"></a>")
	}
        document.write("</td><td>")
	if (mitt=="blank")
	{
		document.write("<br>")
	}
	else
	{
		document.write("<iframe src=" + mitt + " width=\"600\" height=\"440\" frameborder=\"0\"></iframe>")
	}
        document.write("</td>")
        document.write("<td width=\"20%\" valign=\"top\" halign=\"right\">")
	if (hoger=="blank")
	{
		document.write("<br>")
	}
	else
	{
        	document.write("<a href="+ hoger  +"><img src="+ hogerpil +" border=\"0\" align=\"right\"></a>")
        }
	document.write("</td></tr></table>")
        document.write("</DIV>")
}


function fotradstart(datum)
{
	document.write("<DIV id=\"footer\">")
        document.write("<UL id=\"footlist\">")
           document.write("<LI>Uppdaterad " + datum + "</LI>")
           document.write("<LI><a href=\"mailto:info@lillahallvards.se\">info@lillahallvards.se</a></LI>")
}

function radend()
{
        document.write("</UL>")
	document.write("</DIV>")
}


function fotrad(datum)
{
	fotradstart(datum)
	radend()
}

function fotradindex(datum)
{
	fotradstart(datum)
           document.write("<LI><a href=\"http://jigsaw.w3.org/css-validator/\">")
             document.write("<img style=\"border:0;width:88px;height:31px\" ")
             document.write("src=\"http://jigsaw.w3.org/css-validator/images/vcss\" ")
             document.write("alt=\"Valid CSS!\" halign=\"right\">")
        document.write("</a></LI>")
        radend()
}


function validate_email(field,alerttxt)
{
	with (field)
	{
	apos=value.indexOf("@")
	dotpos=value.lastIndexOf(".")
	if (apos<1||dotpos-apos<2) 
  		{alert(alerttxt);return false}
		else {alert("OK");return true}
	}
}

function validate_required(field,alerttxt)
{
	with (field)
	{
	if (value==null||value=="Anna")
  	{alert(alerttxt);return false}
	else {return true}
	}
}

function validate_form(thisform)
{
	with (thisform)
	{
	if (validate_required(namn,"Namn saknas!")==false)
	  {text.focus();return false}
	}
}
