function WriteMenu(top)
{
	document.write("<div class=\"medium\" id=\"nav\">");
	document.write("<ul>");
	if (!top) {
	    document.write("<li><a href=\"Default.aspx\"><span>Home</span></a></li>");
	}
	document.write("<li><a href=\"about.html\"><span>About</span></a></li>");
	document.write("<li><a href=\"Art.aspx\"><span>Artwork</span></a></li>");
	document.write("<li><a href=\"Jewelry.aspx\"><span>Jewelry</span></a></li>");
	document.write("<li><a href=\"KissKiss.aspx\"><span>Kiss Kiss Stufflings</span></a></li>");
	document.write("<li><a href=\"MyStores.html\"><span>My Stores</span></a></li>");
	document.write("<li><a href=\"contact.html\"><span>Contact</span></a></li>");
	document.write("<li><a href=\"http://lailakujala.blogspot.com\")><span>blog/News</span></a></li>");
	document.write("</ul>");
	document.write("<br />");
	document.write("</div>");
}

function CopyrightString(divFlag)
{
	var str;
	if (divFlag)
	{
		str = "<div id=\"footer\"><br />";
	}
	else
	{
		str = "<div><br />";
	}
	str += "All website content Copyright &copy; 2009 Laila Kujala, All rights reserved.<br />";
	str += "This website and its content cannot be reproduced by any means,<br />";
	str += "in part or in whole, without the express ";
	str += "written permission of the author.<br />";
	str += "</div>";
	return str;
}


function WriteCopyright(divFlag)
{
	document.write( CopyrightString(divFlag) );
}

var LinkWindow
function openlink(path)
{
	if (LinkWindow != null)
	{
		LinkWindow.close();
	}
	LinkWindow=window.open(path, "newwin");
	LinkWindow.focus();
	self.name="main";
}

	var good;
	
	function validateContact()
	{
	    if (document.forms[0].firstname.value.length == 0)
	    {
	        alert("Please enter your first name");
	        document.forms[0].firstname.focus();
	        return false;
	    }
	    if (document.forms[0].lastname.value.length == 0)
	    {
	        alert("Please enter your last name");
	        document.forms[0].lastname.focus();
	        return false;
	    }
	    if (document.forms[0].email.value.length == 0)
	    {
	        alert("Please enter your email");
	        document.forms[0].email.focus();
	        return false;
	    }
	    else
	    {
	        if (!checkEmailAddress(document.forms[0].email))
	        {
	            alert("Please enter a valid email");
	            document.forms[0].email.focus();
	            return false;
	        }
	    }
	    if (document.forms[0].comment.value.length == 0)
	    {
	        alert("Please enter a comment");
	        document.forms[0].comment.focus();
	        return false;
	    }
	}
	
	function checkEmailAddress(field)
	{
		var goodEmail = field.value.match(/\b(^(\S+@).+((\.....)|(\....)|(\...))$)\b/gi);
		if (goodEmail)
		{
			good = true;
		}
		else
		{
			alert('Please enter a valid address.');
			field.focus();
			field.select();
			good = false;
		}
		return good;
	}
