<!--

	//================================================================================================
	// VARIABLES DECLARATION
	//================================================================================================	
	var player = null;
	var inclusionNow = 0, inclusionTotal;
	var featuredNow = 0, featuredTotal, arrFeatured;
	var galleryNow = 0;
	var openContactUs = false, openGallery = true, openVideo = false;
	var homeShow, detailsShow, testimonialShow, timerTestimonial = 0, timerImage = 0; flagPlay = false, flagBannerMain = true;
	var selectedTab = 1;

	//================================================================================================
	// AJAX FUNCTIONS
	//================================================================================================			
	function sendEnquiry(fullname, email, address, suburb, state, postcode, phone, comment)
	{
		var url = "process.asp";

		var data = "process=contact";
		data = data + "&fullname=" + fullname;
		data = data + "&email=" + email;
		data = data + "&address=" + address;
		data = data + "&suburb=" + suburb;
		data = data + "&state=" + state;
		data = data + "&postcode=" + postcode;
		data = data + "&phone=" + phone;
		data = data + "&comment=" + comment;
		data = data + "&sid=" + Math.random();		
		
		var req = new Request( {method: 'get', url: '' + url, 

			onSuccess: function(txt) {			
				alert(txt);
				
				hideContactUs();
				
				var form = document.contactform;
				form.fullname.value = "";
				form.email.value = "";
				form.address.value = "";
				form.suburb.value = "";
				form.state.value = "";
				form.postcode.value = "";
				form.phone.value = "";
				form.comment.value = "";			
			},
			
			onFailure: function() {
				alert("Error connecting to server. Please refresh this page...");
			}
			
		}).send(data);
	}		
	
	function showEnlargementImage(id)
	{
		var div = $('container_enlargement');
		var url = "get_facade_image.asp";
		var data = "blockID=" + id
		
		var req = new Request( {url: '' + url, 
			
			onSuccess: function(txt) {				
				$(div).set('html', txt);	
			},
			
			onFailure: function() {
				$(div).set('html', '<div class="ajax_white">Error loading... Please refresh the browser</div>');
			},
			
			onRequest: function() {
				$(div).set('html', '<div class="ajax_white"></div>');
			}
		
		}).send(data);		
	}		
	
	function showFeaturedImages(id)
	{
		var div = $('home_banner');
		var url = "get_product_images.asp";
		var data = "productID=" + id
		
		var req = new Request( {url: '' + url, 
			
			onSuccess: function(txt) {				
				$(div).set('html', txt);
				
				homeShow.destroy();
				homeShow = new Slideshow('home_banner', false, {delay: 4000, width: 960, height: 500});				
			},
			
			onFailure: function() {
				$(div).set('html', '<div class="ajax_dark_grey">Error loading... Please refresh the browser</div>');
			},
			
			onRequest: function() {
				$(div).set('html', '<div class="ajax_dark_grey"></div>');
			}
		
		}).send(data);		
	}	

	function showHomeAndLand(data)
	{
		var div = $('homeandland_content');
		var url = "get_homeandland.asp";
		
		var req = new Request( {url: '' + url, 
			
			onSuccess: function(txt) {				
				$(div).set('html', txt);	
				
				//redo the events after ajax call
				$$('.hoverBox').addEvents({
					'click' : function(e) {			
						e.preventDefault();
					},
					
					'mouseover' : function(e) {
						this.setStyle('background-color', '#666666');
					},
					
					'mouseout' : function(e) {
						this.setStyle('background', 'transparent');
					}
				});
			},
			
			onFailure: function() {
				$(div).set('html', '<div class="ajax_grey">Error loading... Please refresh the browser</div>');
			},
			
			onRequest: function() {
				$(div).set('html', '<div class="ajax_grey"></div>');
			}
		
		}).send(data);		
	}	
	
	//================================================================================================
	// Form functions
	//================================================================================================
	function submitEnquiry()
	{
		var form = document.contactform;

		var c_fullname = form.fullname.value;
		var c_email = form.email.value;
		var c_address = form.address.value;
		var c_suburb = form.suburb.value;
		var c_state = form.state.value;
		var c_postcode = form.postcode.value;
		var c_phone = form.phone.value;
		var c_comment = form.comment.value;

		var valid = true;

		if (c_fullname == "")
		{
			valid = false;
			alert("Please make sure you have entered your name.");
		}
		else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(c_email)))
		{
			valid = false;
			alert("Please make sure you have entered a valid e-mail address.");
		}
		else if (c_address == "")
		{
			valid = false;
			alert("Please make sure you have entered your street address.");
		}
		else if (c_suburb == "")
		{
			valid = false;
			alert("Please make sure you have entered your suburb.");
		}
		else if (c_state == "")
		{
			valid = false;
			alert("Please make sure you have entered your state.");
		}
		else if (c_postcode == "")
		{
			valid = false;
			alert("Please make sure you have entered your postcode.");
		}
		else if (c_phone == "")
		{
			valid = false;
			alert("Please make sure you have entered your phone number.");
		}
		else if (c_comment == "")
		{
			valid = false;
			alert("Please make sure you have entered comments or enquiries.");
		}

		if (valid == true)
		{
			sendEnquiry(c_fullname, c_email, c_address, c_suburb, c_state, c_postcode, c_phone, c_comment);
		}
	}

	//================================================================================================
	// LAYOUT FUNCTIONS 
	//================================================================================================			
	function resetDivPositions()
	{
		var w = window.getWidth() / 2 - 480;
		$('homesContainer').setStyle('left', (w + 20) + 'px');
		$('displaycentresContainer').setStyle('left', (w + 135) + 'px');		
		$('aboutContainer').setStyle('left', (w + 450) + 'px');
		$('testimonialsContainer').setStyle('left', (w + 327) + 'px');
	}
	
	function showGalleryTab(id)
	{
		if($chk($('tab1')))
		{
			if(id != selectedTab)
			{
				$('tab' + selectedTab).setStyle('text-decoration', 'none');
				selectedTab = id;
			}

			$('tab' + id).setStyle('text-decoration', 'underline');

			new Fx.Scroll($('gallery_thumbs')).toElement('gallery_tab_' + id);
		}
	}	
	
	function showEnlargement(blockID)
	{
		//repositioned
		var w = window.getWidth() / 2 - 480;
		
		$('container_enlargement').setStyle('top', '125px');
		$('container_enlargement').setStyle('left', (w + 150) + 'px');

		$('container_enlargement').setStyle('display', 'block');
		
		showEnlargementImage(blockID);
	}	
	
	function hideEnlargement()
	{
		$('container_enlargement').setStyle('display', 'none');
	}	

	function showContactUs()
	{
		if (!openContactUs)
		{
			$('container_contactus').setStyle('display', 'block');
			new Fx.Tween('container_contactus').start('opacity', 0, 1);
			openContactUs = true;
		}
	}	
		
	function hideContactUs()
	{
		if (openContactUs)
		{
			new Fx.Tween('container_contactus').start('opacity', 1, 0).chain(function(){
				$('container_contactus').setStyle('display', 'none');
			});			
			openContactUs = false;
		}
	}	

	function toggleContactUs()
	{
		if (openContactUs)
		{
			hideContactUs();
		} 
		else
		{
			showContactUs();
		}
	}	
	
	function showFeatured(id)
	{
		var details_id = arrFeatured[id].get('id');
		var product_id = details_id.replace("details_", "");
		
		featuredNow = id;
		new Fx.Scroll($('banner_details_text')).toElement('details_' + product_id);				
		
		//ajax call		
		showFeaturedImages(product_id);
	}

	function showPrevFeatured()
	{
		if (featuredNow > 0)
		{
			showFeatured(featuredNow - 1);
		} 
		else
		{
			showFeatured(featuredTotal - 1);		
		}		
	}
	
	function showNextFeatured()
	{
		if (featuredNow < featuredTotal - 1)
		{
			showFeatured(featuredNow + 1);
		} 
		else
		{
			showFeatured(0);		
		}		
	}	
	
	function showInclusion(boxID)
	{
		inclusionNow = boxID;
		
		if ($chk($('scrollable_text_box')))
		{
			new Fx.Scroll($('scrollable_text_box')).toElement('inc_details_' + boxID);				
		}

		if ($chk($('scrollable_text_box_newlifestyle')))
		{
			new Fx.Scroll($('scrollable_text_box_newlifestyle')).toElement('inc_details_' + boxID);				
		}

		if ($chk($('extra_box_info')))
		{
			new Fx.Scroll($('extra_box_info')).toElement('extra_' + boxID);						
		}
	}

	function showPrevInclusion()
	{
		if (inclusionNow > 0)
		{
			showInclusion(inclusionNow - 1);
		} 
		else
		{
			showInclusion(inclusionTotal);		
		}		
	}
	
	function showNextInclusion()
	{
		if (inclusionNow < inclusionTotal)
		{
			showInclusion(inclusionNow + 1);
		} 
		else
		{
			showInclusion(0);		
		}		
	}	
	
	function showTestimonial(id, picURL)
	{
		testimonialShow.show(id);
		pauseImage(picURL);
	}	

	function pauseTestimonials()
	{
		$clear(timerTestimonial);
		timerTestimonial = 0;
		var img = $('toggleSlide').getChildren('img')[0];
		img.set('src', img.get('src').replace('_pause', '_play'));
		
		flagPlay = false;
	}	
	
	function playTestimonials()
	{
		var play = function() 
		{
			testimonialShow.forward();
		}
		timerTestimonial = play.periodical(5000);
		var img = $('toggleSlide').getChildren('img')[0];
		img.set('src', img.get('src').replace('_play', '_pause'));
		
		flagPlay = true;
	}

	function pauseImage(picURL)
	{
		$clear(timerImage);
		timerImage = 0;
		if(picURL != "nophoto.jpg")
			$('image1').set('src', 'images/page/' + picURL);
		else
			$('image1').set('src', 'images/site/' + picURL);
		imageShow.show(0);
	}

	function playImage()
	{
		var play = function() 
		{
			imageShow.forward();
		}
		timerImage = play.periodical(5000);
	}

	function toggleTestimonials()	
	{
		if (flagPlay)
		{
			pauseTestimonials();
		}
		else
		{
			playTestimonials();
		}
	}

	function pauseBannerMain()
	{
		var img = $('toggleSlide').getChildren('img')[0];
		img.set('src', img.get('src').replace('_pause', '_play'));
		detailsShow.pause(1);
		flagBannerMain = false;
	}	
	
	function playBannerMain()
	{
		var img = $('toggleSlide').getChildren('img')[0];
		img.set('src', img.get('src').replace('_play', '_pause'));
		detailsShow.pause(0);
		flagBannerMain = true;
	}	

	function toggleBannerMain()	
	{
		if (flagBannerMain)
		{
			pauseBannerMain();
		}
		else
		{
			playBannerMain();
		}
	}
	
	function showVideo()
	{
		if (!openVideo)
		{
			$('container_video').setStyle('display', 'block');			
			
			openVideo = true;
			
			(function () {
				if (player != null)
				{
					player.sendEvent('PLAY');		
				}
			}).delay(1000);
						
		}
	}	
		
	function hideVideo()
	{
		if (openVideo)
		{
			if (player != null)
			{
				player.sendEvent('STOP');			
			}

			$('container_video').setStyle('display', 'none');					
			openVideo = false;
		}
	}	

	function toggleVideo()
	{
		if (openVideo)
		{
			hideVideo();
		} 
		else
		{
			showVideo();
		}
	}		
	
	function loadVideo(src)
	{
		$('container_video').setStyle('display', 'block');			
		
		openVideo = true;
		
		(function () {
			if (player != null)
			{
				player.sendEvent('LOAD', 'http://wisdomhomes.com.au/media/vids/' + src);	
				player.sendEvent('PLAY');
			}
		}).delay(1000);
	}		
	
	function loadHomeVideo(src)
	{
		$('container_video').setStyle('display', 'block');			
		
		openVideo = true;
		
		(function () {
			if (player != null)
			{
				player.sendEvent('LOAD', 'http://wisdomhomes.com.au/media/product/' + src);	
				player.sendEvent('PLAY');
			}
		}).delay(1000);
	}	
	
	function loadTestimonialVideo(title,intro,src)
	{
		$('testimonialName').set('html', title);
		$('testimonialArea').set('html', intro);

		(function () {
			if (player != null)
			{
				player.sendEvent('LOAD', 'http://wisdomhomes.com.au/media/vids/' + src);	
				player.sendEvent('PLAY');
			}
		}).delay(1000);
	}		
	
	//================================================================================================
	// JW PLAYER FUNCTIONS
	//================================================================================================		
	function createPlayer(filepath) {
		var flashvars = {
			file : filepath,
			autostart : "false",
			repeat : "always",
			displayclick : "none"
		}

		var params = {
			allowfullscreen : "true", 
			allowscriptaccess : "always",
			wmode : "opaque"
		}

		var attributes = {
			id : "player_video",  
			name : "player_video"
		}

		swfobject.embedSWF("common/swf/player.swf", "video_player", "100%", "100%", "9.0.115", false, flashvars, params, attributes);
	}
	
	function playerReady(thePlayer) {
		player = window.document[thePlayer.id];
		
		if ($chk($('testimonial_video_box')))
		{
			player.sendEvent('PLAY');
		}		
	}		
	
	//================================================================================================
	// EVENTS FUNCTIONS
	//================================================================================================		
	function setupActions()
	{
		if ($chk($$('.hoverBox')))
		{
			$$('.hoverBox').addEvents({
				'click' : function(e) {			
					e.preventDefault();
				},
				
				'mouseover' : function(e) {
					this.setStyle('background-color', '#505050');
				},
				
				'mouseout' : function(e) {
					this.setStyle('background', 'transparent');
				}
			});
		}
		
		if ($chk($$('.hoverThis')))
		{
			$$('.hoverThis').addEvents({
				
				'mouseover' : function(e) {
					this.setStyle('opacity', 1);
				},
			
				'mouseout' : function(e) {
					this.setStyle('opacity', 0.5);
				}
				
			});			
		}
		
		if ($chk($("homesmenu"))) 
		{		
			$("homesmenu").addEvents({
			
				'mouseover' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#ffffff');
					slideMenu.showMenu('homes');
				},
			
				'mouseout' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#999999');
					slideMenu.hideMenu('homes');
				}
				
			});			
		}	
		
		if ($chk($("testimonialsmenu"))) 
		{		
			$("testimonialsmenu").addEvents({
			
				'mouseover' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#ffffff');
					slideMenu.showMenu('testimonials');
				},
			
				'mouseout' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#999999');
					slideMenu.hideMenu('testimonials');
				}
				
			});			
		}		
		
		if ($chk($("displaycentresmenu"))) 
		{		
			$("displaycentresmenu").addEvents({
			
				'mouseover' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#ffffff');
					slideMenu.showMenu('displaycentres');
				},
			
				'mouseout' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#999999');
					slideMenu.hideMenu('displaycentres');
				}
				
			});			
		}		
		
		if ($chk($("aboutmenu"))) 
		{		
			$("aboutmenu").addEvents({
			
				'mouseover' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#ffffff');
					slideMenu.showMenu('about');
				},
			
				'mouseout' : function(e) {
					if (this.hasClass('nav')) this.setStyle('color', '#999999');
					slideMenu.hideMenu('about');
				}
				
			});			
		}			
		
		if ($chk($$(".subnav"))) 
		{
			$$(".subnav").addEvents({
			
				'mouseover' : function(e) {
					this.setStyle('background-color', '#5f7814');
					
					var link = this.getElement('a');
					link.setStyle('color', '#ffffff');
				},
			
				'mouseout' : function(e) {
					this.setStyle('background-color', '#ffffff');				

					var link = this.getElement('a');
					link.setStyle('color', '#666666');
				}
				
			});
		}			
		
		if ($chk($$(".hoverInclusion"))) 
		{
			//Get total inclusions
			if ($chk($('scrollable_text_box')))
			{
				var widthScrollableBox = $('scrollable_text_box').getWidth();
				var widthTableBoxes = $('tbl_inclusions').getWidth();
				inclusionTotal = (widthTableBoxes / widthScrollableBox) - 1;
			}
			
			if ($chk($('scrollable_text_box_newlifestyle')))
			{
				var widthScrollableBox = $('scrollable_text_box_newlifestyle').getWidth();
				var widthTableBoxes = $('tbl_inclusions').getWidth();
				inclusionTotal = (widthTableBoxes / widthScrollableBox) - 1;
			}			
			
			$$(".hoverInclusion").addEvents({
			
				'mouseover' : function(e) {
					var div = this.getChildren('div')[0];
					var img = $(div).getChildren('img')[0];
					if ($type($(img)) != false)
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('.png', '_hover.png'));
					}
				},
			
				'mouseout' : function(e) {
					var div = this.getChildren('div')[0];
					var img = $(div).getChildren('img')[0];
					if ($type($(img)) != false)
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('_hover.png', '.png'));
					}
				}
				
			});
		}	
		
		if ($chk($$(".hoverHomeLand"))) 
		{
			$$(".hoverHomeLand").addEvents({
			
				'mouseover' : function(e) {
					var div = this.getChildren('div')[0];
					var img = $(div).getChildren('img')[0];
					if ($type($(img)) != false)
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('.png', '_hover.png'));
					}
				},
			
				'mouseout' : function(e) {
					var div = this.getChildren('div')[0];
					var img = $(div).getChildren('img')[0];
					if ($type($(img)) != false)
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('_hover.png', '.png'));
					}
				}
				
			});
		}			

		if ($chk($("prev_inclusion"))) 
		{	
			$("prev_inclusion").addEvents({
				
				'mouseover' : function(e) {
					var img = this.getChildren('img')[0];					
					if ($chk($(img))) 
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('.png', '_hover.png'));
					}
				},
			
				'mouseout' : function(e) {
					var img = this.getChildren('img')[0];					
					if ($chk($(img))) 
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('_hover.png', '.png'));
					}
				}
				
			});			
		}		

		if ($chk($("next_inclusion"))) 
		{	
			$("next_inclusion").addEvents({
				
				'mouseover' : function(e) {
					var img = this.getChildren('img')[0];					
					if ($chk($(img))) 
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('.png', '_hover.png'));
					}
				},
			
				'mouseout' : function(e) {
					var img = this.getChildren('img')[0];					
					if ($chk($(img))) 
					{
						var srcURL = $(img).getProperty('src');
						$(img).setProperty('src', srcURL.replace('_hover.png', '.png'));
					}
				}
				
			});			
		}	

		if ($chk($('home_product_prev')))
		{
			//Get total featured
			if ($chk($('home_banner')))
			{				
				arrFeatured = $$('.details_box')
				featuredTotal = arrFeatured.length;
			}
		
			$('home_product_prev').addEvents({
				
				'click' : function(e) {
					e.preventDefault();
					showPrevFeatured();
				},
				
				'mouseover' : function(e) {
					$('home_product_prev').setStyle('opacity', 1);
				},
			
				'mouseout' : function(e) {
					$('home_product_prev').setStyle('opacity', 0.5);
				}
				
			});			
		}
		
		if ($chk($('home_product_next')))
		{
			$('home_product_next').addEvents({
				
				'click' : function(e) {
					e.preventDefault();
					showNextFeatured();
				},

				'mouseover' : function(e) {
					$('home_product_next').setStyle('opacity', 1);
				},
			
				'mouseout' : function(e) {
					$('home_product_next').setStyle('opacity', 0.5);
				}
				
			});			
		}	

		if ($chk($('testimonial_navs')))
		{
			$$('.nav_box_text').addEvents({
				
				'click' : function(e) {
				},

				'mouseover' : function(e) {
					var div = this.getPrevious('div');
					div.removeClass('bg_gradient_testimonial');
					div.addClass('bg_grey');
					
					this.setStyle('opacity', 1);
				},
			
				'mouseout' : function(e) {
					var div = this.getPrevious('div');
					div.removeClass('bg_grey');
					div.addClass('bg_gradient_testimonial');

					this.setStyle('opacity', 0.5);
				}
				
			});				
		}
		
		if ($chk($$('.hoverHighlight')))
		{
			$$('.hoverHighlight').addEvents({

				'click' : function(e) {

					var idx = $$('.hoverHighlight').indexOf(this);
					var fname;

					if($chk($('btn_pause')))
					{
						flagBannerMain = true;
						pauseBannerMain();
					}
					detailsShow.go(parseInt(idx));
				},

				'mouseover' : function(e){
					//var idx = $$('.hoverHighlight').indexOf(this);
					//$('highlight_box').setStyle('left', idx * 120);
					//$('highlight_box').setStyle('display', 'block');
					var idx = (parseInt($(this).get('ID')) % 5);
					$('highlight_box').setStyle('left', idx*120);
					$('highlight_box').setStyle('display', 'block');
				},

				'mouseout' : function(e){
					$('highlight_box').setStyle('display', 'none');
				}
			});						
		}

		if ($chk($('btn_toggle_gallery')))
		{
			$('btn_toggle_gallery').addEvents({
			
				'click' : function(e) {
				
					if (openGallery)
					{
						var img = this.getChildren('img')[0];
						img.set('src', img.get('src').replace('_down', '_up'));
						new Fx.Morph($('gallery'), {duration: 'short'}).start({'top' : 70});
					}
					else
					{
						var img = this.getChildren('img')[0];
						img.set('src', img.get('src').replace('_up', '_down'));					
						new Fx.Morph($('gallery'), {duration: 'short'}).start({'top' : 10});
					}
					
					openGallery = !openGallery;
				}
				
			});			
		}			
		
		if ($chk($$('.title_box_text')) && !$chk($('content_wherewebuild')))
		{
			$$('.title_box_text').addEvents({
				
				'click' : function(e) {
					if (this.hasClass('open'))
					{
						//close
						var img = this.getChildren('div')[1].getChildren('img');
						img.setProperty('src', 'images/site/pic_arrow_right.gif');
						this.removeClass('open');
						
						var content = this.getParent().getNext('div');
						new Fx.Morph(content, {duration: 'short'}).start('.hide');
					}
					else
					{
						//open
						var img = this.getChildren('div')[1].getChildren('img');
						img.setProperty('src', 'images/site/pic_arrow_down.gif');
						this.addClass('open');
						
						var content = this.getParent().getNext('div');
						new Fx.Morph(content, {duration: 'short'}).start('.show');
					}
				},

				'mouseover' : function(e) {
					if (!this.hasClass('open'))
					{
						var img = this.getChildren('div')[1].getChildren('img');
						img.setProperty('src', 'images/site/pic_arrow_right_hover.gif');
					}
				},
			
				'mouseout' : function(e) {
					if (!this.hasClass('open'))
					{
						var img = this.getChildren('div')[1].getChildren('img');
						img.setProperty('src', 'images/site/pic_arrow_right.gif');
					}
				}
				
			});				
		}	
		
		if ($chk($$('.top_nav_home')))
		{
			$$('.top_nav_home').addEvents({

				'mouseover' : function(e){
					var td = this.getParent('td');
					td.addClass('bg_nav_hover');
				},

				'mouseout' : function(e){
					var td = this.getParent('td');
					td.removeClass('bg_nav_hover');
				}
				
			});						
		}		
	}

	function setupScrollbars()
	{
		if ($chk($('scrollable_facades_single')))
		{
			makeScrollbar( $('scrollable_facades_single'), $('scroller_facade_single'), $('scroller_handle_facade_single'), true );
		}

		if ($chk($('scrollable_facades_destiny')))
		{
			makeScrollbar( $('scrollable_facades_destiny'), $('scroller_facade_destiny'), $('scroller_handle_facade_destiny'), true );
		}

		if ($chk($('scrollable_facades_double')))
		{
			makeScrollbar( $('scrollable_facades_double'), $('scroller_facade_double'), $('scroller_handle_facade_double'), true );
		}
	}	
	
	function setupMorphTabs()
	{
		if ($chk($('morphTabs')))
		{
			var morphTabs = new MorphTabs('morphTabs', {height: '380px', width: '580px'});
		}
	}	
	
	function setupOpacity()
	{
		if ($chk($('home_product_prev')))
		{
			$('home_product_prev').setStyle('opacity', 0.5);
		}
		
		if ($chk($('home_product_next')))
		{
			$('home_product_next').setStyle('opacity', 0.5);
		}
		
		if ($chk($('container_home_details')))
		{
			if ($chk($('gallery_bg')))
				$('gallery_bg').setStyle('opacity', 0.8);
		}		
		
		if ($chk($('testimonial_navs')))
		{
			$$('.nav_box_text').setStyle('opacity', 0.5);
		}

		if ($chk($('homeandland_content')))
		{
			$('homeandland_content').setStyle('opacity', 1);
			$('bottom_content').setStyle('opacity', 1);
		}
		
		if ($chk($('content_partners')))
		{
			$('partners_bg').setStyle('opacity', 0.8);
		}		
		
		if ($chk($$('.content_bg')))
		{
			$$('.content_bg').setStyle('opacity', 0.8);
		}

		if ($chk($$('.content_bg_profile')))
		{
			$$('.content_bg_profile').setStyle('opacity', 0.4);
		}

		if ($chk($$('.hoverThis')))
		{
			$$('.hoverThis').setStyle('opacity', 0.5);
		}		
	}		
	
	function setupDraggableDivs()
	{
		if ($chk($('container_enlargement')))
		{
			var dragEnlargement = new Drag('container_enlargement');
		}
	}	
	
	function setupSlideshows()
	{
		if ($chk($('home_banner')))
		{			
			homeShow = new Slideshow('home_banner', false, {delay: 4000, width: 960, height: 500});
			if(!checkIE())
				showFeatured(0);
		}
		
		if ($chk($('inclusions_banner')))
		{
			var inclusionsShow = new Slideshow('inclusions_banner', false, {delay: 5000, width: 960, height: 580});
		}
		
		if ($chk($('container_home_details')))
		{
			detailsShow = new Slideshow('banner_main', false, {delay: 5000, width: 960, height: 500});
		}
		
		if ($chk($('scrollable_captions')))
		{
			var captionShow = new SimpleSlideShow({
				startIndex: 0,
				slides: $$('.slide_caption')
			});
			
			var play = function() 
			{
				captionShow.forward();
			}
			var timer = play.periodical(6100);	
		}		

		if ($chk($('scrollable_image')))
		{
			imageShow = new SimpleSlideShow({
				startIndex: 0,
				slides: $$('.slide_image')
			});	
			playImage();
		}

		if ($chk($('testimonial_box')))
		{
			testimonialShow = new SimpleSlideShow({
				startIndex: 0,
				slides: $$('.slide_testimonial')
				//currentIndexContainer: 'slideNow', 
				//maxContainer: 'slideMax'
			});
			//playTestimonials();
		}
	}		
	
	//================================================================================================
	// START THIS WHEN PAGE DOM READY
	//================================================================================================		
	window.addEvents({
	
		'domready' : function(e) {
			BrowserDetect.init();
			
			if ($chk($('testimonial_video_box')))
			{
				if ($chk($('videoToPlay')))
				{
					var fileVideo = $('videoToPlay').value;
					createPlayer(fileVideo);
				}			
			}
			else
			{
				if ($chk($('videoToPlay')))
				{
					var fileVideo = $('videoToPlay').value;
					$('container_video').setStyle('display', 'block');
					createPlayer(fileVideo);
					$('container_video').setStyle('display', 'none');				
				}
			}
			
			setupMorphTabs();
			setupActions();
			setupScrollbars();
			setupDraggableDivs();
			setupSlideshows();
			setupOpacity();
			showGalleryTab(1);
			resetDivPositions();
		},
		
		'resize' : function() {

			resetDivPositions();
		}
		
	});
	

//-->