function bhon(obj) {
	obj.innerHTML ='<img src=images/arrow_left_on.jpg>';
}

function bhoff(obj) {
	obj.innerHTML ='<img src=images/arrow_left_off.jpg>';
}

function bbon(obj) {
	obj.src =obj.src.replace("1", "2");
}

function bboff(obj) {
	obj.src =obj.src.replace("2", "1");
}

var fontsize = 13;
var savedFontSize = 13;
//	alert(savedFontSize);

var hasRightVersion = false;
function setFontSize() {
	hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (savedFontSize)
	{
		savedFontSize = Get_Cookie("FontSize");
		if (parseInt(savedFontSize)) fontsize = savedFontSize;
		el = document.getElementsByTagName("body");
		if (el)
		{
			try
			{
				el[0].style.fontSize = fontsize + "px";	
			}
			catch (ex)
			{
				;
			}
			
		}
	}
}

function changeFontSize(direction) {
	el = document.getElementsByTagName("body");
	if (direction == 0)
	{
		el[0].style.fontSize = "13px";
		fontsize = 13;
	} else {
		if (fontsize >= 19 && direction > 0) return true;
		if (fontsize <= 11 && direction < 0) return true;
		fontsize = parseInt(fontsize) + parseInt(direction); 
		el[0].style.fontSize = fontsize + "px";
	}
	direction = 1 - direction;
	Set_Cookie("FontSize", fontsize, 1);
}


function showContactForm(commid) {
//	el = document.getElementById("contactform");
//	el.style.height = "445px";
//	window.location="#footer";
//	alert(commid);
	if (!commid)commid = 1;
	var pageTracker = _gat._getTracker("UA-16842660-1"); 
	pageTracker._trackPageview("/contact-us/community-" + commid); 
	url = "index.php?s=get_contact_form&id=" + commid;
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_showContactForm;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	
}

function  _showContactForm() {
	if(checkReadyState(xmlhttp)) {

		var response = xmlhttp.responseXML.documentElement;
		response.normalize;
		ret=response.getElementsByTagName("frmdata");
		txt= getXMLNode(ret);
		message5("", txt);
	}

}

function submitContactForm(obj) {
//	el = document.getElementById("contactFirstName"); if (!el.value) { alert("First name is required!"); return false; }
//	el = document.getElementById("contactLastName"); if (!el.value) { alert("Last name is required!"); return false; }
//	el = document.getElementById("contactEmail"); if (!el.value) { alert("Email is required!"); return false;}
//	el = document.getElementById("contactComments"); if (!el.value) { alert("Don't forget your question!"); return false;}
	url = "/index.php?s=docontact&" + getForm(obj);
//	window.location = url;
//	return true;
	initObj();
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_submitContactForm;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	txt = "";

}

function _submitContactForm() {
	if(checkReadyState(xmlhttp)) {
		var response = xmlhttp.responseXML.documentElement;
		ret=response.getElementsByTagName("cid");
		commid = getXMLNode(ret);
		txt = "";
		if (commid == 5 || commid == 6)
		{
			txt = '<script type="text/javascript">/* <![CDATA[ */var google_conversion_id = 958831268;var google_conversion_language = "en";var google_conversion_format = "2";var google_conversion_color = "ffffff";var google_conversion_label = "eGZ2CNzjkgMQpLWayQM";var google_conversion_value = 0;/* ]]> */</script><script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"></script><noscript><div style="display:inline;"><img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/958831268/?label=eGZ2CNzjkgMQpLWayQM&amp;guid=ON&amp;script=0"/></div></noscript>';
		}

		message5('Thank You', 'Thank you for your interest in V!VA Retirement Communities.<br>We will contact you within 24 hours regarding your inquiry' + txt, 360);
	}

}

var sliderLeft = 0;
var sliderCount = 4;
var slideInterval;
var slideTimer = 150;
var slideDirection = 0;
var slideStep = 0;
var slideSteps = 0;
var stepDuration = 10;

function slideLeft() {
	if (sliderLeft>=0) return false;
	slideDirection = 1;
	slideSteps = slideTimer/stepDuration;
	slideInterval = setInterval(slide, stepDuration);
}

function slideRight() {
	slideDirection = -1;
	if (sliderLeft <=-290) return false;
	slideSteps = slideTimer/stepDuration;
	slideInterval = setInterval(slide, stepDuration);
}

