// JavaScript Document

var fileContent='';
var theLocation='';

function readFileViaApplet(n) {
	document.f1.t1.value='Reading in progress...';
	document.ReadURL.readFile(theLocation);
	setTimeout("showFileContent()",100);
	}

function showFileContent() {
	if (document.ReadURL.finished==0) {
		setTimeout("showFileContent()",100);
		return;
		}
	fileContent=document.ReadURL.fileContent;
	document.form1.textarea1.value=fileContent;
	}

function newContentFrames (frame, contentSrc) {
	var thisFrame
	thisFrame = findFrame (frame)
	thisFrame.src = 'frames/'+contentSrc
	}

function newContentFramesSecure (frame, contentSrc) {
	var ranNum= Math.round(Math.floor(Math.random()*1000000000000));
	newContentFrames (frame, contentSrc + "#" + ranNum)
	}



function newContent (frame, contentSrc) {
	var thisFrame
//	document.write (frame + '  ' + contentSrc)
	thisFrame = findFrame (frame)
//	document.write (thisFrame)
	thisFrame.src = contentSrc
	}

function findFrame (frame) {
	var thisFrame
	thisFrame=document.getElementById(frame)													// Prøv først i aktuelt vindue
	if (thisFrame == null) thisFrame=parent.document.getElementById(frame)				// Ellers i parent
	if (thisFrame == null) thisFrame=parent.parent.document.getElementById(frame)				// Ellers i parent parent
	return (thisFrame)
	}

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header

var good;
function checkEmailAddress(field) {
	// the following expression must be all on one line...
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	if (goodEmail){
	   good = true
		}
	else {
	   alert('Please enter a valid e-mail address.')
   	field.focus()
	   field.select()
   	good = false
	   }
	}

u = window.location;
m = "I thought this might interest you...";
function mailThisUrl(){
   good = false
   checkEmailAddress(document.eMailer.address)
   if (good){
      // the following expression must be all on one line...
      window.location = "mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+" "+u;
	   }
	}
