window.onload = function(){
	
	//try{MM_preloadImages('top-header_04.gif','top-header-on_04.gif');}catch(e){}
	
	try{setContentTop();}catch(e){}
	
	try{getInitiate();}catch(e){}
	
	try{
		var spnSelBedrooms =  document.getElementById("spnSelBedrooms");
		if ( spnSelBedrooms != null){
			sendRequest( _afterResetSelects, "cmd=resetSelects&Init=Init", "POST", "/call-vacation-rental-filter.asp", true );
		}		
	}catch(e){
	}
	
	try{resetHeight();}catch(e){}

	try{load();}catch(e){}
}

function resetHeight(){
	
	try{
		
		var heightContent = document.getElementById("tblContent").offsetHeight;
		var heightLeftNav = document.getElementById("left-Nav-links").offsetHeight;
		
		if ( heightLeftNav + 30 > heightContent ) {
			var heightSpace = heightLeftNav + 30 - heightContent;
			document.getElementById("tblSpace").style.height = heightSpace + "px";
		}		
	}catch( e ){
		//window.alert ( e );
	}	
}

function resetChecks(){	
	
	try{
		var checks = document.getElementsByTagName("input");
		var chk, chkId, chkTable, chkField
		if ( checks ){
			for  ( var i = 0; i < checks.length; i++){
				chk = checks[i];
				if (chk.type == 'checkbox' && chk.className == 'filter') {
					chk.checked = false;
				}
			}
		}
	}catch(e){
		window.alert ( "resetChecks :" + e ) ;
	}
}

function setInitValue( aVal, filterValue ){
	try{
		var objCheck = document.getElementById ( "chk__" + aVal + "__" + filterValue );
		objCheck.checked = true;
	}catch(e){
		//window.alert (e + '\n\n' + aVal + '\n\n' + filterValue);
	}
}

function setCheck ( chkName ) {
	try{
		var objCheck = document.getElementById("chk__" + chkName);
		objCheck.checked = !objCheck.checked;
	}catch(e){
	}
	getRequest();
}

function setSession(){
	
	var checks = document.getElementsByTagName("input");
	var chk, chkId, chkTable, chkField
	if ( checks ){
		var data = 'cmd=setSession';
		
		for  ( var i = 0; i < checks.length; i++){
			chk = checks[i];
			if (chk.type == "checkbox" && chk.className == "filter") {
				chkId = (chk.id).split("__");
				if (chkId && chkId.length == 3) {
					chkTable = chkId[1];
					chkField = chkId[2];
					//setProcess ( chkTable + "__" + chkField ) ;
					data = data + "&fields=" + chkTable + "__" + chkField + "__" + chk.checked ;
				}
			}
		}
		//window.alert (data);
		sendRequest( _afterSetSession, data, "POST", "/call-vacation-rental-filter.asp", true );
	}
}

function _afterSetSession( oj ){
	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;		
	}catch(e){
		//window.alert ( "_afterSetSession 1 \n\n" + e ) ; 
	}

	if (result =="ok"){
		//window.alert ( result ) ;
	}
}


function Request(){
	
	var checks = document.getElementsByTagName("input");
	var chk, chkId, chkTable, chkField
	if ( checks ){
		var data = 'cmd=Request';
		
		for  ( var i = 0; i < checks.length; i++){
			chk = checks[i];
			if (chk.type == "checkbox" && chk.className == "filter") {
				chkId = (chk.id).split("__");
				if (chkId && chkId.length == 3) {
					chkTable = chkId[1];
					chkField = chkId[2];
					setProcess ( chkTable + "__" + chkField ) ;
					data = data + "&fields=" + chkTable + "__" + chkField + "__" + chk.checked ;
				}
			}
		}
		//window.alert (data);
		sendRequest( _afterRequest, data, "POST", "/call-vacation-rental-filter.asp", true );
	}
}

function _afterRequest( oj ){
	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;
	}catch(e){
		//window.alert ( "_afterTest 1 \n\n" + e ) ; 
	}

	if (result =="ok"){
		try{
			fields = xmlDoc.getElementsByTagName("fields");
			if ( fields.length > 0 ){
				for ( var i=0 ; i < fields.length ; i++ ){
					var myTable = xmlDoc.getElementsByTagName("fields")[i].attributes.getNamedItem("table").nodeValue;
					var myField = xmlDoc.getElementsByTagName("fields")[i].attributes.getNamedItem("field").nodeValue;
					var myChecked = xmlDoc.getElementsByTagName("fields")[i].attributes.getNamedItem("checked").nodeValue;
					var myValue = xmlDoc.getElementsByTagName("fields")[i].firstChild.nodeValue;
					setStatus ( myTable + '__' + myField, myValue, myChecked );
				}
			}
		}catch(e){
			//window.alert ( "_afterTest 2 \n\n" + e ) ; 
		}finally{
		}
	}
}

function setProcess( Nm ){
	document.getElementById("chk__" + Nm).disabled = true;
	replaceHtml ("spn__" + Nm, "(<img src='/util/ajax/progressImg.gif' style='border:none;'>)" );
}

function setStatus( Nm, Val, Checked ){
	var divName = "div__" + Nm;
	var spnName = "spn__" + Nm;
	var objCheck = document.getElementById("chk__" + Nm);
	
	if ( Checked == 'True'){
		objCheck.checked = true;
	}else{
		objCheck.checked = false;
	}
	
	if (Val == 0){
		document.getElementById ( divName ).style.display="none";
		objCheck.disabled = true;
	}else{
		replaceHtml (spnName, "(" + Val + ")" );
		document.getElementById ( divName ).style.display="block";
		objCheck.disabled = false;
	}
}