function slide() {
	slideStep ++;
	if (slideStep > slideSteps)
	{
		slideStep = 0;
		clearInterval(slideInterval);
		return true;
	}
	increment = 290 / slideSteps;
	el=document.getElementById('slider'); 
	sliderLeft = sliderLeft + increment * slideDirection;
	el.style.marginLeft= sliderLeft + 'px';
	
}

function message5(title, msg, wdth, hgth) {
	window.location="#top";
	if (!wdth) wdth="300";
	if (!hgth) hgth="80";
	showOverlay();
	txt = "<table cellpadding='0' cellspacing='0' border='0'style='border-collapse: collapse;'>";
	txt += "<tr><td height='56' width='55' style='border-left: 1px solid #ff6633; border-top: 1px solid #ff6633; background-color: #fff;'>&nbsp;</td><td style='border-top: 1px solid #ff6633;  background-color: #fff;'' align='right'><img src='images/bt_close.jpg' onmouseover='msover3(this)' onmouseout='msout3(this)' style='cursor: pointer;' onclick='closeWait();'></td><td width='62' align='right' valign='top'><img src='images/box_corner_right.gif'></td></tr>";
	txt += "<tr><td width='55' style='border-left: 1px solid #ff6633;  background-color: #fff;'>&nbsp;</td><td class='popup_body' style='width: "+wdth+"px; height: "+hgth+"px;  background-color: #fff;' valign='top' align='left'>";
	if (title)
	{
		msg = "<h1>" + title + "</h1>" + msg;
	}
	txt += msg;
	txt += "</td><td width='62' style='border-right: 1px solid #ff6633; background-color: #fff;'>&nbsp;</td></tr>";
	txt += "<tr><td height='56' width='55' align='left' valign='bottom' style='border: right: 1px solid #fff; ' ><img src='images/box_corner_left.gif' border=0></td><td style='border-bottom: 1px solid #ff6633;  background-color: #fff;'>&nbsp;</td><td style='border-right: 1px solid #ff6633; border-bottom: 1px solid #ff6633;  background-color: #fff;'>&nbsp;</td></tr>";
	txt += "</table>";


	dv = document.getElementById(messageid);
	if (!dv)
	{
		dv = document.createElement("div");

		dv.style.position = "absolute";
		dv.style.display = "block";
		dv.innerHTML = txt;
		opacity(dv, 0);
		dv.style.top = "0px";
		dv.style.left = "0px";
		dv.style.zIndex = overlayZ + 1;	
		dv.style.padding = "0px";
		dv.id = messageid;
		document.body.appendChild(dv);
	} else  {
		dv.innerHTML = txt;
		dv.style.display = "block";
	}
	w = dv.offsetWidth; //if (parseInt(w) == 0) w = 600;
	h = dv.offsetHeight; //if (parseInt(h) == 0) h = 400;
	c = getCenter(w, h);
	dv.style.left = c.x + "px";
	dv.style.top = Math.max(50, c.y) + "px";
	opacity(dv, 100);

}

function doSearch() {
	el = document.getElementById('txtSearch');
	window.location = 'index.php?s=Search&txt=' + el.value;
}

function showEmail() {
	var pageTracker = _gat._getTracker("UA-16842660-1"); 
	pageTracker._trackPageview("/share-page/"); 
	txt = "<p>Know someone who might like to read this page? Let them know!";
	txt += "<br>Enter their name and email and press submit.</p>";
	txt += "<form id='frmSendEmail2'><table cellpadding='0' cellspacing='0' class='sendfriend'>";
	txt += "<tr><td align='right'>Friend's email</td><td align='left'><input type='text' name='sendEmail' id='sendEmail'></td></tr>";
	txt += "<tr><td align='right' width='100'>Friend's name</td><td align='left'><input type='text' name='sendName' id='sendName'></td></tr>";
	txt += "<tr><td align='right'>Your email</td><td align='left'><input type='text' name='sendFromEmail' id='sendFromEmail'></td></tr>";
	txt += "<tr><td align='right'>Message</td><td align='left'><textarea name='sendMessage' id='sendMessage' rows=4 cols=30></textarea></td></tr>";
	txt += "<tr><td align='right'></td><td align='right'><img src='images/bt_submit.png' style=\"cursor: pointer;\" onclick=\"xyz=document.getElementById('frmSendEmail2'); sendEmailFriend(xyz);\"></td></tr>";
	txt += "</table></form>";
	message5('Share this page', txt, 400, 200);
}

