﻿//------------------ Detect language --------------------
var nowURL = document.URL;
var thURL = nowURL.replace('/en/','/th/');
var enURL = nowURL.replace('/th/','/en/');

//------------------ Init Text Size--------------------
// setDefaults arguments: size unit, default size, minimum, maximum
// optional array of elements or selectors to apply these defaults to
dw_fontSizerDX.setDefaults("px", 13, 9, 26, ['td.text'] );
//dw_fontSizerDX.setDefaults( "px", 13, 9, 26, ['body', 'td', 'div', 'p', 'font'] );
dw_Event.add( window, 'load', dw_fontSizerDX.init );

//------------------Contents for menu_unit------------------
var menu_unit=new Array()
menu_unit[0]='<a href="unit.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'imgSaransita\',\'\',\'images/m_p1_en.gif\',1)"><img src="images/m_p1_en.gif" alt="Phase1" name="imgSaransita" width="118" height="18" border="0" id="imgSaransita" /></a>'
menu_unit[1]='<a href="unit_p2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'imgSaranphaka\',\'\',\'images/m_p2_en.gif\',1)"><img src="images/m_p2_en.gif" alt="phase2" name="imgSaranphakaa" width="118" height="18" border="0" id="imgSaranphaka" /></a>'
//menu_unit[2]='<a href="buraladda.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'imgSarankanda\',\'\',\'images/m_ladda_th.gif\',1)"><img src="images/m_ladda_th.gif" alt="Buraladda" name="imgSarankanda" width="118" height="18" border="0" id="imgSarankanda" /></a>'
//menu_unit[3]='<a href="buramaya.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'imgSaranyada\',\'\',\'images/m_maya_th.gif\',1)"><img src="images/m_maya_th.gif" alt="Buramaya" name="imgSaranyada" width="118" height="18" border="0" id="imgSaranyada" /></a>'

var menuwidth='122px' //default menu width
//var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?


//------------------Page Elements---------------------
function header(section) {
	document.write('<table width="952" border="0" align="center" cellpadding="0" cellspacing="0" id="Header">');
	document.write('<tr><td height="22"></td></tr>');
	writeTitle(); // Logo and options
	document.write('<tr><td height="17"></td></tr>');
	writeMainImage(section); // Main image of page
	writeMenu(section); // Main menu
	document.write('</table>');
}

function writeTitle() {
	document.write('<tr><td>');
	
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
	document.write('<td width="12"></td>');
	document.write('<td width="152"><a href="index.html"><img src="images/logo_bnp.gif" alt="บุราสิริ งามวงศ์วาน-ประชาชื่น" width="132" height="73" border="0" /></a></td>');
	document.write('<td><img src="images/title_bnp.gif" alt="บุราสิริ งามวงศ์วาน-ประชาชื่น" width="564" height="74" />');
		// Options
	document.write('<td><table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td align="right"><a href="/th" target="_blank"><img src="images/ic_sansiri.gif" alt="Sansiri PCL. Call 1685" width="75" height="17" border="0" /></a></td></tr>'); // Sansiri Logo
	document.write('<tr><td height="40" align="right"><table width="100" border="0" cellspacing="0" cellpadding="0"><tr>');
	document.write('<td><img src="images/txt_showth.gif" alt="Change to English" width="88" height="14" /></td>');
	document.write('<td><a href="' + thURL + '"><img src="images/ic_th.gif" alt="เปลี่ยนเป็นภาษาไทย" width="24" height="14" border="0" /></a></td>');
	document.write('</tr></table></td></tr>');

	document.write('<tr><td align="right">');
	document.write('<div id="sizer"><table border="0" cellspacing="0" cellpadding="0"><tr>');
	document.write('<td align="right" class="changesize">Text size</td>');
	document.write('<td width="37" align="right"><a class="decrease" href="#"><img src="images/ic_fontdec.gif" alt="Decrease text size" width="31" height="13" border="0" /></a></td>');
	document.write('<td width="37" align="right"><a class="increase" href="#"><img src="images/ic_fontinc.gif" alt="Increase text size" width="31" height="13" border="0" /></a></td>');
	document.write('</tr></table></div>');
	document.write('</td></tr>');
	document.write('</table></td>');
		// ------
	document.write('</tr></table>');
	
	document.write('</td></tr>');
}