function PropertyList(){
	
	var checks = document.getElementsByTagName("input");
	var chk, chkId, chkTable, chkField
	if ( checks ){
		var data = 'cmd=PropertyList';
		
		for  ( var i = 0; i < checks.length; i++){
			chk = checks[i];
			if (chk.type == "checkbox" && chk.className == "filter") {
				chkId = (chk.id).split("__");
				if (chkId && chkId.length == 3) {
					chkTable = chkId[1];
					chkField = chkId[2];
					data = data + "&fields=" + chkTable + "__" + chkField + "__" + chk.checked ;
				}
			}
		}
		try{
		data = data + '&selOrder=' + document.getElementById('selOrder').options[document.getElementById('selOrder').selectedIndex].value;	
		}catch(e){
		}
		//window.alert (data);
	}
	sendRequest( _afterPropertyList, data, "POST", "/call-vacation-rental-filter.asp", true );
}

function _afterPropertyList( oj ){
	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;
	}catch(e){
		//window.alert ( "_afterPropertyList \n\n" + e ) ; 
	}

	if (result =="ok"){
		try{
			replaceHtml('divContent','');

			var newDivNodedivFilterTitle = document.createElement('DIV');
			newDivNodedivFilterTitle.id = "divFilterTitle";
			newDivNodedivFilterTitle.style.align = "left";
			document.getElementById('divContent').appendChild(newDivNodedivFilterTitle);
			
			if ( xmlDoc.getElementsByTagName("Filtered_Title")[0].firstChild.nodeValue != '' ){
				var tmpHTML = "";
				tmpHTML = tmpHTML + "<table width='100%' border='0' cellspacing='0' cellpadding='5'>"
				
				tmpHTML = tmpHTML + "	<tr>"
				tmpHTML = tmpHTML + "		<td align='left' valign='top' colspan='3'>"
				tmpHTML = tmpHTML + "		<h1>Vacation Rental Filter Results</h1>"
				tmpHTML = tmpHTML + xmlDoc.getElementsByTagName("Filtered_Title")[0].firstChild.nodeValue;
				tmpHTML = tmpHTML + "		</td>"
				tmpHTML = tmpHTML + "	</tr>"

				tmpHTML = tmpHTML + "	<tr>"
				tmpHTML = tmpHTML + "		<td align='left' width='50%'>"
				tmpHTML = tmpHTML + "		Found <span class='orange'>";
				tmpHTML = tmpHTML + xmlDoc.getElementsByTagName("Found")[0].firstChild.nodeValue;
				tmpHTML = tmpHTML + "		</span>Rentals</p>"
				tmpHTML = tmpHTML + "	</td>"
				tmpHTML = tmpHTML + "		<td align='right' width='25%'>Order Rentals by</td>"
				tmpHTML = tmpHTML + "		<td align='right' width='25%'>"
				tmpHTML = tmpHTML + xmlDoc.getElementsByTagName("selectHTML")[0].firstChild.nodeValue;
				tmpHTML = tmpHTML + "		</td>";
				tmpHTML = tmpHTML + "	</tr>";

				tmpHTML = tmpHTML + "	<tr>"
				tmpHTML = tmpHTML + "		<td valign='top' align='center' colspan='3'>"
				tmpHTML = tmpHTML + "		<div id='divListTop' class='nn' >"
				tmpHTML = tmpHTML + "		</div>"
				tmpHTML = tmpHTML + "		</td>"
				tmpHTML = tmpHTML + "	</tr>"

				tmpHTML = tmpHTML + "</table>";

				replaceHtml('divFilterTitle', tmpHTML);
			}else{
				var tmpHTML = "";
				tmpHTML = tmpHTML + "<table width='100%' border='0' cellspacing='10' cellpadding='0'>";
				tmpHTML = tmpHTML + "<tr><td align='left' valign='top' width='70%'>";
				tmpHTML = tmpHTML + "<h1>Vacation Rental Filter Results</h1>";
				tmpHTML = tmpHTML + "</td>";
				tmpHTML = tmpHTML + "<td>&nbsp; ";
				tmpHTML = tmpHTML + "</td></tr></table>";
				replaceHtml('divFilterTitle', tmpHTML);
			}
			
			var newDivNodeDetail = document.createElement('DIV');
			newDivNodeDetail.id = "divDetail";
			document.getElementById('divContent').appendChild(newDivNodeDetail);

			var newDivNodeList = document.createElement('DIV');
			newDivNodeList.id = "divList";
			newDivNodeList.className = "nn";
			document.getElementById('divContent').appendChild(newDivNodeList);

			var newDivNodeListSpace = document.createElement('DIV');
			newDivNodeListSpace.id = "divListSpace";
			newDivNodeListSpace.className = "nn";
			document.getElementById('divContent').appendChild(newDivNodeListSpace);
			
			if ( xmlDoc.getElementsByTagName("PropertyId").length > 0){
				addPropertyList    ( xmlDoc.getElementsByTagName("PropertyId"), "divList",    25);
				addPropertyListTop ( xmlDoc.getElementsByTagName("PropertyId"), "divListTop", 25);
			}
		
		}catch(e){
			window.alert ( "_afterPropertyList 2 \n\n" + e ) ; 
		}finally{
		}
	}
}