function showEmailPlan(plan) {
	var pageTracker = _gat._getTracker("UA-16842660-1"); 
	pageTracker._trackPageview("/share-plan/" + plan); 
	txt = "<p>Know someone who might want to look at this floorplan? Let them know!";
	txt += "<br>Enter their name and email and press submit.</p>";
	txt += "<form id='frmSendEmail2' name='frmSendEmail2'><table cellpadding='0' cellspacing='0' class='sendfriend'>";
	txt += "<tr><td align='right' width='100'>Friend's name</td><td align='left'><input type='text' name='sendName' id='sendName'></td></tr>";
	txt += "<tr><td align='right'>Your email</td><td align='left'><input type='text' name='sendFromEmail' id='sendFromEmail'></td></tr>";
	txt += "<tr><td align='right'>Friend's email</td><td align='left'><input type='text' name='sendEmail' id='sendEmail'></td></tr>";
	txt += "<tr><td align='right'>Plan</td><td align='left'><a href=\"media/suites/"+plan+".pdf\">"+plan+"</a><input type=\"hidden\" value=\""+plan+"\" name=\"sendPlan\"></td></tr>";
	txt += "<tr><td align='right'>Message</td><td align='left'><textarea name='sendMessage' id='sendMessage' rows=4 cols=30></textarea></td></tr>";
	txt += "<tr><td align='right'></td><td align='right'><img src='images/bt_submit.png' style=\"cursor: pointer;\" onclick=\"xyz=document.getElementById('frmSendEmail2'); sendEmailFriend(xyz);\"></td></tr>";
	txt += "</table></form>";
	message5('Share this plan', txt, 400, 200);
}

function sendEmailFriend(obj) {
	el = document.getElementById("sendName"); if (!el.value) { alert("Name is required!"); return false; }
	el = document.getElementById("sendFromEmail"); if (!el.value) { alert("Your Email is required!"); return false;}
	el = document.getElementById("sendEmail"); if (!el.value) { alert("Email is required!"); return false;}
	url = "index.php?s=send_email&" + getForm(obj);
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_sendEmail;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	txt = "";
}

function _sendEmail() {
	if(checkReadyState(xmlhttp)) {
//		closeWait();
//		var response = xmlhttp.responseXML.documentElement;
//		response.normalize;
		message5("Thank you", "Your invitation was sent!");
	}
}


function submitRequest(obj) {
	var pageTracker = _gat._getTracker("UA-16842660-1"); 
	pageTracker._trackPageview("/faq-question/"); 

	el = document.getElementById("contactPhone"); 
	el2 = document.getElementById("contactEmail"); if (el && el2 && !el.value && !el2.value) { alert("You must provide a Phone Number and/or and Email Address for callback purposes!"); return false;}
	url = "index.php?s=send_request&" + getForm(obj);
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_submitRequest;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	txt = "";
}

function _submitRequest() {
	if(checkReadyState(xmlhttp)) {
//		closeWait();
//		var response = xmlhttp.responseXML.documentElement;
//		response.normalize;
		message5('Thank You', 'Thank you for your interest in V!VA Retirement Communities.<br>We will contact you within 24 hours regarding your inquiry', 360);
	}
}

function submitFaq(obj) {

	el = document.getElementById("faqEmail"); if (!el.value) { alert("The Email Address is a required field!"); return false;}
	el = document.getElementById("faqComments"); if (!el.innerHTML) { alert("Don't forget your question!!"); return false;}
	url = "index.php?s=send_faq&" + getForm(obj);
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_submitFaq;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	txt = "";
}


function _submitFaq() {
	if(checkReadyState(xmlhttp)) {
//		closeWait();
//		var response = xmlhttp.responseXML.documentElement;
//		response.normalize;
		message5('Thank You', 'Thank you for your interest in V!VA Retirement Communities.<br>We will contact you within 24 hours regarding your inquiry', 360);
	}
}


