
function PrintHeader( Title, SubTitle, Author, AuthorEmail, BackgroundPicture, TitleColor, SubTitleColor, ArticleDateText )
{
	document.write ('<table height=75 width=760 cellpadding=0 cellspacing=0 border=0 bgcolor=#ffffff>')
	document.write ('<tr><td background="' + BackgroundPicture + '" valign=top>')
	document.write ('<table cellpadding=0 cellspacing=0 border=0><tr><td width=10></td><td><FONT SIZE=6 face="Browalliaupc" COLOR=#' + TitleColor + '><B>' + Title + '</B></FONT></td></tr></table><BR>')
	if ( SubTitle != '' ) 	
		document.write ('<table cellpadding=0 cellspacing=0 border=0><tr><td width=10></td><td><FONT SIZE=4 face="Browalliaupc" COLOR=#' + SubTitleColor + '><B>' + SubTitle + '</B></FONT></td></tr></table><BR>')
	document.write ('</td></tr></table>')
	document.write ('<table width=760 cellpadding=10 cellspacing=0 border=0 bgcolor=#ffffff><tr><td align=right>')
	document.write ( Author )
	if ( AuthorEmail != '' ) document.write (' (' + AuthorEmail + ')')
	if ( ArticleDateText != '' ) document.write ('<br>' + ArticleDateText )
	document.write ('</td></tr></table>')
}

function PrintParagraph(Anchor, Title, ParagraphText, 
								PictureFile, ThumbFile, Caption, PictureToolTip, 
								VideoFile, VideoToolTip, SoundFile, SoundToolTip)
{
	document.write ('<TABLE border=0 WIDTH="760" cellspacing=0 CELLPADDING="10" BGCOLOR="#FFFFFF"><TR><td width=300 align=center valign=top>')
	document.write ('<a name="' + Anchor + '">')
	document.write ('<table border=0><tr width=100%><td align=center><table><tr><td valign=bottom>')
	if ( ThumbFile != '' ) 
		// no thumb, print the bigpicture without link
		document.write ('<a href="' + PictureFile + '"><img border=0 alt="' + PictureToolTip + '" src="' + ThumbFile + '"></a>')
	else if ( PictureFile != '' )
		document.write ('<img border=0 src="' + PictureFile + '">')
	document.write ('</td><td valign=bottom>')
	if ( VideoFile != '' ) 
		document.write ('<br><a href="' + VideoFile + '"><img border=0 vspace=1 alt="' + VideoToolTip + '" src="../17x17_movie.gif"></a>')
	if ( ThumbFile != '' )
		document.write ('<br><a href="' + PictureFile + '"><img border=0 alt="' + PictureToolTip + '" vspace=1 src="../17x17_magnify.gif"></a>')
	if ( SoundFile != '' )
		document.write ('<br><a href="' + SoundFile + '"><img border=0 alt="' + SoundToolTip + '" vspace=1 src="../17x17_speaker.gif"></a>')
	document.write ('</td></tr></table></td><tr><td><font size=1 color=#000080 face="ms sans serif">')
	document.write ( Caption + '</font></td></tr></table></td><TD width=460 valign=top>')
	if ( Title != '' ) document.write ('<font size=3 color=#000080 face="browalliaupc"><b><big>' + Title + '</big></b></font><br>')
	document.write ( '<font size=1 face="ms sans serif">' + ParagraphText + '</font>')
	document.write ('</TD></TR></TABLE>')
}

function PrintFullscapeParagraph(Anchor, Title, ParagraphText)
{
	document.write ('<TABLE border=0 WIDTH="760" cellspacing=0 CELLPADDING="10" BGCOLOR="#FFFFFF"><TR>')
	document.write ('<td width=100% valign=top>')
	document.write ('<a name="' + Anchor + '">')
	if ( Title != '' ) document.write ('<font size=3 color=#000080 face="browalliaupc"><b><big>' + Title + '</big></b></font><br>')
	document.write ( '<font size=1 face="ms sans serif">' + ParagraphText + '</font>')
	document.write ('</TD></TR></TABLE>')
}

function PrintLink( URL, Title, Description, Language, ReviewPageKey, IsNew )
{
	document.write ('<TABLE border=0 WIDTH="760" cellspacing=0 CELLPADDING="1" BGCOLOR="#FFFFFF"><TR><td align=left valign=top>')
	document.write ('<dd>')
	if ( Language == 'T' )
		document.write ('<img hspace=3 src="flag_thai.gif">')
	else if ( Language == 'E' )
		document.write ('<img hspace=3 src="flag_eng.gif">')
	document.write ('<a href="' + URL + '">' + Title + '</a> ')
	if ( Description != '' ) 
		document.write ( Description )
	if ( IsNew == 'y' || IsNew == 'Y' )
		document.write ('<img src="img/new.gif">')
	if ( ReviewPageKey != '' )
		document.write ('<a href="review')
	document.write ('</TD></TR></TABLE>')
}