function addPropertyList( aPropertyId, divName, PROPERTIES_PER_PAGE ){

	try{
		
		var tmpHTML = '';
		var j = 0;
		var k = 0;
		var pids = '';
		
				tmpHTML = tmpHTML + '		<span id="spnPrevious"></span>&nbsp;&nbsp;';
		
		for ( var i=0; i < aPropertyId.length ; i++){
			
			if (pids == ''){
				pids = pids + aPropertyId[i].firstChild.nodeValue ;
			}else{
				pids = pids + ", " + aPropertyId[i].firstChild.nodeValue;
			}
			k = i + 1;				
			if (( k % PROPERTIES_PER_PAGE) == 0){
				j++;
				tmpHTML = tmpHTML + '		<input id="hdn' + j + '" type="hidden" value="' + pids + '">';
				tmpHTML = tmpHTML + '		<span id="spnList' + j + '"></span>&nbsp;';
				if ((j% 20) ==0) {
					tmpHTML = tmpHTML + '<br />';
				} 
				pids = '';
			}
		}

		if (pids !=''){
			j++;
			k = i;
			tmpHTML = tmpHTML + '		<input id="hdn' + j + '" type="hidden" value="' + pids + '">';
			tmpHTML = tmpHTML + '		<span id="spnList' + j + '"></span>&nbsp;';
		}
		
		tmpHTML = tmpHTML + '		<input id="hdnCurrent" type="hidden" value="1">';
		tmpHTML = tmpHTML + '		<input id="hdnLast" type="hidden" value="' + j + '">';
		tmpHTML = tmpHTML + '		<span id="spnNext"></span>';
		
		replaceHtml ( divName, tmpHTML );
		//clickList ( '1' );

	}catch(e){
		//window.alert ( " Error on addPropertyList " + e ) ;
	}finally{
	}
}

function addPropertyListTop( aPropertyId, divName, PROPERTIES_PER_PAGE ){

	try{
		
		var tmpHTML = '';
		var j = 0;
		var k = 0;
		var pids = '';
		
				tmpHTML = tmpHTML + '		<span id="spnPreviousTop"></span>&nbsp;&nbsp;';
		
		for ( var i=0; i < aPropertyId.length ; i++){
			
			if (pids == ''){
				pids = pids + aPropertyId[i].firstChild.nodeValue ;
			}else{
				pids = pids + ", " + aPropertyId[i].firstChild.nodeValue;
			}
			k = i + 1;				
			if (( k % PROPERTIES_PER_PAGE) == 0){
				j++;
				//tmpHTML = tmpHTML + '		<input id="hdn' + j + '" type="hidden" value="' + pids + '">';
				tmpHTML = tmpHTML + '		<span id="spnListTop' + j + '"></span>&nbsp;';
				if ((j% 20) ==0) {
					tmpHTML = tmpHTML + '<br />';
				} 
				pids = '';
			}
		}

		if (pids !=''){
			j++;
			k = i;
			//tmpHTML = tmpHTML + '		<input id="hdn' + j + '" type="hidden" value="' + pids + '">';
			tmpHTML = tmpHTML + '		<span id="spnListTop' + j + '"></span>&nbsp;';
		}
		
		//tmpHTML = tmpHTML + '		<input id="hdnCurrent" type="hidden" value="1">';
		//tmpHTML = tmpHTML + '		<input id="hdnLast" type="hidden" value="' + j + '">';
		tmpHTML = tmpHTML + '		<span id="spnNextTop"></span>';
		
		replaceHtml ( divName, tmpHTML );
		clickList ( '1' );

	}catch(e){
		//window.alert ( " Error on addPropertyListTop " + e ) ;
	}finally{
	}
}

function clickList ( CurListId ) {
	
	setStatusList ( CurListId, document.getElementById("hdnLast").value );
	document.getElementById("hdnCurrent").value = CurListId;
	callList (document.getElementById("hdn"+CurListId).value);
}

function setStatusList( CurListId, LastListId ){

	var tmpListId = 1;

	for ( var j=0; j <= LastListId ; j++ ){
		replaceHtml ('spnList' + j, '<a href="javascript:void(0);" onclick="javascript:clickList(' + j + ');">' + j + '</a>');
		replaceHtml ('spnListTop' + j, '<a href="javascript:void(0);" onclick="javascript:clickList(' + j + ');">' + j + '</a>');
	}
	
	replaceHtml ('spnList' + CurListId, '<span class="orange">' + CurListId + '</span>');
	replaceHtml ('spnListTop' + CurListId, '<span class="orange">' + CurListId + '</span>');
	
	if ( CurListId == 1 ){
		replaceHtml ('spnPrevious', '');
		replaceHtml ('spnPreviousTop', '');
	}else{
		tmpListId = parseInt(CurListId) - 1;
		replaceHtml ('spnPrevious', '<a href="javascript:void(0);" onclick="javascript:clickList(' + tmpListId + ');">&lt;&lt;Previous</a> | ');
		replaceHtml ('spnPreviousTop', '<a href="javascript:void(0);" onclick="javascript:clickList(' + tmpListId + ');">&lt;&lt;Previous</a> | ');
	}

	if ( CurListId == LastListId ){
		replaceHtml ('spnNext', '');
		replaceHtml ('spnNextTop', '');
	}else{
		tmpListId = parseInt(CurListId) + 1;
		replaceHtml ('spnNext', ' | <a href="javascript:void(0);" onclick="javascript:clickList(' + tmpListId + ');">Next&gt;&gt;</a>');
		replaceHtml ('spnNextTop', ' | <a href="javascript:void(0);" onclick="javascript:clickList(' + tmpListId + ');">Next&gt;&gt;</a>');
	}
}

function callList( sLists ) {
	
	replaceHtml ( 'divDetail', '' );
	
	var aArg = sLists.split(",");	
	for ( var i=0; i < aArg.length; i++){
		getPropertyDetail (aArg[i]);
	}
}

function getPropertyDetail( vPropertyId ){

	var data = "cmd=PropertyDetail";
	data = data + "&PropertyId=" + vPropertyId;
	sendRequest( _afterPropertyDetail, data, "POST", "/call-vacation-rental-filter.asp", true );
}

