// JavaScript Document - disjointed image swaps, image restore, preload images, set PVII td color swap
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7_autoLayers() { //v1.2 by PVII
 var g,b,k,f,args=P7_autoLayers.arguments;
 var a = parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc) {p7c=new Array();document.p7setc=true;
  for (var u=0;u<10;u++) {p7c[u] = new Array();}}
 for(k=0; k<p7c[a].length; k++) {
  if((g=MM_findObj(p7c[a][k]))!=null) {
   b=(document.layers)?g:g.style;b.visibility="hidden";}}
 for(k=1; k<args.length; k++) {
  if((g=MM_findObj(args[k])) != null) {
   b=(document.layers)?g:g.style;b.visibility="visible";f=false;
   for(j=0;j<p7c[a].length;j++) {
    if(args[k]==p7c[a][j]) {f=true;}}
  if(!f) {p7c[a][p7c[a].length++]=args[k];}}}
}




function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII
	obj.style.backgroundColor=pviiColor
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}




function flvFLSS4(){//v1.0
var v1=arguments,v2=v1[0],v3=MM_findObj(v2);if (v3&&v3.LSS7!=null){clearTimeout(v3.LSS7);}}

function flvFLSS3(){//v1.0
var v1=arguments,v2=v1[0],v3=MM_findObj(v2),v4=v1[1],v5='',v6;if (!v3.LSS4.complete){v6="flvFLSS3('"+v2+"',"+v4+")";setTimeout(v6,50);return;}if (v3.LSS3[v4][1]!=""){v5+='<a href="'+v3.LSS3[v4][1]+'"';if (v3.LSS2!=""){v5+=' target="'+v3.LSS2+'"';}v5+='>';}v5+='<img src="'+v3.LSS3[v4][0]+'" border="0" alt="">';if (v3.LSS3[v4][1]!=""){v5+='</a>';}if (v3.LSS3[v4][2]!=""){v5+='<br>'+unescape(v3.LSS3[v4][2]);}if (document.layers){v3.document.open();v3.document.write(v5);v3.document.close();}else {v3.innerHTML=v5;}}

function flvFLSS2(){//v1.0
var v1=arguments,v2=v1[0],v3=MM_findObj(v2),v4=v1[1],v5=v1[2],v6,v7,v8;if (v3&&v3.LSS3){flvFLSS4(v2);if (v4==1){v6=v3.LSS8+1;if (v6>v3.LSS3.length-1){v6=0;if (v3.LSS9==0){return;}}v8=v3.LSS3[v6][0];}else {v6=v3.LSS8-1;if (v6<0){v6=v3.LSS3.length-1;if (v3.LSS9==0){return;}}v8=v3.LSS3[v6][0];}v3.LSS8=v6;if (!document.layers&&!v3.LSS6){v3.LSS4=new Image();}v3.LSS4.src=v8;flvFLSS3(v2,v6);if (v5==1){v7="flvFLSS2('"+v2+"',"+v4+","+v5+")";v3.LSS7=setTimeout(v7,v3.LSS5);}}}

function flvFLSS1(){//v1.0
// Copyright 2003, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=v1[0],v3=MM_findObj(v2),v4,v5;if (v3){v3.LSS5=v1[1];v5=v1[2];v3.LSS9=v1[3];v3.LSS2=v1[4];v3.LSS3=new Array();for (var v6=5;v6<v1.length;v6+=3){v3.LSS3[v3.LSS3.length]=new Array(v1[v6],v1[v6+1],v1[v6+2]);}v3.LSS8=0;v3.LSS6=(navigator.userAgent.toLowerCase().indexOf("netscape6")!=-1);v3.LSS4=new Image();v3.LSS4.src=v1[5];flvFLSS3(v2,0);if (v5){v4="flvFLSS2('"+v2+"',1,"+v5+")";v3.LSS7=setTimeout(v4,v3.LSS5);}}}


function popupAmenity(id) {
	var load = window.open('/amenity/?' + id ,'','scrollbars=yes,menubar=no,height=300,width=300,resizable=yes,toolbar=no,location=no,status=no');
}

function replaceElementWithAJAX( id, url ) {
	var isIE = ( document.implementation.createDocument ) ? false : true;
	var req = isIE ? new ActiveXObject( "MSXML2.XMLHTTP" ) : new XMLHttpRequest();

	req.onreadystatechange = function() {
	    if (req.readyState == 4) {
    	    if (req.status == 200) {
				document.getElementById( id ).innerHTML = req.responseText;
			}
		}
	};

	req.open( 'GET', 'http://' + window.location.hostname + url, true );
	req.send( null );
}
//-->