function PrintArticleFooter( DocumentDate, WebMasterName, WebMasterEmail, WebMasterNote )
{
	document.write ('<table width=760 cellpadding=10 cellspacing=0 border=0 bgcolor=#ffffff><tr><td width=300 bgcolor=white>.</td><td width=460>')

	var	MonthSt = new Array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน", "กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม")
	var d = new Date (DocumentDate)
	var year = d.getYear();
	if (year==0) year=2000;
	if (year<1900) year+=1900;

	document.write ('<font size=1 face="ms sans serif">')
	document.write ('<hr size=1>')
	if ( WebMasterNote != '' )	document.write ( '* ' + 	WebMasterNote + '<br>')
	if ( WebMasterName != '' ) {
		document.write ( WebMasterName )
		if ( WebMasterEmail != '' ) 
			document.write ( ' (<a href="mailto:' + WebMasterEmail + '">' + WebMasterEmail + '</a>)<br>')
	}
	document.write ( d.getDate() + " " + MonthSt[d.getMonth()] + " " + (year+543) )
	document.write ('</font>')
	document.write ('</td></tr></table>')
}

function PrintFullscapePageFooter( DocumentDate, WebMasterName, WebMasterEmail, WebMasterNote )
{
	document.write ('<table width=760 cellpadding=10 cellspacing=0 border=0 bgcolor=#ffffff><tr><td width=760>')

	var	MonthSt = new Array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน", "กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม")
	var d = new Date (DocumentDate)
	var year = d.getYear();
	if (year==0) year=2000;
	if (year<1900) year+=1900;

	document.write ('<font size=1 face="ms sans serif">')
	document.write ('<hr size=1>')
	if ( WebMasterNote != '' )	document.write ( '* ' + 	WebMasterNote + '<br>')
	if ( WebMasterName != '' ) {
		document.write ( WebMasterName )
		if ( WebMasterEmail != '' ) 
			document.write ( ' (<a href="mailto:' + WebMasterEmail + '">' + WebMasterEmail + '</a>)<br>')
	}
	document.write ( d.getDate() + " " + MonthSt[d.getMonth()] + " " + (year+543) )
	document.write ('</font>')
	document.write ('</td></tr></table>')
}

function PrintChainLink( PreviousURL, PreviousTitle, NextURL, NextTitle)
{
	document.write ('<table width=760 cellspacing=0 cellpadding=10 border=0 bgcolor=#ffffff><tr><td width=300></td><td width=460>')
	document.write ('<font size=1 face="ms sans serif"><b>')
	if ( PreviousTitle != '') 
		document.write ('<a href="' + PreviousURL + '">&lt;&lt; ' + PreviousTitle + '</a> | ')
	if ( NextTitle != '' )
		document.write ('| <a href="' + NextURL + '">' + NextTitle + ' &gt;&gt;</a>')
	document.write ('</b></font>')
	document.write ('</td></tr></table>')
}

function PrintAboutAuthor( AuthorName )
{
	if ( AuthorName != '' ) {
		
	}
}

function PrintPicture(PictureFile, ThumbFile, Caption, PictureToolTip, VideoFile, VideoToolTip, SoundFile, SoundToolTip)
{
	document.write ('<table width=100% border=0><tr><td align=center>')
	document.write ('<table><tr><td valign=top>')
	if ( ThumbFile != '' ) 
		// no thumb, print the bigpicture without link
		document.write ('<a href="' + PictureFile + '"><img border=0 alt="' + PictureToolTip + '" src="' + ThumbFile + '"></a>')
	else if ( PictureFile != '' )
		document.write ('<img border=0 src="' + PictureFile + '">')
	document.write('</td><td valign=bottom>')
	if ( VideoFile != '' ) 
		document.write ('<br><a href="' + VideoFile + '"><img border=0 vspace=1 alt="' + VideoToolTip + '" src="../17x17_movie.gif"></a>')
	if ( ThumbFile != '' )
		document.write ('<br><a href="' + PictureFile + '"><img border=0 alt="' + PictureToolTip + '" vspace=1 src="../17x17_magnify.gif"></a>')
	if ( SoundFile != '' )
		document.write ('<br><a href="' + SoundFile + '"><img border=0 alt="' + SoundToolTip + '" vspace=1 src="../17x17_speaker.gif"></a>')
	document.write ('</td></tr></table></td></tr>')
	document.write ('<tr><td align=center><font  color=#000080 face="ms sans serif">')
	document.write ( Caption + '</font></td></tr></table><br><br>')
}

