<!-- Begin

function preparearticles(){

Sum=0


//document.write(ArticleTitle);
for (hovedtelle=0;hovedtelle<ArticleDateSort.length;hovedtelle+=1){
	pos=-2;
	var pos= ArticleCode[hovedtelle].indexOf(DenneSide.slice(0,1));
	if(PageID=="library"){	pos=2	}
	if (pos>-1){
		NyDato[Sum]= ArticleDate[hovedtelle]
		NyDatoSort[Sum]= ArticleDateSort[hovedtelle]
		NyKode[Sum]= ArticleCode[hovedtelle]
		NyTitt[Sum]= ArticleTitle[hovedtelle]
		NyForf[Sum]= ArticleWriter[hovedtelle]
		NyIngr[Sum]=ArticleIngress[hovedtelle]
		NyFoto[Sum]= ArticlePhoto[hovedtelle]
//		NyArticleAltURL[Sum]= ArticleAltURL[hovedtelle]
		Sum+=1
		}
	}

//document.write('<br>'+Sum);

NyDatoSort.sort();
NyDatoSort.reverse();

}

function listarticles(){
//document.write("uuu");

for (hovedtelle=liststart;hovedtelle<liststop;hovedtelle+=1){
//hovedtelle=0;
	for (minitelle=0;minitelle<ArticleDateSort.length;minitelle+=1){
		if (ArticleDate[minitelle]==NyDatoSort[hovedtelle]){

			if((liststart<3)&&(PageID!="library")){
				checkondate=ArticleDate[minitelle];
				checkondates();
				background="graphic/03bg.jpg";
				if(checkedAge<20){  background="graphic/03bg-offwhite.jpg";	}
				document.write('<table CELLSPACING=0 CELLPADDING=0 WIDTH=242 nosave border=0 background=\"'+background+'\"><tr>');
				document.write('<td><img width=10 height=10 nosave src=\"graphic/frames/1blue-top-left.gif\"></td>');
				document.write('<td><img width=222 height=10 nosave src=\"graphic/frames/1blue-side-top.gif\"></td>');
				document.write('<td><img width=10 height=10 nosave src=\"graphic/frames/1blue-top-right.gif\"></td></tr>');
				document.write('<tr valign=top><td><img width=10 height=240 nosave src=\"graphic/frames/1blue-side-left.gif\"></td>');
				document.write('<td>');
				}

			document.write('<font face=arial size=2><p>');

// dato start
			if(liststart>2){	document.write('<img align=left width=10 height=35 src=tom.gif>');	}
			document.write('<font size=1>'+MonthText[ArticleDate[minitelle].slice(4,6)/1]+" ");
			document.write(ArticleDate[minitelle].slice(6,8)/1+", ");
			document.write(ArticleDate[minitelle].slice(0,4)/1+", ");
			document.write('</font>');
// dato stopp
// skribent start
			for(findwriter=0;findwriter<WriterName.length;findwriter+=1){
				if(WriterID[findwriter]==NyForf[hovedtelle]){ 
					document.write('<font size=1>'+WriterName[findwriter]+":"+'</font><br>');
					}
				}
// skribent stopp

			var position= ArticleCode[minitelle].indexOf("X");
			if (position>-1){
				document.write('<img hspace=5 width=13 height=14 src=\"'+leveljump+'graphic/x.gif\">');
				}
			if(liststart<3){	document.write('<font size=3>');	} else{	document.write('<font size=2>');	}
			document.write('<font color=\"#0066CC\"><b>'+ArticleTitle[minitelle]+'</b></font></font><br>');
			//document.write('<br><font size=1>'+MonthText[ArticleDate[minitelle].slice(4,6)/1]+", ");
			//document.write(ArticleDate[minitelle].slice(6,8)/1+", ");
			//document.write(ArticleDate[minitelle].slice(0,4)/1);
for (tellforfatter=0;tellforfatter<WriterID.length;tellforfatter+=1){


	if (WriterID[tellforfatter]==ArticleWriter[minitelle]){
		Journalist=WriterName[tellforfatter];
		Journalistmail=WriterMail[tellforfatter];
		}
	}

			//document.write(", by "+'<a href=\"mailto:'+Journalistmail+'?subject=RE:'+ArticleTitle[minitelle]+'\">'+ArticleWriter+'</a></font>');

			//document.write('<br>');
			if(ArticleAltURL[minitelle].length>0){ Link=ArticleAltURL[minitelle]  }
			else { Link=ArticleAddress[minitelle]  }
			if ((hovedtelle<3)&&(PageID!="library")){
				document.write('<a href=\"'+Link+'\"><img border=0 align=right vspace=5 hspace=5 src=\"'+ArticlePhoto[minitelle]+'\"></a><br>');
			}
			if(liststart<3){	document.write(ArticleIngress[minitelle]+'<br>');	}
//			document.write('<br>');
//document.write(ArticleAltURL[minitelle]);
//document.write(ArticleCode[minitelle]);
			if((ArticleCode[minitelle].slice(0,1)!="0")&&(ArticleCode[minitelle].slice(0,1)!="R")){
//				if(DenneSide.slice(0,1)!="0"){
					document.write('<font size=1><a href=\"'+leveljump+Link+'\">'+"READ MORE"+'</a>');
//					}
				}
			if(DenneSide.slice(0,1)==0&&ArticleCode[minitelle].slice(0,1)!="0"){
				document.write(" | "+'<a href=\"'+ArticleCode[minitelle].slice(1,2)/1+"0000.html"+'\">'+Filnavn[ArticleCode[minitelle].slice(1,2)/1]+'</a></font>');
				}
			document.write('</font>');

			if((liststart<3)&&(PageID!="library")){
				document.write('</td>');
				document.write('<td><img width=10 height=240 nosave src=\"graphic/frames/1blue-side-right.gif\"></td></tr>');
				document.write('<tr><td><img width=10 height=10 nosave src=\"graphic/frames/1blue-bot-left.gif\"></td>');
				document.write('<td><img width=222 height=10 nosave src=\"graphic/frames/1blue-side-bottom.gif\"></td>');
				document.write('<td><img width=10 height=10 nosave src=\"graphic/frames/1blue-bot-right.gif\"></td></tr>');
				document.write('</table>');
				}

			}
		}
	}

}

// End -->