function loadGallery(id, galtitle, galdesc) {
	el=document.getElementById('galleryHolder');  if (el) el.style.display = "block";
	el=document.getElementById('videoHolder');  if (el) el.style.display = "none";

	el=document.getElementById('galleryTitle');  el.innerHTML = galtitle;
	el=document.getElementById('galleryDescription');  el.innerHTML = galdesc;

	if (!hasRightVersion)
	{
		txt = '<div style="padding: 20px; width: 350px; text-align: left;"><p>Content on this page requires Adobe Flash. Please download and install this free upgrade by clicking the image below:</p><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div>';
		message2(txt);
		return false;
	}

	el=document.getElementById('galleryHolder'); 
	txt = "";
	txt += '	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="657" height="550" id="swf/gallery" align="middle">';
	txt += '		<param name="allowScriptAccess" value="sameDomain" />';
	txt += '		<param name="allowFullScreen" value="true" />';
	txt += '		<param name="wmode" value="transparent" />';
	txt += '		<param name="flashVars" value="galleryid=' + id + '" />';
	txt += '		<param name="movie" value="/swf/gallery.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="/swf/gallery.swf" wmode="transparent" quality="high" bgcolor="#ffffff" flashVars="galleryid=' + id + '" width="657" height="550" name="swf/gallery" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />';
	txt += '	</object>';
	el.innerHTML = txt;

}

function showCommMenu() {
	dv=document.getElementById('commMenu'); 
	if (!dv)
	{
		el=document.getElementById('topmenu'); 
		px = findPosX(el);
		py = findPosY(el);
		dv = document.createElement("div");
		
		dv.id = 'commMenu';
		dv.style.position = 'absolute';
		dv.style.zIndex = '100';
		dv.style.top = (32 + py) + 'px';
		dv.style.left = (px+0) + 'px';
		dv.style.height="190px";
//		dv.style.borderTopWidth="1px";
//		dv.style.borderTopColor="#ff6600";
//		dv.style.borderTopStyle="solid";
		dv.style.backgroundImage ="url(images/bg_dropdown.gif)";
		dv.onmouseout=hideCommMenu;
		dv.onmouseover=showCommMenu;

		dv.innerHTML = "";
		dv.innerHTML += "<div class='menu-city'>Carleton Place</div>";
		dv.innerHTML += "<div class='menu-comm'><a href='index.php?s=communities&o=waterside'>The Waterside Retirement Community</a></div>";
		dv.innerHTML += "<div class='menu-city'>Mississauga</div>";
		dv.innerHTML += "<div class='menu-comm'><a href='index.php?s=communities&o=mississauga'>V!VA Mississauga</a></div>";

		bdy = document.getElementsByTagName("body");
		bdy[0].appendChild(dv);
	} else {
		dv.style.display= "block";
	}

}

function showCommMenu2() {
	dv=document.getElementById('commMenu'); 
	if (!dv)
	{
		el=document.getElementById('topmenu'); 
		px = findPosX(el);
		py = findPosY(el);
		dv = document.createElement("div");
		
		dv.id = 'commMenu';
		dv.style.position = 'absolute';
		dv.style.zIndex = '100';
		dv.style.top = (32 + py) + 'px';
		dv.style.left = (px+0) + 'px';
		dv.style.height="190px";
//		dv.style.backgroundColor="#ff6600";
		dv.style.backgroundImage ="url(images/bg_dropdown2.gif)";
		dv.onmouseout=hideCommMenu;
		dv.onmouseover=showCommMenu;

		dv.innerHTML = "";
		dv.innerHTML += "<div class='menu-city'>Carleton Place</div>";
		dv.innerHTML += "<div class='menu-comm2'><a href='index.php?s=communities&o=waterside'>The Waterside Retirement Community</a></div>";
		dv.innerHTML += "<div class='menu-city'>Mississauga</div>";
		dv.innerHTML += "<div class='menu-comm2'><a href='index.php?s=communities&o=mississauga'>V!VA Mississauga</a></div>";

		bdy = document.getElementsByTagName("body");
		bdy[0].appendChild(dv);
	} else {
		dv.style.display= "block";
	}

}

function hideCommMenu() {
	dv=document.getElementById('commMenu'); 
	if (dv) dv.style.display= "none";
}

function showAmenity(id) {
//	id = 72;
	url = "index.php?s=get_amenity&id=" + id;
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_showAmenity;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	txt = "";
}

