      
/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimagesAboutUs=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        //fadeimagesAboutUs[0]=["flash/aboutUs/1.jpg", "", ""] //plain image syntax
		//fadeimagesAboutUs[1]=["flash/aboutUs/2.jpg", "", ""] //image with link syntax
		//fadeimagesAboutUs[2]=["flash/aboutUs/3.jpg", "", ""] //image with link and target syntax
		//fadeimagesAboutUs[4]=["flash/aboutUs/5.jpg", "", ""] //image with link syntax
		//fadeimagesAboutUs[5]=["flash/aboutUs/6.jpg", "", ""] //image with link and target syntax
        //fadeimagesAboutUs[6]=["flash/aboutUs/7.jpg", "", ""] //plain image syntax
		//fadeimagesAboutUs[7]=["flash/aboutUs/8.jpg", "", ""] //image with link syntax
        fadeimagesAboutUs[0]=["flash/home/1.jpg", "", ""] //plain image syntax
		fadeimagesAboutUs[1]=["flash/home/2.jpg", "", ""] //image with link syntax
		fadeimagesAboutUs[2]=["flash/home/3.jpg", "", ""] //image with link and  
        fadeimagesAboutUs[3]=["flash/home/4.jpg", "", ""] //plain image syntax
		fadeimagesAboutUs[4]=["flash/home/5.jpg", "", ""] //image with link syntax
		fadeimagesAboutUs[5]=["flash/home/6.jpg", "", ""] //image with link and  
        fadeimagesAboutUs[6]=["flash/home/7.jpg", "", ""] //plain image syntax
		fadeimagesAboutUs[7]=["flash/home/8.jpg", "", ""] //image with link syntax	
        fadeimagesAboutUs[8]=["flash/aboutUs/4.jpg", "", ""] //plain image syntax

var fadeimagesActivities=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesActivities[0]=["flash/activities/1.jpg", "", ""] //plain image syntax
		fadeimagesActivities[1]=["flash/activities/2.jpg", "", ""] //image with link syntax
		fadeimagesActivities[2]=["flash/activities/3.jpg", "", ""] //image with link and  
        fadeimagesActivities[3]=["flash/activities/4.jpg", "", ""] //plain image syntax
		fadeimagesActivities[4]=["flash/activities/5.jpg", "", ""] //image with link syntax
		fadeimagesActivities[5]=["flash/activities/6.jpg", "", ""] //image with link and  
        fadeimagesActivities[6]=["flash/activities/7.jpg", "", ""] //plain image syntax
		fadeimagesActivities[7]=["flash/activities/8.jpg", "", ""] //image with link syntax

var fadeimagesContact=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesContact[0]=["flash/contact/1.jpg", "", ""] //plain image syntax
		fadeimagesContact[1]=["flash/contact/2.jpg", "", ""] //image with link syntax
 
var fadeimagesCorporate=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesCorporate[0]=["flash/corporate/1.jpg", "", ""] //plain image syntax
		fadeimagesCorporate[1]=["flash/corporate/2.jpg", "", ""] //image with link syntax
		fadeimagesCorporate[2]=["flash/corporate/3.jpg", "", ""] //image with link syntax
		 
var fadeimagesFamily=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesFamily[0]=["flash/family/1.jpg", "", ""] //plain image syntax
		fadeimagesFamily[1]=["flash/family/2.jpg", "", ""] //image with link syntax
        fadeimagesFamily[2]=["flash/family/3.jpg", "", ""] //plain image syntax
		fadeimagesFamily[3]=["flash/family/4.jpg", "", ""] //image with link syntax		
        fadeimagesFamily[4]=["flash/family/5.jpg", "", ""] //plain image syntax
	
var fadeimagesFriends=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesFriends[0]=["flash/friends/1.jpg", "", ""] //plain image syntax
		fadeimagesFriends[1]=["flash/friends/2.jpg", "", ""] //image with link syntax
        fadeimagesFriends[2]=["flash/friends/3.jpg", "", ""] //plain image syntax		
	
	
	
