function selectway(itemID) {
	itmID = document.getElementById(itemID);
	
	if (itmID.style.display == 'none') {
		itmID.style.display = "";
	}
	else {
		itmID.style.display = "none";
	}
}

function showalt(msg){
	itmID = document.getElementById('imgalt');
	
	if( msg != '' ){
		document.all["imgalt"].innerHTML = '<strong>' + msg + '</strong>';	
		itmID.style.display = '';
	}
	else{
		document.all["imgalt"].innerHTML = '<strong>' + msg + '</strong>';	
		itmID.style.display = 'none';
	}
}

function openMap(itemID){
	if(itemID == "phuket-map"){
		itemID = document.getElementById('phuket-map');
		itemID.style.display = '';
		itemID = document.getElementById('bangkok-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('pattaya-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('samui-map');
		itemID.style.display = 'none';
	}
	else if(itemID == "bangkok-map"){
		itemID = document.getElementById('phuket-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('bangkok-map');
		itemID.style.display = '';
		itemID = document.getElementById('pattaya-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('samui-map');
		itemID.style.display = 'none';
	}
	else if(itemID == "pattaya-map"){
		itemID = document.getElementById('phuket-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('bangkok-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('pattaya-map');
		itemID.style.display = '';
		itemID = document.getElementById('samui-map');
		itemID.style.display = 'none';
	}
	else if(itemID == "samui-map"){
		itemID = document.getElementById('phuket-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('bangkok-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('pattaya-map');
		itemID.style.display = 'none';
		itemID = document.getElementById('samui-map');
		itemID.style.display = '';
	}	
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/***********************************************
This v1.51
***********************************************/
 
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["images/preview/01.jpg", "", ""]
fadeimages[1]=["images/preview/02.jpg", "", ""]
fadeimages[2]=["images/preview/03.jpg", "", ""]
fadeimages[3]=["images/preview/04.jpg", "", ""]
fadeimages[4]=["images/preview/06.jpg", "", ""]
fadeimages[5]=["images/preview/07.jpg", "", ""]
fadeimages[6]=["images/preview/08.jpg", "", ""]
fadeimages[7]=["images/preview/09.jpg", "", ""]
fadeimages[8]=["images/preview/10.jpg", "", ""]
fadeimages[9]=["images/preview/11.jpg", "", ""]
fadeimages[10]=["images/preview/13.jpg", "", ""]
fadeimages[11]=["images/preview/15.jpg", "", ""]
fadeimages[12]=["images/preview/16.jpg", "", ""]
fadeimages[13]=["images/preview/17.jpg", "", ""]
fadeimages[14]=["images/preview/20090807_01.jpg", "", ""]
fadeimages[15]=["images/preview/20090807_02.jpg", "", ""]
//fadeimages[16]=["images/preview/20090807_03.jpg", "", ""]
fadeimages[16]=["images/preview/20090807_04.jpg", "", ""]
fadeimages[17]=["images/preview/20090807_05.jpg", "", ""]
fadeimages[18]=["images/preview/20090807_06.jpg", "", ""]
//fadeimages[20]=["images/preview/20090807_07.jpg", "", ""]
fadeimages[19]=["images/preview/20090815_01.jpg", "", ""]
fadeimages[20]=["images/preview/20090823_01.jpg", "", ""]
fadeimages[21]=["images/preview/20090823_02.jpg", "", ""]
fadeimages[22]=["images/preview/new01.jpg", "", ""]
fadeimages[23]=["images/preview/new02.jpg", "", ""]
fadeimages[24]=["images/preview/new03.jpg", "", ""]
fadeimages[25]=["images/preview/new04.jpg", "", ""]

var fadeimages2=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["images/about/team/01.jpg", "", ""]
fadeimages2[1]=["images/about/team/02.jpg", "", ""]
fadeimages2[2]=["images/about/team/03.jpg", "", ""]
fadeimages2[3]=["images/about/team/04.jpg", "", ""]
fadeimages2[4]=["images/about/team/05.jpg", "", ""]
fadeimages2[5]=["images/about/team/06.jpg", "", ""]
fadeimages2[6]=["images/about/team/07.jpg", "", ""]
fadeimages2[7]=["images/about/team/08.jpg", "", ""]
fadeimages2[8]=["images/about/team/09.jpg", "", ""]
fadeimages2[9]=["images/about/team/10.jpg", "", ""]
fadeimages2[10]=["images/about/team/new1.jpg", "", ""]
fadeimages2[11]=["images/about/team/11.jpg", "", ""]
fadeimages2[12]=["images/about/team/12.jpg", "", ""]
fadeimages2[13]=["images/about/team/13.jpg", "", ""]
fadeimages2[14]=["images/about/team/14.jpg", "", ""]
fadeimages2[15]=["images/about/team/new2.jpg", "", ""]

var fadeimages3=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages3[0]=["images/services/01.jpg", "", ""]
fadeimages3[1]=["images/services/02.jpg", "", ""]
fadeimages3[2]=["images/services/03.jpg", "", ""]
fadeimages3[3]=["images/services/04.jpg", "", ""]
fadeimages3[4]=["images/services/05.jpg", "", ""]
fadeimages3[5]=["images/services/06.jpg", "", ""]
fadeimages3[6]=["images/services/07.jpg", "", ""]
fadeimages3[7]=["images/services/08.jpg", "", ""]
fadeimages3[8]=["images/services/09.jpg", "", ""]
fadeimages3[9]=["images/services/10.jpg", "", ""]
fadeimages3[10]=["images/services/12.jpg", "", ""]
fadeimages3[11]=["images/services/13.jpg", "", ""]
fadeimages3[12]=["images/services/14.jpg", "", ""]
fadeimages3[13]=["images/services/15.jpg", "", ""]
fadeimages3[14]=["images/services/16.jpg", "", ""]
fadeimages3[15]=["images/services/17.jpg", "", ""]
fadeimages3[16]=["images/services/18.jpg", "", ""]
fadeimages3[17]=["images/services/19.jpg", "", ""]
fadeimages3[18]=["images/services/20.jpg", "", ""]

var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

//Disable right click script III
// var message="";
///////////////////////////////////
// function clickIE() {if (document.all) {(message);return false;}}
// function clickNS(e) {if 
// (document.layers||(document.getElementById&&!document.all)) {
// if (e.which==2||e.which==3) {(message);return false;}}}
// if (document.layers) 
// {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
// else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

// document.oncontextmenu=new Function("return false")

///////////// Thumb Gallery /////////////////////////
var thumbgallery={
enableTitle: true, //Should "title" attribute of link be used as description?
enableTransition: true, //Enable fading transition in IE?
hideimgmouseout: false, //Hide enlarged image when mouse moves out of anchor link? (if enlarged image is hyperlinked, always set to false!)

/////////////No need to edit beyond here/////////////////////////

iefilterstring: 'progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)', //IE specific multimedia filter string
iefiltercapable: document.compatMode && window.createPopup? true : false, //Detect browser support for IE filters
preloadedimages:[], //array to preload enlarged images (ones set to display "onmouseover"
targetlinks:[], //array to hold participating links (those with rel="enlargeimage:initType")
alreadyrunflag: false, //flag to indicate whether init() function has been run already come window.onload

loadimage:function(linkobj){
var imagepath=linkobj.getAttribute("href") //Get URL to enlarged image
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
var dest=linkobj.getAttribute("rev").split("::")[1] //Get URL enlarged image should be linked to, if any
var description=(thumbgallery.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr
var imageHTML='<img src="'+imagepath+'" style="border-width: 0" />' //Construct HTML for enlarged image
if (typeof dest!="undefined") //Hyperlink the enlarged image?
imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
if (description!="") //Use title attr of the link as description?
imageHTML+='<br />'+description
if (this.iefiltercapable){ //Is this an IE browser that supports filters?
showcontainer.style.filter=this.iefilterstring
showcontainer.filters[0].Apply()
}
showcontainer.innerHTML=imageHTML
this.featureImage=showcontainer.getElementsByTagName("img")[0] //Reference enlarged image itself
this.featureImage.onload=function(){ //When enlarged image has completely loaded
if (thumbgallery.iefiltercapable) //Is this an IE browser that supports filters?
showcontainer.filters[0].Play()
}
this.featureImage.onerror=function(){ //If an error has occurred while loading the image to show
if (thumbgallery.iefiltercapable) //Is this an IE browser that supports filters?
showcontainer.filters[0].Stop()
}
},

hideimage:function(linkobj){
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
showcontainer.innerHTML=""
},


cleanup:function(){ //Clean up routine on page unload
if (this.featureImage){this.featureImage.onload=null; this.featureImage.onerror=null; this.featureImage=null}
this.showcontainer=null
for (var i=0; i<this.targetlinks.length; i++){
this.targetlinks[i].onclick=null
this.targetlinks[i].onmouseover=null
this.targetlinks[i].onmouseout=null
}
},

addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){ //Initialize thumbnail viewer script
this.iefiltercapable=(this.iefiltercapable && this.enableTransition) //True or false: IE filters supported and is enabled by user
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){ //BEGIN FOR LOOP
if (pagelinks[i].getAttribute("rel") && /enlargeimage:/i.test(pagelinks[i].getAttribute("rel"))){ //Begin if statement: Test for rel="enlargeimage"
var initType=pagelinks[i].getAttribute("rel").split("::")[1] //Get display type of enlarged image ("click" or "mouseover")
if (initType=="mouseover"){ //If type is "mouseover", preload the enlarged image for quicker display
this.preloadedimages[this.preloadedimages.length]=new Image()
this.preloadedimages[this.preloadedimages.length-1].src=pagelinks[i].href
pagelinks[i]["onclick"]=function(){ //Cancel default click action
return false
}
}
pagelinks[i]["on"+initType]=function(){ //Load enlarged image based on the specified display type (event)
thumbgallery.loadimage(this) //Load image
return false
}
if (this.hideimgmouseout)
pagelinks[i]["onmouseout"]=function(){
thumbgallery.hideimage(this)
}
this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link
} //end if statement
} //END FOR LOOP


} //END init() function

}


if (document.addEventListener) //Take advantage of "DOMContentLoaded" event in select Mozilla/ Opera browsers for faster init
thumbgallery.addEvent(document, function(){thumbgallery.alreadyrunflag=1; thumbgallery.init()}, "DOMContentLoaded") //Initialize script on page load
else if (document.all && document.getElementsByTagName("a").length>0){ //Take advantage of "defer" attr inside SCRIPT tag in IE for instant init
thumbgallery.alreadyrunflag=1
thumbgallery.init()
}
thumbgallery.addEvent(window, function(){if (!thumbgallery.alreadyrunflag) thumbgallery.init()}, "load") //Default init method: window.onload
thumbgallery.addEvent(window, function(){thumbgallery.cleanup()}, "unload")