function _showAmenity() {
	if(checkReadyState(xmlhttp)) {

	if (!hasRightVersion)
	{
		txt = '<div style="padding: 20px; width: 350px; text-align: left;"><p>Content on this page requires Adobe Flash. Please download and install this free upgrade by clicking the image below:</p><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div>';
		message2(txt);
		return false;
	}

		var response = xmlhttp.responseXML.documentElement;
		response.normalize;
		ret=response.getElementsByTagName("amenityid");
		id = getXMLNode(ret);
		ret=response.getElementsByTagName("amenitytitle");
		title = getXMLNode(ret);
		ret=response.getElementsByTagName("amenitydescription");
		description = getXMLNode(ret);
		el=document.getElementById('amenityDetails'); 
		txt = "<div style='padding: 0px;'><h2>"+title+"</h2>";
		txt += "<p>"+description+"</p></div>";
		txt += '	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="657" height="550" id="swf/gallery" align="middle">';
		txt += '		<param name="allowScriptAccess" value="sameDomain" />';
		txt += '		<param name="allowFullScreen" value="true" />';
		txt += '		<param name="flashVars" value="galleryid=' + id + '" />';
		txt += '		<param name="wmode" value="transparent" />';
		txt += '		<param name="movie" value="swf/gallery.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="swf/gallery.swf" wmode="transparent" quality="high" bgcolor="#ffffff" flashVars="galleryid=' + id + '" width="657" height="550" name="swf/gallery" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />';
		txt += '	</object>';
		el.innerHTML = txt;
		window.location = "#amenityDetails";
	}

}

 function imageF(path, w, h) {
	 window.location="#top";
	 i = new Image();
	 i.src = path;
	 t = "<img ";
	 if (w) t += " width=\"" + w + "\" ";
	 if (h) t += " width=\"" + h + "\" ";
	 t += " src='"+path+"'>";
	 i.onload = function () {message2(t)};
//	 message2(t);
 }


function preloadImages(collection) {
	imgholder = new Image();
	for(x in collection)
	{
		imgholder.src = collection[x];
	}
}

function showFaq(x,y) {
	for (i=1;i<=y ; i++)
	{
		el=document.getElementById('a' + i); 
		el.style.display = 'none';
	}
		el=document.getElementById('a' + x); 
		el.style.display = 'block';
}

function showRegisterForm() {
	window.location='index.php?s=communities&o=mississauga&m=register';
}

var blogEntries= [];
function showCorpBlog(blogid) {
	for (i in blogEntries)
	{
		el=document.getElementById('details-' + blogEntries[i]); 
		if (el) el.style.display = 'none';
		el2=document.getElementById('summary-' + blogEntries[i]); 
		if (el2) el2.style.display = 'block';
	}
		el=document.getElementById('details-' + blogid); 
		if (el) {
			el.style.display = 'block';
			el.style.innerHTML = '<img src="_common/images/ajax/indicator_snake.gif">';
		}
	url = "index.php?s=get_blog&id=" + blogid;
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_showCorpBlog;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}


}

function closeBlog() {
	for (i in blogEntries)
	{
		el=document.getElementById('details-' + blogEntries[i]); 
		if (el) el.style.display = 'none';
		el2=document.getElementById('summary-' + blogEntries[i]); 
		if (el2) el2.style.display = 'block';
	}
}
function  _showCorpBlog() {
	if(checkReadyState(xmlhttp)) {

		var response = xmlhttp.responseXML.documentElement;
		response.normalize;
		ret=response.getElementsByTagName("blogdata");
		txt= getXMLNode(ret);
		ret=response.getElementsByTagName("blogid");
		el=document.getElementById('details-' + getXMLNode(ret)); 
		el.innerHTML = txt;
		el2=document.getElementById('summary-' + getXMLNode(ret)); 
		if (el2) el2.style.display = 'none';

	}

}

function showNewsItem(blogid) {
	for (i in blogEntries)
	{
		el=document.getElementById('details-' + blogEntries[i]); 
		if (el) el.style.display = 'none';
		el2=document.getElementById('summary-' + blogEntries[i]); 
		if (el2) el2.style.display = 'block';
	}
		el=document.getElementById('details-' + blogid); 
		if (el) {
			el.style.display = 'block';
			el.style.innerHTML = '<img src="_common/images/ajax/indicator_snake.gif">';
		}
	url = "index.php?s=get_news&id=" + blogid;
//	showWait();
	initObj();
//	alert(url);return false;
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_showNewsItem;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}


}


