var theImages = new Array() // do not change this

theImages[0] = 'Images/pic1.jpg'
theImages[1] = 'Images/pic2.jpg'
theImages[2] = 'Images/pic3.jpg'
theImages[3] = 'Images/pic4.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));


function showImage()
{
document.write('<img src="'+theImages[whichImage]+'">');
}


function validate()
{
x=document.loginForm
at=x.email.value.indexOf("@")
at=x.email.value.indexOf(".")
submitOK="True"

if (at==-1) 
 {
 alert("E-mail väärin kirjoitettu!")
 submitOK="False"
 }
if (submitOK=="False")
 {
 return false
 }
}


function confirm_delete()
{ 
return (confirm('Are you sure?')); 
} 


function Clean4Print( tag_id )
{
	var ref = document.getElementById( tag_id );

	clean_popup = window.document.open( "about:blank","","");
  	clean_popup.document.write('<html>\n<head>\n<title>'+document.title+'</title>\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n<link rel="stylesheet" href="../Calendar/css/clean4print.css">\n</head>\n');
  	clean_popup.document.write('<body><div class="clean4print">\n' );

	// output all sections marked with tag_id
	while (ref!=null)
	{
		clean_popup.document.write( ref.innerHTML + '\n' );
		ref = ref.nextSibling;
	}

	clean_popup.document.write('</div></body>\n</html>\n');
}




function toUnicode(elmnt,content)
{
if (content.length==elmnt.maxLength)
	{
	next=elmnt.tabIndex
	if (next<document.forms[0].elements.length)
		{
		document.forms[0].elements[next].focus()
		}
	}
}
