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/20110214/20110214_01.jpg", "", ""]
fadeimages[1]=["images/preview/20110214/20110214_02.jpg", "", ""]
fadeimages[2]=["images/preview/20110214/20110214_03.jpg", "", ""]
fadeimages[3]=["images/preview/20110214/20110214_04.jpg", "", ""]
//fadeimages[4]=["images/preview/20110214/20110214_05.jpg", "", ""]
fadeimages[5]=["images/preview/20110214/20110214_06.jpg", "", ""]
fadeimages[6]=["images/preview/20110214/20110214_07.jpg", "", ""]
fadeimages[7]=["images/preview/20110214/20110214_08.jpg", "", ""]
fadeimages[8]=["images/preview/20110214/20110214_09.jpg", "", ""]
fadeimages[9]=["images/preview/20110214/20110214_10.jpg", "", ""]
//fadeimages[10]=["images/preview/20110214/20110214_11.jpg", "", ""]
fadeimages[11]=["images/preview/20110214/20110214_12.jpg", "", ""]
fadeimages[12]=["images/preview/20110214/20110214_13.jpg", "", ""]
fadeimages[13]=["images/preview/20110214/20110214_14.jpg", "", ""]
fadeimages[14]=["images/preview/20110214/20110214_16.jpg", "", ""]
fadeimages[15]=["images/preview/20110214/20110214_17.jpg", "", ""]
fadeimages[16]=["images/preview/20110214/20110214_18.jpg", "", ""]
fadeimages[17]=["images/preview/20110214/20110214_19.jpg", "", ""]
fadeimages[18]=["images/preview/20110214/20110214_20.jpg", "", ""]
fadeimages[19]=["images/preview/20110214/20110214_21.jpg", "", ""]
fadeimages[20]=["images/preview/20110214/20110214_22.jpg", "", ""]
fadeimages[21]=["images/preview/20110214/20110214_23.jpg", "", ""]
fadeimages[22]=["images/preview/20110214/20110214_24.jpg", "", ""]
fadeimages[23]=["images/preview/20110214/20110214_25.jpg", "", ""]
fadeimages[24]=["images/preview/20110214/20110214_26.jpg", "", ""]
fadeimages[25]=["images/preview/20110214/20110214_27.jpg", "", ""]
fadeimages[26]=["images/preview/20110214/20110214_28.jpg", "", ""]
fadeimages[27]=["images/preview/20110214/20110214_29.jpg", "", ""]
fadeimages[28]=["images/preview/20110214/20110214_30.jpg", "", ""]
fadeimages[29]=["images/preview/20110214/20110214_31.jpg", "", ""]
//fadeimages[30]=["images/preview/20110214/20110214_32.jpg", "", ""]
fadeimages[31]=["images/preview/20110214/20110214_33.jpg", "", ""]
fadeimages[32]=["images/preview/20110214/20110214_34.jpg", "", ""]
fadeimages[33]=["images/preview/20110214/20110214_35.jpg", "", ""]
fadeimages[34]=["images/preview/20110214/20110214_36.jpg", "", ""]
fadeimages[35]=["images/preview/20110214/20110214_37.jpg", "", ""]
fadeimages[36]=["images/preview/20110214/20110214_38.jpg", "", ""]
fadeimages[37]=["images/preview/20110214/20110214_39.jpg", "", ""]
fadeimages[38]=["images/preview/20110214/20110214_40.jpg", "", ""]
//fadeimages[39]=["images/preview/20110214/20110214_41.jpg", "", ""]
fadeimages[40]=["images/preview/20110214/20110214_42.jpg", "", ""]
fadeimages[41]=["images/preview/20110214/20110214_43.jpg", "", ""]
fadeimages[42]=["images/preview/20110214/20110214_44.jpg", "", ""]
fadeimages[43]=["images/preview/20110214/20110214_45.jpg", "", ""]
fadeimages[44]=["images/preview/20110214/20110214_46.jpg", "", ""]
fadeimages[45]=["images/preview/20110214/20110214_47.jpg", "", ""]
fadeimages[46]=["images/preview/20110214/20110214_48.jpg", "", ""]
fadeimages[47]=["images/preview/20110214/20110214_49.jpg", "", ""]
fadeimages[48]=["images/preview/20110214/20110214_50.jpg", "", ""]
fadeimages[49]=["images/preview/20110214/20110214_51.jpg", "", ""]
fadeimages[50]=["images/preview/20110214/20110214_52.jpg", "", ""]
fadeimages[51]=["images/preview/20110214/20110214_53.jpg", "", ""]
fadeimages[52]=["images/preview/20110214/20110214_54.jpg", "", ""]
//fadeimages[53]=["images/preview/20110214/20110214_55.jpg", "", ""]
fadeimages[54]=["images/preview/20110214/20110214_56.jpg", "", ""]
fadeimages[55]=["images/preview/20110214/20110214_57.jpg", "", ""]
fadeimages[56]=["images/preview/20110214/20110214_58.jpg", "", ""]
fadeimages[57]=["images/preview/20110214/20110214_59.jpg", "", ""]
fadeimages[58]=["images/preview/20110214/20110214_60.jpg", "", ""]
fadeimages[59]=["images/preview/20110214/20110214_61.jpg", "", ""]
*/
fadeimages[0]=["images/preview/20110214/20110214_01.jpg", "", ""]
fadeimages[1]=["images/preview/20110214/20110214_02.jpg", "", ""]
fadeimages[2]=["images/preview/20110214/20110214_03.jpg", "", ""]
fadeimages[3]=["images/preview/20110214/20110214_04.jpg", "", ""]
fadeimages[4]=["images/preview/20110214/20110214_06.jpg", "", ""]
fadeimages[5]=["images/preview/20110214/20110214_07.jpg", "", ""]
fadeimages[6]=["images/preview/20110214/20110214_08.jpg", "", ""]
fadeimages[7]=["images/preview/20110214/20110214_09.jpg", "", ""]
fadeimages[8]=["images/preview/20110214/20110214_10.jpg", "", ""]
fadeimages[9]=["images/preview/20110214/20110214_12.jpg", "", ""]
fadeimages[10]=["images/preview/20110214/20110214_13.jpg", "", ""]
fadeimages[11]=["images/preview/20110214/20110214_14.jpg", "", ""]
fadeimages[12]=["images/preview/20110214/20110214_16.jpg", "", ""]
fadeimages[13]=["images/preview/20110214/20110214_17.jpg", "", ""]
fadeimages[14]=["images/preview/20110214/20110214_18.jpg", "", ""]
fadeimages[15]=["images/preview/20110214/20110214_19.jpg", "", ""]
fadeimages[16]=["images/preview/20110214/20110214_20.jpg", "", ""]
fadeimages[17]=["images/preview/20110214/20110214_22.jpg", "", ""]
fadeimages[18]=["images/preview/20110214/20110214_23.jpg", "", ""]
fadeimages[19]=["images/preview/20110214/20110214_24.jpg", "", ""]
fadeimages[20]=["images/preview/20110214/20110214_25.jpg", "", ""]
fadeimages[21]=["images/preview/20110214/20110214_26.jpg", "", ""]
fadeimages[22]=["images/preview/20110214/20110214_27.jpg", "", ""]
fadeimages[23]=["images/preview/20110214/20110214_28.jpg", "", ""]
fadeimages[24]=["images/preview/20110214/20110214_29.jpg", "", ""]
fadeimages[25]=["images/preview/20110214/20110214_30.jpg", "", ""]
fadeimages[26]=["images/preview/20110214/20110214_31.jpg", "", ""]
fadeimages[27]=["images/preview/20110214/20110214_33.jpg", "", ""]
fadeimages[28]=["images/preview/20110214/20110214_34.jpg", "", ""]
fadeimages[29]=["images/preview/20110214/20110214_35.jpg", "", ""]
fadeimages[30]=["images/preview/20110214/20110214_36.jpg", "", ""]
fadeimages[31]=["images/preview/20110214/20110214_37.jpg", "", ""]
fadeimages[32]=["images/preview/20110214/20110214_38.jpg", "", ""]
fadeimages[33]=["images/preview/20110214/20110214_39.jpg", "", ""]
fadeimages[34]=["images/preview/20110214/20110214_40.jpg", "", ""]
fadeimages[35]=["images/preview/20110214/20110214_42.jpg", "", ""]
fadeimages[36]=["images/preview/20110214/20110214_43.jpg", "", ""]
fadeimages[37]=["images/preview/20110214/20110214_44.jpg", "", ""]
fadeimages[38]=["images/preview/20110214/20110214_45.jpg", "", ""]
fadeimages[39]=["images/preview/20110214/20110214_46.jpg", "", ""]
fadeimages[40]=["images/preview/20110214/20110214_47.jpg", "", ""]
fadeimages[41]=["images/preview/20110214/20110214_48.jpg", "", ""]
fadeimages[42]=["images/preview/20110214/20110214_49.jpg", "", ""]
fadeimages[43]=["images/preview/20110214/20110214_50.jpg", "", ""]
fadeimages[44]=["images/preview/20110214/20110214_51.jpg", "", ""]
fadeimages[45]=["images/preview/20110214/20110214_52.jpg", "", ""]
fadeimages[46]=["images/preview/20110214/20110214_53.jpg", "", ""]
fadeimages[47]=["images/preview/20110214/20110214_54.jpg", "", ""]
fadeimages[48]=["images/preview/20110214/20110214_56.jpg", "", ""]
fadeimages[49]=["images/preview/20110214/20110214_57.jpg", "", ""]
fadeimages[50]=["images/preview/20110214/20110214_58.jpg", "", ""]
fadeimages[51]=["images/preview/20110214/20110214_59.jpg", "", ""]
fadeimages[52]=["images/preview/20110214/20110214_60.jpg", "", ""]
fadeimages[53]=["images/preview/20110214/20110214_61.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 fadepattaya=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadepattaya[0]=["images/about/pattaya/1.jpg", "", ""]
fadepattaya[1]=["images/about/pattaya/2.jpg", "", ""]
fadepattaya[2]=["images/about/pattaya/3.jpg", "", ""]
fadepattaya[3]=["images/about/pattaya/4.jpg", "", ""]
fadepattaya[4]=["images/about/pattaya/5.jpg", "", ""]
fadepattaya[5]=["images/about/pattaya/6.jpg", "", ""]
fadepattaya[6]=["images/about/pattaya/7.jpg", "", ""]
fadepattaya[7]=["images/about/pattaya/8.jpg", "", ""]
fadepattaya[8]=["images/about/pattaya/9.jpg", "", ""]
fadepattaya[9]=["images/about/pattaya/10.jpg", "", ""]
fadepattaya[10]=["images/about/pattaya/11.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")


// Copyright (C) 2005-2008 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
//
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Re-distribute this code or any part of it.
//     Instead, you may link to the homepage of this code:
//     http://www.php-development.ru/javascripts/dropdown.php
//
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as part of another product.
//
// NO WARRANTY
// This code is provided "as is" without warranty of any kind.
// You expressly acknowledge and agree that use of this code is at your own risk.


// ***** Popup Control *********************************************************

// ***** at_show_aux *****

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child );

  var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }

  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  c.style.visibility = "visible";
}

// ***** at_show *****

function at_show()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  at_show_aux(p.id, c.id);
  clearTimeout(c["at_timeout"]);
}

// ***** at_hide *****

function at_hide()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
}

// ***** at_click *****

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden";
  return false;
}

// ***** at_attach *****

// PARAMETERS:
// parent   - id of the parent html element
// child    - id of the child  html element that should be droped down
// showtype - "click" = drop down child html element on mouse click
//            "hover" = drop down child html element on mouse over
// position - "x" = display the child html element to the right
//            "y" = display the child html element below
// cursor   - omit to use default cursor or specify CSS cursor name

function at_attach(parent, child, showtype, position, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}

/*
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")

function internetRate(){
	showModalDialog ("internet-rates.html", "dialogWidth:620px; dialogHeight:600px; location:no; status:no; dialogLeft:0; dialogTop:0");
}
*/
