function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var time=new Date();
var hours = time.getHours();
var minutes = time.getMinutes();
var seconds = time.getSeconds();


 function LastUpdate(){
 	//document.write('<font face=\"MS Sans Serif\">Last Update : 27 January, 2003</font>');
	Display_Date();
	document.write('<span id=oTimer></span>');
	clock();
}

function Display_Date() {
		var months=new Array(13);
		months[1]="มกราคม";
		months[2]="กุมภาพันธ์";
		months[3]="มีนาคม";
		months[4]="เมษายน";
		months[5]="พฤษภาคม";
		months[6]="มิถุนายน";
		months[7]="กรกฎาคม";
		months[8]="สิงหาคม";
		months[9]="กันยายน";
		months[10]="ตุลาคม";
		months[11]="พฤศจิกายน";
		months[12]="ธันวาคม";
		var amOrPm = "am.";
		var lmonth=months[time.getMonth() + 1];
		var date=time.getDate();
		var year=time.getYear();
		//if (year < 2000)    
		year = year + 543; 
		//year = year + 1900; 
		//if (hours > 11) amOrPm = "pm.";
		//if (hours > 12) hours = hours - 12;
		//if (hours == 0) hours = 12;
		//if (minutes <= 9) minutes = "0" + minutes;
		//if (seconds <= 9) seconds = "0" + seconds;


		document.write( date + " ");
		//document.write(date + ", " + year + "  &nbsp;"+hours + ":" + minutes + ":" + seconds + " " + amOrPm);
		document.write( lmonth + "  " + year + "  &nbsp;");
		
}

function addZero(n){
	if (parseInt(n) < 10) {
		return n = "0" + n;
	}
  else {
		return n;
	}
}

function clock()
{

	seconds += parseInt(1);
	if(seconds == 60) {
		minutes += parseInt(1);
		seconds = 0;
	}

	if(minutes  == 60){
		hours += parseInt(1);
		minutes  = 0;
	}

	if(hours == 24)
		hours = 0;

             if(document.all){
    	   myTimer = document.all["oTimer"]
             }else if(!document.all && document.getElementById){
 	  myTimer = document.getElementById("oTimer")
             }


	myTimer.innerHTML = addZero(hours) + ":" + addZero(minutes) + " น.";
	//myTimer.innerHTML = addZero(hours) + ":" + addZero(minutes) + ":" + addZero(seconds);
	window.setTimeout("clock()", 1000);
}