function _afterPropertyDetail( oj ) {

	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;		
		
		if ( result == "ok" ){
			var PropertyId = xmlDoc.getElementsByTagName("PropertyId")[0].firstChild.nodeValue;
			var PropertyName = xmlDoc.getElementsByTagName("PropertyName")[0].firstChild.nodeValue;
			var HotelCode = xmlDoc.getElementsByTagName("HotelCode")[0].firstChild.nodeValue;
			var HotelName = xmlDoc.getElementsByTagName("HotelName")[0].firstChild.nodeValue;
			
			var PropertyPicture = xmlDoc.getElementsByTagName("PropertyPicture")[0].firstChild.nodeValue;			
			var MasterBedroomA = xmlDoc.getElementsByTagName("MasterBedroomA")[0].firstChild.nodeValue;
			var LivingRoomA = xmlDoc.getElementsByTagName("LivingRoomA")[0].firstChild.nodeValue;
			var KitchenA = xmlDoc.getElementsByTagName("KitchenA")[0].firstChild.nodeValue;
			var DiningRoomA = xmlDoc.getElementsByTagName("DiningRoomA")[0].firstChild.nodeValue;
			var PatioPoolA = xmlDoc.getElementsByTagName("PatioPoolA")[0].firstChild.nodeValue;
			var View1 = xmlDoc.getElementsByTagName("View1")[0].firstChild.nodeValue;
			
			var Location = xmlDoc.getElementsByTagName("Location")[0].firstChild.nodeValue;
			var PropertyType = xmlDoc.getElementsByTagName("PropertyType")[0].firstChild.nodeValue;
			var Bedrooms = xmlDoc.getElementsByTagName("Bedrooms")[0].firstChild.nodeValue;
			var Bathrooms = xmlDoc.getElementsByTagName("Bathrooms")[0].firstChild.nodeValue;
			var Sleeps = xmlDoc.getElementsByTagName("Sleeps")[0].firstChild.nodeValue;
			
			var MinRate = xmlDoc.getElementsByTagName("MinRate")[0].firstChild.nodeValue;
			var MaxRate = xmlDoc.getElementsByTagName("MaxRate")[0].firstChild.nodeValue;

			var RateCode = xmlDoc.getElementsByTagName("RateCode")[0].firstChild.nodeValue;
			
			
		}else{
			//window.alert ( result);
		}
	
		addPropertyDetail ( 
				PropertyId, PropertyName, HotelCode, HotelName, 
				PropertyPicture, MasterBedroomA, LivingRoomA, 
				KitchenA, DiningRoomA, PatioPoolA, View1, 
				Location, PropertyType, Bedrooms, Bathrooms, Sleeps, 
				MinRate, MaxRate, RateCode) ;
	
	}catch(e){
		//window.alert ( '7 ' + e ) ; 
	}finally{
		//replaceHtml ("spnCreateAccount"+BusinessId, "");
	}
}