var fadeimagesGeneral=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesGeneral[0]=["flash/general/1.jpg", "", ""] //plain image syntax
		fadeimagesGeneral[1]=["flash/general/2.jpg", "", ""] //image with link syntax
        fadeimagesGeneral[2]=["flash/general/3.jpg", "", ""] //plain image syntax
		fadeimagesGeneral[3]=["flash/general/4.jpg", "", ""] //image with link syntax		
        fadeimagesGeneral[4]=["flash/general/5.jpg", "", ""] //plain image syntax	
        fadeimagesGeneral[5]=["flash/general/amee-gallery.jpg", "", ""] //plain image syntax
		
var fadeimagesHealthy=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesHealthy[0]=["flash/healthy/1.jpg", "", ""] //plain image syntax
		fadeimagesHealthy[1]=["flash/healthy/2.jpg", "", ""] //image with link syntax	
		
var fadeimagesHome=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesHome[0]=["flash/home/1.jpg", "", ""] //plain image syntax
		fadeimagesHome[1]=["flash/home/2.jpg", "", ""] //image with link syntax
		fadeimagesHome[2]=["flash/home/3.jpg", "", ""] //image with link and  
        fadeimagesHome[3]=["flash/home/4.jpg", "", ""] //plain image syntax
		fadeimagesHome[4]=["flash/home/5.jpg", "", ""] //image with link syntax
		fadeimagesHome[5]=["flash/home/6.jpg", "", ""] //image with link and  
        fadeimagesHome[6]=["flash/home/7.jpg", "", ""] //plain image syntax
		fadeimagesHome[7]=["flash/home/8.jpg", "", ""] //image with link syntax		
	
var fadeimagesMens=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesMens[0]=["flash/mens/1.jpg", "", ""] //plain image syntax
		fadeimagesMens[1]=["flash/mens/2.jpg", "", ""] //image with link syntax
        fadeimagesMens[2]=["flash/mens/3.jpg", "", ""] //plain image syntax	

var fadeimagesOwner=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesOwner[0]=["flash/owner/1.jpg", "", ""] //plain image syntax
		fadeimagesOwner[1]=["flash/owner/2.jpg", "", ""] //image with link syntax
		fadeimagesOwner[2]=["flash/owner/3.jpg", "", ""] //image with link and  
        //fadeimagesOwner[3]=["flash/owner/4.jpg", "", ""] //plain image syntax
		fadeimagesOwner[3]=["flash/owner/5.jpg", "", ""] //image with link syntax
		fadeimagesOwner[4]=["flash/owner/6.jpg", "", ""] //image with link and  		
		
var fadeimagesPrivate=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesPrivate[0]=["flash/private/1.jpg", "", ""] //plain image syntax
		fadeimagesPrivate[1]=["flash/private/2.jpg", "", ""] //image with link syntax
		fadeimagesPrivate[2]=["flash/private/3.jpg", "", ""] //image with link and  
        fadeimagesPrivate[3]=["flash/private/4.jpg", "", ""] //plain image syntax	

var fadeimagesRooms=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesRooms[0]=["flash/rooms/1.jpg", "", ""] //plain image syntax
		fadeimagesRooms[1]=["flash/rooms/2.jpg", "", ""] //image with link syntax
		fadeimagesRooms[2]=["flash/rooms/3.jpg", "", ""] //image with link and  
        fadeimagesRooms[3]=["flash/rooms/4.jpg", "", ""] //plain image syntax
		fadeimagesRooms[4]=["flash/rooms/5.jpg", "", ""] //image with link syntax
		fadeimagesRooms[5]=["flash/rooms/6.jpg", "", ""] //image with link and  
        fadeimagesRooms[6]=["flash/rooms/7.jpg", "", ""] //plain image syntax
		fadeimagesRooms[7]=["flash/rooms/8.jpg", "", ""] //image with link syntax
	