function writeMainImage(section) {
	document.write('<tr><td>');
	switch(section) {
		case "info" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			break;
		case "unit" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/unit_info.swf',952,379);
			break;
		case "ready" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/unit_info.swf',952,379);
			break;
		case "burakanda" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/burakanda.swf',952,379);
			break;
		case "burayada" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/burayada.swf',952,379);
			break;
		case "buraladda" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/buraladda.swf',952,379);
			break;
		case "buramaya" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/buramaya.swf',952,379);
			break;
		case "activity" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/contact.swf',952,379);
			break;	
		case "contact" :
		document.write('<img src="images/bnp.jpg" width="724" height="345">');
			document.write('<img src="images/bnp_promotion_en.gif" width="228" height="345">');
			//document.write('images/flashbanner.swf',952,345);
			//document.write('images/contact.swf',952,379);
			break;
	}

	document.write('</td></tr>');
}

function writeMenu(section) {
	var menusection = section;
	if ((section=='burakanda')||(section=='burayada')||(section=='buraladda')||(section=='buramaya')) {
		menusection = 'unit';
	}
	document.write('<tr><td>');
	document.write('<table width="100%" border="0" background="images/bg_menu.gif" cellpadding="0" cellspacing="0">');
	document.write('<tr><td>');
	document.write('<table width="450" border="0" align="center" cellpadding="0" cellspacing="0"><tr valign="top">');
	document.write('<td><a href="index.html"><img src="images/m_info'+ ((menusection=='info')?'2':'1')+'.gif" alt="Project Information" width="150" height="35" /></a></td>');
	writeMenubar(); // bar
	document.write('<td><a href="unit.html"><img src="images/m_housetype'+ ((menusection=='unit')?'2':'1')+'.gif" alt="House Type" width="139" height="35" border="0" onMouseover="dropdownmenu(this, event, menu_unit, \'150px\')" onMouseout="delayhidemenu()" /></a></td>');
	writeMenubar(); // bar
	document.write('<td><a href="http://instantliving.sansiri.com/default.aspx?project=57"><img src="images/m_ready'+ ((menusection=='ready')?'2':'1')+'.gif" alt="Ready to Move in" width="187" height="35" /></a></td>');
	writeMenubar(); // bar
	document.write('<td><a href="/th/project/burasiri/ngamwongwan_prachachuen/360tour/clubhouse/index_en.html" target="_blank"><img src="images/m_virtualtour'+ ((menusection=='vrtour')?'2':'1')+'.gif" alt="Virtual Tour" width="147" height="35" /></a></td>');
	writeMenubar(); // bar
	document.write('<td><a href="activity.html"><img src="images/m_activity'+ ((menusection=='activity')?'2':'1')+'.gif" alt="Activity" width="120" height="35" /></a></td>');
	writeMenubar(); // bar
	document.write('<td><a href="contact.html"><img src="images/m_contact'+ ((menusection=='contact')?'2':'1')+'.gif" alt="Contact us" width="129" height="35" /></a></td>');
	document.write('</tr></table>');
	document.write('</td></tr>');
	document.write('</table>');
	document.write('</td></tr>');
}

function writeMenubar() {
	document.write('<td><img src="images/line.gif" width="3" height="35" border="0" /></td>');
}

function footer() {
	document.write('<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="Footer">');
	document.write('<tr><td height="50"></td></tr>');
	writeGraphicRemark()
	document.write('<tr><td align="center"><span class="copyright"><a href="/en" target="_blank" class="link_homepage">Go to main page www.sansiri.com</a>&nbsp;::&nbsp;Copyright&copy; Copyright&copy; 2009. Sansiri Public Co., Ltd. All right reserved. One of quality projects of <img src="images/logo_saransiri.gif" width="49" height="27" border="0" align="absmiddle" /></span></td></tr>');
	document.write('<tr><td height="10" >');
	counter();
	document.write('</td></tr>');
	document.write('</table>');
}
function writeGraphicRemark() {
    var return_txt = '<tr><td height="25" valign="top"></td></tr>\n\
    <tr><td align="center" valign="top" class="copyright"><span style="font: 9px Verdana">Featured photography on website  consists of photography on location, photography on location with simulated atmosphere and simulated graphic.<br>Should you have any questions regarding any photography, please contact our customer service staffs or visit our projects\' site. Call 1685.</span></td></tr>\n\
<tr><td height=10></td></tr>';
    document.write(return_txt);
}

function counter()
{
	document.write('<script language="javascript" src="/scripts/googleAnalytics.js"></script>');
	document.write('<script language="javascript" src="/scripts/adword.js"></script>');	
	/*document.write('<script language="javascript" src="/include/sansiri_tag.js"></script>');*/
	/*document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');*/
	/*document.write('<script language="javascript" src="/include/adword.js"></script>');*/
}
<!---->