function  _showNewsItem() {
	if(checkReadyState(xmlhttp)) {

		var response = xmlhttp.responseXML.documentElement;
		response.normalize;
		ret=response.getElementsByTagName("blogdata");
		txt= getXMLNode(ret);
		ret=response.getElementsByTagName("blogid");
		el=document.getElementById('details-' + getXMLNode(ret)); 
		el.innerHTML = txt;
		el2=document.getElementById('summary-' + getXMLNode(ret)); 
		if (el2) el2.style.display = 'none';

	}

}
function showVictoryGardens() {
	txt = "<br><img src='images/lifestyle-victory-garden.jpg'><br><br>Raised garden beds make is easy and pain-free for gardening enthusiasts to exercise their green thumbs!";
	message5("V!VA Victory Garden", txt, 710, 450);
}

function showSuite(suite, height) {
//630/780
//	if (!hasRightVersion)
//	{
//		txt = '<div style="padding: 20px; width: 350px; text-align: left;"><p>Content on this page requires Adobe Flash. Please download and install this free upgrade by clicking the image below:</p><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div>';
//		message2(txt);
//		return false;
//	}
	txt = "";
	txt += '	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="650"  height="'+height+'" id="swf/'+suite+'" align="middle">';
	txt += '		<param name="allowScriptAccess" value="sameDomain" />';
	txt += '		<param name="allowFullScreen" value="true" />';
	txt += '		<param name="wmode" value="transparent" />';
	txt += '		<param name="movie" value="swf/'+suite+'.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="swf/'+suite+'.swf" wmode="transparent" quality="high" bgcolor="#ffffff"  width="650" height="'+height+'" name="swf/'+suite+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />';
	txt += '	</object>';
	showOverlay();
	box(txt, 650,height);

}

function showAmenityFloor() {
	height=600;
	if (!hasRightVersion)
	{
		txt = '<div style="padding: 20px; width: 350px; text-align: left;"><p>Content on this page requires Adobe Flash. Please download and install this free upgrade by clicking the image below:</p><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div>';
		message2(txt);
		return false;
	}

	txt = "<div style='width: 1000px; height: 700px; background-color: #ff0000'>";
	txt += '	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="850"  height="'+height+'" id="amenities_waterside" align="middle">';
	txt += '		<param name="allowScriptAccess" value="sameDomain" />';
	txt += '		<param name="allowFullScreen" value="true" />';
	txt += '		<param name="wmode" value="transparent" />';
	txt += '		<param name="movie" value="amenities_waterside.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="amenities_waterside.swf" wmode="transparent" quality="high" bgcolor="#ffffff"  width="850" height="'+height+'" name="amenities_waterside" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />';
	txt += '	</object></div>';
	x = document.getElementsByTagName("body");
	x[0].innerHTML = txt;
	return true;
	showOverlay();
	box(txt, 650,height);

}

function loadSlide(slideid) {
 el = document.getElementById("slideholder");
 el.src="images/home-slide" + slideid + ".jpg";
 if (slideid == 1 || slideid == 5) {
	 el = document.getElementById("contactButton");
	 el.onclick=null;
	 if (slideid == 5) window.location='/communities/mississauga/mississauga/register/';
 } else {
	 el = document.getElementById("contactButton");
	 el.onclick=showContactForm;
 }
}

var videoPlaylist = [];
videoPlaylist[0] = "66X3srtGW34";
videoPlaylist[1] = "ZHLHbAKiEYA";
videoPlaylist[2] = "nxhO4KneNJ4";
videoPlaylist[3] = "kjoGnqPu0Jo";
videoPlaylist[4] = "WkVYNtDriK8";
videoPlaylist[5] = "HQZFndpjdz8";
videoPlaylist[6] = "fVo_JJcpkCg";

function loadVideo(id,galleryTitle) {
	el=document.getElementById('galleryHolder');  if (el) el.style.display = "none";
	el=document.getElementById('videoHolder');  
	el.innerHTML = '<object style="height: 390px; width: 640px"><param name="movie" value="http://www.youtube.com/v/'+videoPlaylist[id]+'?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/'+videoPlaylist[id]+'?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></object>';
	if (el) el.style.display = "block";
	el=document.getElementById('galleryTitle');  el.innerHTML = galleryTitle;

}