var fadeimagesTown=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesTown[0]=["flash/town/1.jpg", "", ""] //plain image syntax
		fadeimagesTown[1]=["flash/town/2.jpg", "", ""] //image with link syntax
		fadeimagesTown[2]=["flash/town/3.jpg", "", ""] //image with link and  
        fadeimagesTown[3]=["flash/town/4.jpg", "", ""] //plain image syntax	

var fadeimagesWomen=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
        fadeimagesWomen[0]=["flash/women/1.jpg", "", ""] //plain image syntax
		fadeimagesWomen[1]=["flash/women/2.jpg", "", ""] //image with link syntax
		
var fadeimagesWedding=new Array()
        fadeimagesWedding[0]=["flash/wedding/1.jpg", "", ""] //plain image syntax
		fadeimagesWedding[1]=["flash/wedding/2.jpg", "", ""] //image with link syntax
		fadeimagesWedding[2]=["flash/wedding/3.jpg", "", ""] //image with link and  
		fadeimagesWedding[2]=["flash/wedding/4.jpg", "", ""] //image with link and  
		fadeimagesWedding[2]=["flash/wedding/5.jpg", "", ""] //image with link and  
		fadeimagesWedding[2]=["flash/wedding/6.jpg", "", ""] //image with link and  
					
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()
}




var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	if(ddmenuitem)	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

function GetPageSize(){
	var xScroll, yScroll;
	var windowWidth, windowHeight;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	ArrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return ArrayPageSize;
}

function setContentHeight(){
	if(document.getElementById('content_holder')){
		ArrayPageSize = GetPageSize();
		var limit = 580;
		
		if(ArrayPageSize[3] > limit){
			document.getElementById('content_holder').style.width = '520px';
			document.getElementById('content_holder').style.height = (ArrayPageSize[3] - 320) + 'px';
			document.getElementById('content_holder').style.margin = '10px';
			document.getElementById('content_holder').style.overflow = 'auto';
		}else{
			document.getElementById('content_holder').style.width = '520px';
			document.getElementById('content_holder').style.height = (limit - 320) + 'px';
			document.getElementById('content_holder').style.margin = '10px';
			document.getElementById('content_holder').style.overflow = 'auto';
		}
	}
	
}

function SetAllCheckBoxes(FormName, FieldName, CheckValue){

	//CheckValue=document.forms[FormName].chkAll.checked;
	
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}
function ConfirmDelSel(FormName, FieldName,actionlocation,fieldtobedeleted){
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes){
		return false;
	}else{
		var countCheckBoxes=objCheckBoxes.length;
		if(!countCheckBoxes){
			if(objCheckBoxes.checked==false){
				alert("You have not checked any boxes!");
				return false;
				
			}else{
				ConfirmDelOne(objCheckBoxes.value,actionlocation,fieldtobedeleted);
			}
		}else{
			var hasCheck=false;
			for(var i = 0; i < countCheckBoxes; i++)
				if(objCheckBoxes[i].checked ==true){
					hasCheck=true;
			}
			if(!hasCheck){
				alert("You have not checked any boxes!");
				return false;
			}else{
				if(confirm('Are you sure you want to delete the selected '+fieldtobedeleted+'s?')){
					document.forms[FormName].action=actionlocation+"&process=deleteselected";
					document.forms[FormName].submit();
				}
				return false;
			}
		}
	}
}
function hasChecked(FormName, FieldName){
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes){
		return false;
	}else{
		var countCheckBoxes=objCheckBoxes.length;
		if(!countCheckBoxes){
			if(objCheckBoxes.checked==false){
				return false;
			}else{
				return true;
			}
		}else{
			var hasCheck=false;
			for(var i = 0; i < countCheckBoxes; i++)
				if(objCheckBoxes[i].checked ==true){
					hasCheck=true;
				}
			return hasCheck;
		}
	}
}
function ConfirmDelOne(ID,actionlocation,fieldtobedeleted){
	if(confirm('Are You Sure you want to delete this '+fieldtobedeleted+'?')){
		window.location=actionlocation+"&process=deleteone&id="+ID;
	}
	return false;
}

// close layer when click-out
document.onclick = mclose; 
//window.onload = function () { setContentHeight(); }