function addPropertyDetail( 
			vPropertyId, PropertyName, HotelCode, HotelName, 
				PropertyPicture, MasterBedroomA, LivingRoomA, 
				KitchenA, DiningRoomA, PatioPoolA, View1, 
				Location, PropertyType, Bedrooms, Bathrooms, Sleeps, 
				MinRate, MaxRate, RateCode){

	try{
	var newDivNode = document.createElement('DIV');
	newDivNode.id = "div" + vPropertyId;
	document.getElementById('divDetail').appendChild(newDivNode);

	var tmpHTML = '';
	tmpHTML = tmpHTML + '<a name="label' + vPropertyId + '"></a> ';
	tmpHTML = tmpHTML + '<table width="100%" border="0" cellspacing="8" cellpadding="0"> ';
	tmpHTML = tmpHTML + '	<tr> ';
	tmpHTML = tmpHTML + '		<td class="lightT"> ';
	tmpHTML = tmpHTML + '<table width="531px" border="0" cellspacing="0" cellpadding="5">  ';
	tmpHTML = tmpHTML + '	<tr>  ';
	tmpHTML = tmpHTML + '		<td colspan="3" style="background-image:url(/images/listing-header.png);"><a href="resort-rental-property-detail.asp?rental-id=' + HotelCode + '" class="nav3">' + HotelName + '</a></td>  ';
	tmpHTML = tmpHTML + '	</tr>  ';
	tmpHTML = tmpHTML + '	<tr class="midT">  ';
	tmpHTML = tmpHTML + '		<td colspan="3"><h2>' + PropertyName + '</h2></td>  ';
	tmpHTML = tmpHTML + '	</tr>  ';
	tmpHTML = tmpHTML + '	<tr>  ';
	tmpHTML = tmpHTML + '		<td width="260" valign="top"><a href=" # "class="articleAlso">  ';
	if (PropertyPicture !=''){
	tmpHTML = tmpHTML + '			<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="articleAlso"><img src="/images/uploads/' + PropertyPicture + '"  border=0 width=260 height=159 alt="' + PropertyName + '" name="rental' + vPropertyId + '"></a>  ';
	}else{
	tmpHTML = tmpHTML + '			<h2 align="center">No Picture <br />Available</h2>  ';
	}
	tmpHTML = tmpHTML + '		</td>  ';

	tmpHTML = tmpHTML + '		<td valign="top" width="180">  ';
	tmpHTML = tmpHTML + '			<li style="margin-left:5px;"><a href="vacation-rental-property.asp?rental-id=' + vPropertyId + '" class="nav">Rental Overview </a></li>  ';
	tmpHTML = tmpHTML + '		  <li style="margin-left:5px;"><a href="vacation-rental-amenities.asp?rental-id=' + vPropertyId + '" class="nav">Amenities </a></li>  ';
	tmpHTML = tmpHTML + '		  <li style="margin-left:5px;"><a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="nav">Photo Gallery</a></li>  ';
	tmpHTML = tmpHTML + '		  <li style="margin-left:5px;"><a href="attractions-entertainment.asp?rental-id=' + vPropertyId + '" class="nav">Resort Info</a></li>  ';
	if ( RateCode == 'PD1' ){
	tmpHTML = tmpHTML + '		  <li style="margin-left:5px;"><a href="vacation-rental-special.asp?rental-id=' + vPropertyId + '" class="navspecial">Online Special</a></li>  ';
	}
	tmpHTML = tmpHTML + '		  <br /><br />';
	tmpHTML = tmpHTML + '		  <a href="https://www.aspenrentalplaces.com/vacation-rental-request.asp?rental-id=' + vPropertyId + '"><img src="/images/book-now.png" width="102" height="17" border="0" /></a>  ';
	tmpHTML = tmpHTML + '		  <br />';
	tmpHTML = tmpHTML + '		  <a href="mywishlist.asp?propertyID=' + vPropertyId + '"><img src="/images/add-to-wishlist.png" width="102" height="17" border="0" /></a>';
	tmpHTML = tmpHTML + '		</td>  ';
	tmpHTML = tmpHTML + '		<td align="center" valign="top" width="120">  ';
	tmpHTML = tmpHTML + '		  <table width="110px" class="midT">  ';
	tmpHTML = tmpHTML + '				<tr>  ';
	tmpHTML = tmpHTML + '					<td align=center>  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<h2>RESERVATIONS</h2>  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<font face="Arial, Helvetica, sans-serif" size="2">By Phone  ';
	tmpHTML = tmpHTML + '						<br /><b>(877) 818-9205<b></font>  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<font face="Arial, Helvetica, sans-serif" size="2">  ';
	tmpHTML = tmpHTML + '						<b><a href="https://www.aspenrentalplaces.com/vacation-rental-request.asp?rental-id=' + vPropertyId + '" style="text-decoration:underline;">Book Online</a><b></font>  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '						<br />  ';
	tmpHTML = tmpHTML + '					</td>  ';
	tmpHTML = tmpHTML + '				</tr>  ';
	tmpHTML = tmpHTML + '			</table>  ';
	tmpHTML = tmpHTML + '		</td>  ';
	tmpHTML = tmpHTML + '	</tr>  ';
	

	tmpHTML = tmpHTML + '		<tr>  ';
	tmpHTML = tmpHTML + '			<td colspan="3" class="darkT" align="center">';
	
	if (PropertyPicture !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + PropertyPicture + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + PropertyPicture + '" width="66px" height="47px" border="0" alt="Vacation Rental Picture">  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	if (MasterBedroomA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + MasterBedroomA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + MasterBedroomA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>   ';
	}
	if (LivingRoomA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + LivingRoomA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + LivingRoomA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>   ';
	}
	if (KitchenA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"	class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + KitchenA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + KitchenA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>   ';
	}
	if (DiningRoomA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + DiningRoomA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + DiningRoomA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	if (PatioPoolA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + PatioPoolA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + PatioPoolA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	if (View1 !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"	class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + View1 + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + View1 + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	tmpHTML = tmpHTML + '			</td>  ';
	tmpHTML = tmpHTML + '		</tr>  ';
	tmpHTML = tmpHTML + '		<tr>  ';
	tmpHTML = tmpHTML + '			<td colspan="3" align="center"> <font face="Arial, Helvetica, sans-serif" size="1">Mouse Over Thumbnail for larger view</font>  ';
	tmpHTML = tmpHTML + '			</td>  ';
	tmpHTML = tmpHTML + '		</tr>  ';
	tmpHTML = tmpHTML + '	</table>  ';
	tmpHTML = tmpHTML + '	</td>  ';


	tmpHTML = tmpHTML + '	  ';
	tmpHTML = tmpHTML + '	  ';	
	
	tmpHTML = tmpHTML + '	<td width="170px" align="center" class="darkT" valign="top">  ';
	tmpHTML = tmpHTML + '	<p>&nbsp;</p>  ';
	tmpHTML = tmpHTML + '	<table border=0 width=160 cellspacing=1 cellpadding=10 align=center>  ';
	tmpHTML = tmpHTML + '		<tr valign=top id="light">  ';
	tmpHTML = tmpHTML + '			<td colspan=2 align=left class="featureCopy lightT">  ';
	tmpHTML = tmpHTML + '				<b> Vacation Rental Features</b>  ';
	tmpHTML = tmpHTML + '				<br />  ';
	tmpHTML = tmpHTML + '					Location: ' + Location + '<br />  ';
	tmpHTML = tmpHTML + '					Type: ' + PropertyType + '<br />  ';
	tmpHTML = tmpHTML + '					Bedrooms: ' + Bedrooms + '<br />  ';
	tmpHTML = tmpHTML + '					Bathrooms: ' + Bathrooms + '<br />  ';
	tmpHTML = tmpHTML + '					Sleeps: ' + Sleeps + ' ';
	tmpHTML = tmpHTML + '			</td>  ';
	tmpHTML = tmpHTML + '		</tr>  ';
	tmpHTML = tmpHTML + '		<tr valign=top>  ';
	tmpHTML = tmpHTML + '			<td colspan=2 align=center class="featureCopy" bgcolor="#FFFFFF">  ';
	tmpHTML = tmpHTML + '					<b> Rental Rate/Night: :</b><br />  ';
	tmpHTML = tmpHTML + '						$' + MinRate + ' -$' + MaxRate + ' ';
	tmpHTML = tmpHTML + '				</td>  ';
	tmpHTML = tmpHTML + '			</tr>  ';
	tmpHTML = tmpHTML + '		</table>  ';
	tmpHTML = tmpHTML + '		</td>  ';
	tmpHTML = tmpHTML + '		<td bgcolor="#FFFFFF" width="5px"></td>  ';
	tmpHTML = tmpHTML + '	</tr>  ';
	tmpHTML = tmpHTML + '</table>  ';
	tmpHTML = tmpHTML + '		</td>  ';
	tmpHTML = tmpHTML + '	</tr> ';
	tmpHTML = tmpHTML + '</table>  ';

	replaceHtml ( 'div' + vPropertyId, tmpHTML ) ;
	}catch(e){
		window.alert (e);
	}
}

/*
function addPropertyDetail_backup( 
			vPropertyId, ZonderID, PropertyPicture, PropertyName, //CompanyURL, 
			AdPhone, MasterBedroomA, LivingRoomA, 
			KitchenA, DiningRoomA, PatioPoolA, 
			View1, Location, ViewName, 
			PropertyType, Bedrooms, Bathrooms, 
			Sleeps, MinRate, MaxRate, RateSelect, wishHTML ){

	try{
	var newDivNode = document.createElement('DIV');
	newDivNode.id = "div" + vPropertyId;
	document.getElementById('divDetail').appendChild(newDivNode);

	var tmpHTML = '';
	tmpHTML = tmpHTML + '<a name="label' + vPropertyId + '"></a> ';
	tmpHTML = tmpHTML + '<table width="100%" border="0" cellspacing="8" cellpadding="0">  ';
	tmpHTML = tmpHTML + '	<tr>  ';
	tmpHTML = tmpHTML + '		<td class="lightT">  ';
	tmpHTML = tmpHTML + '		<table width="100%" border="0" cellspacing="0" cellpadding="5">  ';
	tmpHTML = tmpHTML + '			<tr align="left">  ';
	tmpHTML = tmpHTML + '				<td width="260px" valign="top">  ';
	if (PropertyPicture !=''){
	tmpHTML = tmpHTML + '					<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="articleAlso">  ';
	tmpHTML = tmpHTML + '					<img src="/images/uploads/' + PropertyPicture + '" border=0 width=260 height=159 alt="' + PropertyName + '" name="rental' + vPropertyId + '"></a>  ';
	}else{
	tmpHTML = tmpHTML + '					<h2 align="center">No Picture <br />Available</h2>  ';
	}
	
	tmpHTML = tmpHTML + '				</td>  ';
	tmpHTML = tmpHTML + '				<td valign="top" width="180px"><h2>' + PropertyName + '</h2>';
	tmpHTML = tmpHTML + '					<br />';
	tmpHTML = tmpHTML + '					<li style="margin-left:5px;"><a href="vacation-rental-property.asp?rental-id=' + vPropertyId + '" class="nav">Property Overview</a></li>';
	tmpHTML = tmpHTML + '					<li style="margin-left:5px;"><a href="vacation-rental-amenities.asp?rental-id=' + vPropertyId + '" class="nav">Amenities</a></li>';
	tmpHTML = tmpHTML + '					<li style="margin-left:5px;"><a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="nav">Photo Gallery</a></li>';
	tmpHTML = tmpHTML + '					<li style="margin-left:5px;"><a href="attractions-entertainment.asp?rental-id=' + vPropertyId + '" class="nav">Sports & Activities</a></li>';
	tmpHTML = tmpHTML + '					<br />';
	tmpHTML = tmpHTML + '					<a href="vacation-rental-request.asp?rental-id=' + vPropertyId + '"><img src="/images/book-now.png" width="102" height="17" border="0" /></a>';
	tmpHTML = tmpHTML + '					<br />';
	tmpHTML = tmpHTML + '					' + wishHTML + '';
	
	tmpHTML = tmpHTML + '				</td>  ';
	
	tmpHTML = tmpHTML + '				<td align="center" valign="top" width="120px">';
	tmpHTML = tmpHTML + '				<table width="110" class="midT">';
	tmpHTML = tmpHTML + '					<tr>';
	tmpHTML = tmpHTML + '						<td align=center><h2>RESERVATIONS</h2>';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<font face="Arial, Helvetica, sans-serif" size="2">Property Code';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<b>56-' + ZonderID + '</b>';
	tmpHTML = tmpHTML + '						</font>';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<font face="Arial, Helvetica, sans-serif" size="2">By Phone';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<b>' + AdPhone + '<b></font>';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '						<font face="Arial, Helvetica, sans-serif" size="2">';
	tmpHTML = tmpHTML + '						<b><a href="vacation-rental-request.asp?rental-id=' + vPropertyId + '" >By Email</a></b><br />';
	tmpHTML = tmpHTML + '						<br />';
	tmpHTML = tmpHTML + '					</td>';
	tmpHTML = tmpHTML + '				</tr>';
	tmpHTML = tmpHTML + '			</table>';
	tmpHTML = tmpHTML + '			</td>';
	tmpHTML = tmpHTML + '		</tr>';

	tmpHTML = tmpHTML + '		<tr>  ';
	tmpHTML = tmpHTML + '			<td colspan="3" class="darkT" align="center">';
	
	if (PropertyPicture !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + PropertyPicture + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + PropertyPicture + '" width="66px" height="47px" border="0" alt="Vacation Rental Picture">  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	if (MasterBedroomA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + MasterBedroomA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + MasterBedroomA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>   ';
	}
	if (LivingRoomA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '" class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + LivingRoomA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + LivingRoomA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>   ';
	}
	if (KitchenA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"	class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + KitchenA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + KitchenA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>   ';
	}
	if (DiningRoomA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + DiningRoomA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + DiningRoomA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	if (PatioPoolA !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + PatioPoolA + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + PatioPoolA + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	if (View1 !=''){
	tmpHTML = tmpHTML + '				<a href="vacation-rental-photo-gallery.asp?rental-id=' + vPropertyId + '"	class="articleAlso" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'rental' + vPropertyId + '\',\'\',\'/images/uploads/' + View1 + '\',1)">  ';
	tmpHTML = tmpHTML + '				<img src="/images/uploads/' + View1 + '" width=66 height=47 border=0 >  ';
	tmpHTML = tmpHTML + '				</a>  ';
	}
	tmpHTML = tmpHTML + '			</td>  ';
	tmpHTML = tmpHTML + '		</tr>  ';
	tmpHTML = tmpHTML + '		<tr>  ';
	tmpHTML = tmpHTML + '			<td colspan="3" align="center"> <font face="Arial, Helvetica, sans-serif" size="1">Mouse Over Thumbnail for larger view</font>  ';
	tmpHTML = tmpHTML + '			</td>  ';
	tmpHTML = tmpHTML + '		</tr>  ';
	tmpHTML = tmpHTML + '	</table>  ';
	tmpHTML = tmpHTML + '	</td>  ';
	tmpHTML = tmpHTML + '	  ';
	tmpHTML = tmpHTML + '	  ';
	tmpHTML = tmpHTML + '	<td width="170px" align="center" class="midT" valign="top">  ';
	tmpHTML = tmpHTML + '	<p>&nbsp;</p>  ';
	tmpHTML = tmpHTML + '	<table border=0 width=160 cellspacing=1 cellpadding=10 align=center>  ';
	tmpHTML = tmpHTML + '		<tr valign=top id="light">  ';
	tmpHTML = tmpHTML + '			<td colspan=2 align=left class="featureCopy lightT">  ';
	tmpHTML = tmpHTML + '				<b> Vacation Rental Features</b><br />  ';
	tmpHTML = tmpHTML + '					Location: ' + Location + '<br />  ';
	tmpHTML = tmpHTML + '					Type: ' + PropertyType + '<br />  ';
	tmpHTML = tmpHTML + '					Bedrooms: ' + Bedrooms + '<br />  ';
	tmpHTML = tmpHTML + '					Bathrooms: ' + Bathrooms + '<br />  ';
	tmpHTML = tmpHTML + '					Sleeps: ' + Sleeps + ' ';
	tmpHTML = tmpHTML + '			</td>  ';
	tmpHTML = tmpHTML + '		</tr>  ';
	tmpHTML = tmpHTML + '		<tr valign=top>  ';
	tmpHTML = tmpHTML + '			<td colspan=2 align=center class="featureCopy" bgcolor="#FFFFFF">  ';
	tmpHTML = tmpHTML + '					<b> Rental Rate/' + RateSelect + ':</b><br />  ';
	tmpHTML = tmpHTML + '						$' + MinRate + ' -$' + MaxRate + ' ';
	tmpHTML = tmpHTML + '				</td>  ';
	tmpHTML = tmpHTML + '			</tr>  ';
	tmpHTML = tmpHTML + '		</table>  ';
	tmpHTML = tmpHTML + '		</td>  ';
	tmpHTML = tmpHTML + '	</tr>  ';
	tmpHTML = tmpHTML + '</table>  ';

	replaceHtml ( 'div' + vPropertyId, tmpHTML ) ;
	}catch(e){
		//window.alert (e);
	}
}
*/

function viewLogin( vPropertyId, vSiteURL ){

	var newDivNode = document.createElement('DIV');
	newDivNode.id = "divWishList" + vPropertyId;
	document.getElementById('div' + vPropertyId ).appendChild(newDivNode);

	var tmpHTML = '';
	tmpHTML = tmpHTML + '<table width="100%" border="0" cellspacing="0" cellpadding="5">';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td align="left"><h1> Wish List </h1></td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '</table>';

	tmpHTML = tmpHTML + '<BR>';
	//tmpHTML = tmpHTML + '<form action="login.asp" method="post">';
	tmpHTML = tmpHTML + '<table width="100%" border="0" cellspacing="8" cellpadding="0">';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td class="lightT" colspan="2">';
	tmpHTML = tmpHTML + '		<table width="100%" border="0" cellspacing="0" cellpadding="5">';
	tmpHTML = tmpHTML + '			<tr>';
	tmpHTML = tmpHTML + '				<td align="left"><h2>Sign In or Create a ' + vSiteURL + ' Account</h2>';
	tmpHTML = tmpHTML + '					<p>You\'ll need to have a ' + vSiteURL + ' account to change or create your wish list registry online</p>';
	tmpHTML = tmpHTML + '					<p>&bull; If you\'re new to ' + vSiteURL + ', you can create an account below under &quot;New Online Customers&quot;<br />';
	tmpHTML = tmpHTML + '						&bull; If you already have an account, sign in now under &quot;Returning Online Customers&quot;</p>';
	tmpHTML = tmpHTML + '				</td>';
	tmpHTML = tmpHTML + '			</tr>';
	tmpHTML = tmpHTML + '		</table>';
	tmpHTML = tmpHTML + '		</td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td width="50%" valign="top" class="lightT">';
	tmpHTML = tmpHTML + '		<table width="100%" border="0" cellspacing="0" cellpadding="5">';
	tmpHTML = tmpHTML + '			<tr>';
	tmpHTML = tmpHTML + '				<td class="white-tag darkT" align="left">New Online Customers </td>';
	tmpHTML = tmpHTML + '			</tr>';
	tmpHTML = tmpHTML + '			<tr>';
	tmpHTML = tmpHTML + '				<td align="left"><p>If this is your first purchase from ' + vSiteURL + ',   please click &quot;Continue.&quot;</p></td>';
	tmpHTML = tmpHTML + '			</tr>';
	tmpHTML = tmpHTML + '			<tr>';
	tmpHTML = tmpHTML + '				<td align="left"><a href="new-member.asp"><img src="/images/continue.png" width="84" height="23" border="0" /></a>';
	tmpHTML = tmpHTML + '				</td>';
	tmpHTML = tmpHTML + '			</tr>';
	tmpHTML = tmpHTML + '		</table>';
	tmpHTML = tmpHTML + '		</td>';
	tmpHTML = tmpHTML + '		<td class="midT" valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="5">';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td class="darkT" align="left"><span class="white-tag">Returning Online Customers </span></td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td align="left">If you have an account with ' + vSiteURL + ', please sign in below. </td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td align="left">Email Address </td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td align="left"><input type="text" id="txtEmail' + vPropertyId + '" /><span id="spnEmail' + vPropertyId + '"></span></td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr align="left">';
	tmpHTML = tmpHTML + '		<td>Password</td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td align="left"><input type="password" id="txtPassword' + vPropertyId + '" /><span id="spnPassword' + vPropertyId + '">';
	tmpHTML = tmpHTML + '			&nbsp;<a title="Forgot Password?" href="forgot-password.asp">Forgot your password?</a></span></td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	//tmpHTML = tmpHTML + '		<td class="input" align="left">';
	//tmpHTML = tmpHTML + '			<input type="image" src="/images/signin.png" width="72" height="23">';
	//tmpHTML = tmpHTML + '		</td>';
	tmpHTML = tmpHTML + '		<td class="input" align="left"><a href="javascript:call_login(\'' + vPropertyId + '\');"><img src="/images/signin.png" width="72" height="23" border="0" /></a>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '	<tr>';
	tmpHTML = tmpHTML + '		<td align="left"><p>Your email address will never be sold. It will only be used in accordance with   our <a href="privacy-policy.asp" target="_blank">Privacy Policy</a>.</p></td>';
	tmpHTML = tmpHTML + '	</tr>';
	tmpHTML = tmpHTML + '</table>';
	//tmpHTML = tmpHTML + '</form>';

	replaceHtml ( "divWishList" + vPropertyId, tmpHTML );
}

function addWishList( vPropertyId ){

	var data = "cmd=addWishList";
	data = data + "&PropertyId=" + vPropertyId;
	sendRequest( _afterAddWishList, data, "POST", "/call-vacation-rental-filter.asp", true );
}

function _afterAddWishList( oj ) {

	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;
		if (result =="ok"){
			var vPropertyId = xmlDoc.getElementsByTagName("PropertyId")[0].firstChild.nodeValue;
			replaceHtml ( "spnWish" + vPropertyId, '<a href="mywishlist.asp">added in My Wishlist</a>' );
		}
	}catch(e){
		//window.alert ( '9 ' + e ) ; 
	}
}

function call_login ( vPropertyId ){
	
	var email = document.getElementById( "txtEmail" + vPropertyId).value;
	var passwd = document.getElementById( "txtPassword" + vPropertyId).value;
	
	var data = "cmd=login";
	data = data + "&PropertyId=" + vPropertyId;
	data = data + "&email=" + email;
	data = data + "&passwd=" + passwd;
	
	replaceHtml ("spnEmail" + vPropertyId, "<img src='/util/ajax/progressImg.gif'>" );
	replaceHtml ("spnPassword" + vPropertyId, "<img src='/util/ajax/progressImg.gif'>" );
	
	sendRequest( _afterCall_login, data, "POST", "/call-vacation-rental-filter.asp", true );
}

function _afterCall_login( oj ) {

	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;
		if (result =="ok"){
			clickList ( document.getElementById("hdnCurrent").value );
		
		}else if (result =="fail"){
			
			var vPropertyId = xmlDoc.getElementsByTagName("PropertyId")[0].firstChild.nodeValue;
			
			replaceHtml ("spnEmail" + vPropertyId, "<img src='/util/ajax/alert.gif'>" );
			replaceHtml ("spnPassword" + vPropertyId, "<img src='/util/ajax/alert.gif'> &nbsp;<a href='forgot-password.asp'><font color='#FF0000'>Forgot your password?</font></a>" );
		}
	}catch(e){
		//window.alert ( '10 ' + e ) ;
	}
}


function resetSelects(){
	var data = "cmd=resetSelects"
	data = data + "&selBedrooms=" + document.getElementById("selBedrooms").options[document.getElementById("selBedrooms").selectedIndex].value;
	//data = data + "&selPropertyType=" + document.getElementById("selPropertyType").options[document.getElementById("selPropertyType").selectedIndex].value;
	data = data + "&selLocation=" + document.getElementById("selLocation").options[document.getElementById("selLocation").selectedIndex].value;
	//data = data + "&selView=" + document.getElementById("selView").options[document.getElementById("selView").selectedIndex].value;
	replaceHtml ( 'spnBtnSearch', "<img src='/util/ajax/progressImg.gif'>");
	sendRequest( _afterResetSelects, data, "POST", "/call-vacation-rental-filter.asp", true );
}

function _afterResetSelects( oj ) {
	
	try{
		var xmlDoc  = oj.responseXML;	
		var result = xmlDoc.getElementsByTagName("result")[0].firstChild.nodeValue;
		if (result =="ok"){
			replaceHtml ("spnSelBedrooms", xmlDoc.getElementsByTagName("selBedroomsHTML")[0].firstChild.nodeValue );
			//replaceHtml ("spnSelPropertyType", xmlDoc.getElementsByTagName("selPropertyTypeHTML")[0].firstChild.nodeValue );
			replaceHtml ("spnSelLocation", xmlDoc.getElementsByTagName("selLocationHTML")[0].firstChild.nodeValue );
			//replaceHtml ("spnSelView", xmlDoc.getElementsByTagName("selViewHTML")[0].firstChild.nodeValue );
		}
	}catch(e){
		//window.alert ( e ) ; 
	}finally{		
		replaceHtml ( 'spnBtnSearch', "&nbsp;&nbsp;&nbsp;");	
	}
}

function setContentTop(){
	var itop = getElemTop ( "tblSpace" );
	//var ileft = getElemLeft ( "tblSpace" );
	var newPosElem = document.getElementById("mainContent");
	itop = itop + "px";
	//ileft = ileft + "px";
	newPosElem.style.top = itop;
	//newPosElem.style.left = ileft;
	newPosElem.style.zIndex = 11;
}

function getElemTop( strObj ){
	
	var selectedPosY = 0;
	var theElem = document.getElementById(strObj);
	if ( !theElem ) return;
	while(theElem !=null){
		selectedPosY += theElem.offsetTop;
		theElem = theElem.offsetParent;
	}
	return selectedPosY;
}

function getElemLeft( strObj ){
	
	var selectedPosX = 0;
	var theElem = document.getElementById(strObj);
	if ( !theElem ) return;
	while(theElem !=null){
		selectedPosX += theElem.offsetLeft;
		theElem = theElem.offsetParent;
	}
	return selectedPosX;
}