//-------------------------------------------------------------- Footer ------------------------------------------------------------------------
function Footer()
{
document.write("<table width=\"780\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
document.write("<td width=\"6\" background=\"../images/02_home/chado_left.gif\"><img src=\"../images/02_home/chado_left.gif\" width=\"6\" height=\"1\"></td>");
document.write("<td width=\"180\" valign=\"top\" bgcolor=\"#FFFFFF\"><br> <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">");
document.write("<tr><td class=\"txt_green\"><font color=\"#5A5B80\"><a href=\"contact.php\" class=\"lnkG\"><font color=\"#5A5B80\">ติดต่อลงโฆษณา  / ผู้ดูแลเว็บ</font></a><br>บริษัท แอดเวนเจอร์ แพลนเน็ต จำกัด<br> 137 ซ.ลาดพร้าว107 ถ.ลาดพร้าว <br> แขวงคลองจั่น เขตบางกะปิ กรุงเทพฯ</font></td></tr></table></td>");
document.write("<td width=\"5\" valign=\"bottom\" background=\"../images/02_home/dot_bottom_left.gif\"><img src=\"../images/02_home/dot_bottom_left.gif\" width=\"5\" height=\"3\"></td><td valign=\"top\" bgcolor=\"#FFFFFF\"><br><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><tr class=\"txt_black\"> ");
document.write("<td width=\"90\"><a href=\"#\" class=\"lnkBk\">หน้าแรก</a></td><td width=\"4\">:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">กิจกรรมข่าวสาร</a> | <a href=\"#\" class=\"lnkfooter\">สมัครสมาชิก</a> | <a href=\"#\" class=\"lnkfooter\">ลิ้งค์เพื่อนบ้าน</a> | <a href=\"#\" class=\"lnkfooter\">ผู้สนับสนุน</a> | <a href=\"#\" class=\"lnkfooter\">รวม Intro</a> | <a href=\"#\" class=\"lnkfooter\">รู้จักทีมงาน</a> | <a href=\"#\" class=\"lnkfooter\">ติดต่อทีมไฮเปอร์</a></td></tr><tr class=\"txt_black\">");
document.write("<td><a href=\"#\" class=\"lnkBk\">แมกกาซีน</a></td><td>:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">สำรวจถ้ำ</a> | <a href=\"#\" class=\"lnkfooter\">แบกเป้เดินป่า</a> | <a href=\"#\" class=\"lnkfooter\">ปีนผาพิชิตใจ</a> | <a href=\"#\" class=\"lnkfooter\">จับพายเล่นคายัค</a></td></tr><tr class=\"txt_black\">");
document.write("<td><a href=\"#\" class=\"lnkBk\">กิจกรรม</a></td><td>:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">ทริปสำรวจ</a> | <a href=\"#\" class=\"lnkfooter\">ทริปที่ผ่านมา</a> | <a href=\"#\" class=\"lnkfooter\">จัดทริปให้เที่ยว</a> | <a href=\"#\" class=\"lnkfooter\">เปิดคอร์สสอน Adventure</a> | <a href=\"#\" class=\"lnkfooter\">เทคนิคจากไฮเปอร์</a></td></tr><tr class=\"txt_black\">");
document.write("<td><a href=\"#\" class=\"lnkBk\">รวมบอร์ด</a></td><td>:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">รวมสนธนา</a> | <a href=\"#\" class=\"lnkfooter\">พูดคุยเรื่องถ้ำ</a> | <a href=\"#\" class=\"lnkfooter\">พูดคุยเรื่องเดินป่า</a> | <a href=\"#\" class=\"lnkfooter\">พูดคุยเรื่องปีนผา</a> | <a href=\"#\" class=\"lnkfooter\">พูดคุยเรื่องคายัค</a></td></tr><tr class=\"txt_black\">");
document.write("<td> <a href=\"#\" class=\"lnkBk\">Shop ไฮเปอร์</a></td><td>:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">แนะนำอุปกรณ์</a> | <a href=\"#\" class=\"lnkfooter\">ไฮเปอร์ Sale</a> | <a href=\"#\" class=\"lnkfooter\">ตลาดซื้อขาย</a> | <a href=\"#\" class=\"lnkfooter\">อุปกรณ์ให้เช่า</a> | <a href=\"#\" class=\"lnkfooter\">ของที่ระลึกจากไฮเปอร์</a></td></tr><tr class=\"txt_black\">");
document.write("<td><a href=\"#\" class=\"lnkBk\">ไฮเปอร์ออแกไนซ์</a></td><td>:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">บริการหน้าผาให้เช่า</a></tr><tr class=\"txt_black\">");
document.write("<td><a href=\"#\" class=\"lnkBk\">ศูนย์รวมดีๆ ที่นี่</a></td><td>:</td><td class=\"lnkfooter\"><a href=\"#\" class=\"lnkfooter\">รวมแหล่งปีนผา</a> | <a href=\"#\" class=\"lnkfooter\">รวมร้านขายอุปกรณ์</a> | <a href=\"#\" class=\"lnkfooter\">ที่พัก โรงแรม รีสอร์ท</a> | <a href=\"#\" class=\"lnkfooter\">เที่ยวไปกินไป</a></td>");
document.write("</tr></table><br></td><td width=\"6\" background=\"../images/02_home/chado_right.gif\"><img src=\"../images/02_home/chado_right.gif\" width=\"6\" height=\"1\"></td></tr></table>");
document.write("<table width=\"780\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
document.write("<td width=\"6\" background=\"../images/02_home/chado_left.gif\"><img src=\"../images/02_home/chado_left.gif\" width=\"6\" height=\"1\"></td>");
document.write("<td height=\"34\" align=\"center\" background=\"../images/02_home/bg_reg.gif\" bgcolor=\"#FFFFFF\" class=\"txt_white\">Copyright ");
document.write("<font size=\"2\">&copy;</font> 2004 by Adventure Planet. All rights reserved.</td>");
document.write("<td width=\"6\" background=\"../images/02_home/chado_right.gif\"><img src=\"../images/02_home/chado_right.gif\" width=\"6\" height=\"1\"></td></tr></table>");
}


//--------------------------------------------------------------- Header ------------------------------------------------------------------------


path = '';

function TopMenu(level,mainlink){

if (level == 0)	path = "";
else if (level == 1) path = "../";
else if (level == 2) path = "../../";

//About
 if (mainlink==1){
    strAbout="<td><img src=\""+path+"images/home/nav/01_l.gif\" alt=\"รู้จักกับเอเปค\" name=\"Image1\" width=\"150\" height=\"20\" border=\"0\" id=\"Image1\" onMouseOver=\"hide('menu1');hide('menu2');hide('menu3')\"></td>";
}else{
    strAbout="<td><a href=\""+path+"about/aboutapec_inbrief.html\" onMouseOver=\"MM_swapImage('Image1','','"+path+"images/home/nav/01_l.gif',1);show('menu1');hide('menu2');hide('menu3');\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+path+"images/home/nav/01_d.gif\" alt=\"รู้จักกับเอเปค\" name=\"Image1\" width=\"150\" height=\"20\" border=\"0\" id=\"Image1\" ></a></td>";
}

//APEC 2003 in Thailand
 if (mainlink==2){
    strThailand="<td><a href=\""+path+"apecthai/apec2003thailand.html\" onMouseOver=\"MM_swapImage('Image2','','"+path+"images/home/nav/02_l.gif',1);hide('menu1');hide('menu2');hide('menu3')\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+path+"images/home/nav/02_l.gif\" alt=\"ประเทศไทยกับเอเปค\" name=\"Image2\" width=\"150\" height=\"20\" border=\"0\" id=\"Image2\"></a></td>";
}else{
    strThailand="<td><a href=\""+path+"apecthai/apec2003thailand.html\" onMouseOver=\"MM_swapImage('Image2','','"+path+"images/home/nav/02_l.gif',1);hide('menu1');show('menu2');hide('menu3');\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+path+"images/home/nav/02_d.gif\" alt=\"ประเทศไทยกับเอเปค\" name=\"Image2\" width=\"150\" height=\"20\" border=\"0\" id=\"Image2\"></a></td>";
}

//Announcements
 if (mainlink==3){
    strAnnouncements="<td><img src=\""+path+"images/home/nav/03_l.gif\" alt=\"ข่าวสารเอเปค\" name=\"Image3\" width=\"150\" height=\"20\" border=\"0\" id=\"Image3\" onMouseOver=\"hide('menu1');hide('menu2');hide('menu3')\"></td>";
}else{
    strAnnouncements="<td><a href=\""+path+"announcements/announcements_news.html\" onMouseOver=\"MM_swapImage('Image3','','"+path+"images/home/nav/03_l.gif',1);hide('menu1');hide('menu2');show('menu3');\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+path+"images/home/nav/03_d.gif\" alt=\"Announcements\" name=\"Image3\" width=\"150\" height=\"20\" border=\"0\" id=\"Image3\"></a></td>";
  // strAnnouncements="<td><a href=\"#\" onMouseOver=\"MM_swapImage('Image3','','"+path+"images/home/nav/03_l.gif',1);hide('menu1');hide('menu2');show('menu3');\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+path+"images/home/nav/03_d.gif\" alt=\"ข่าวสารเอเปค\" name=\"Image3\" width=\"150\" height=\"20\" border=\"0\" id=\"Image3\"></a></td>";
}

//Schedule & Venues
 if (mainlink==4){
    strSchedule="<td><img src=\""+path+"images/home/nav/04_l.gif\" alt=\"ตารางการประชุม\" name=\"Image4\" width=\"150\" height=\"20\" border=\"0\" id=\"Image4\" onMouseOver=\"hide('menu1');hide('menu2');hide('menu3')\"></td>";
}else{
    strSchedule="<td><a href=\""+path+"schedule/schedule.html\" onMouseOver=\"MM_swapImage('Image4','','"+path+"images/home/nav/04_l.gif',1); hide('menu1');hide('menu2');hide('menu3')\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+path+"images/home/nav/04_d.gif\" alt=\"ตารางการประชุม\" name=\"Image4\" width=\"150\" height=\"20\" border=\"0\" id=\"Image4\"></a></td>";
}

strTop1="<table width=\"780\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr>"; 
strTop2="<td width=\"6\" background=\"../images/02_home/chado_left.gif\"><img src=\"../images/02_home/chado_left.gif\" width=\"6\" height=\"1\"></td>";
strTop3="<td width=\"768\" background=\"../images/02_home/bg_top.jpg\"><img src=\"../images/02_home/logo.gif\" width=\"281\" height=\"68\"></td>";
strTop4="<td width=\"6\" background=\"../images/02_home/chado_right.gif\"><img src=\"../images/02_home/chado_right.gif\" width=\"6\" height=\"1\"></td></tr></table>";
strTop5="<table width=\"780\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
strTop6="<td width=\"6\" background=\"../images/02_home/chado_left.gif\"><img src=\"../images/02_home/chado_left.gif\" width=\"6\" height=\"1\"></td>";
strTop7="<td width=\"768\" align=\"right\" background=\"../images/02_home/bg_bar_ml.gif\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr> ";

strTop2="<td width=\"180\" rowspan=\"2\" valign=\"top\"><a href=\""+path+"index.html\" onMouseOver=\"hide('menu1');hide('menu2');hide('menu3')\"><img src=\""+path+"images/home/logo.gif\" alt=\"APEC Thailand 2003\" width=\"180\" height=\"80\" border=\"0\"></a></td>";
strTop3="<td align=\"right\" valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
strTop4="<tr align=\"center\" class=\"lnktopmenu\">";
//strTop5="<td><a href=\""+path+"exploring/exploring.html\" class=\"lnktopmenu\">Exploring Thailand</a></td>";
//strTop6="<td><span class=\"lnktopmenu\">|</span></td>";
strTop7="<td><a href=\""+path+"usefullinks/usefullinks.html\" class=\"lnktopmenu\">เว็บไซต์ที่เกี่ยวข้อง</a></td>";
strTop8="<td><span class=\"lnktopmenu\">|</span></td>";
strTop9="<td><a href=\""+path+"contactus/contactus.html\" class=\"lnktopmenu\">ติดต่อกับเรา</a></td>";
strTop10="<td><span class=\"lnktopmenu\">|</span></td>";
strTop11="<td><a href=\""+path+"sitemap/sitemap.html\" class=\"lnktopmenu\">แผนผังเว็บไซต์</a></td>";
strTop12="<td><span class=\"lnktopmenu\">|</span></td>";
strTop13="<td><a href=\"../../eng/index.html\" class=\"lnktopmenu\">Eng</a><span class=\"lnktopmenu\"> / Thai</span></td>";
strTop14="</tr></table></td></tr><tr><td valign=\"bottom\"><br>";
strTop15="<table width=\"600\" height=\"10\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" onMouseOver=\"hide('menu1');hide('menu2');hide('menu3')\"><tr>";
strTop16="<td align=\"left\"><span class=\"txtdate\">";
strTop19="</tr></table></td></tr></table>";

strFinal="";


//strFinal=strTop1+strTop2+strTop3+strTop4+strTop5+strTop6+strTop7+strTop8+strTop9+strTop10+strTop11+strTop12+strTop13+strTop14+strTop15+strTop16;
strFinal=strTop1+strTop2+strTop3+strTop4+strTop7+strTop8+strTop9+strTop10+strTop11+strTop12+strTop13+strTop14+strTop15+strTop16;

document.write(strFinal);
}