
var splashWin


/* ------------------------------------------------ */

function UnLoadWindows()

/*This function closes all the windows when the page closes*/

{

   if ((splashWin) && (!splashWin.closed))
   {
      splashWin.window.close();
   }

}


/* ------------------------------------------------ */



function myPopup2(propNo, img1, img2, features, sizeSquareM, sizeHect, sizeAcres, price, costPerSquareM)
{

UnLoadWindows();

splashWin = window.open('', '_data',
    'height=560,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1');

contents  =  "<HTML>";

contents +=  "<HEAD>";
contents +=  "<TITLE>Quintas Information, Vilcabamba Homes</TITLE>";

contents +=  "<link rel='stylesheet' type='text/css' href='css/style.css' />";

contents +=  "</HEAD>";

contents  =  "<BODY BACKGROUND='images/bg_popup.jpg'>";

contents +=  "<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>";
contents +=  "<TR VALIGN=TOP><TD COLSPAN=4><H3>Property: " + propNo + "</H3></TR>";

contents +=  "<TR VALIGN=TOP><TD>Features:</TD><TD COLSPAN=3>"  + features +  "</TD></TR>";

contents +=  "<TR VALIGN=TOP>"
contents +=  "<TD>Size:</TD>";
contents +=  "<TD>"  + sizeSquareM + " m<FONT SIZE=-1><SUP>2</SUP></FONT></TD>";
contents +=  "<TD>"  + sizeHect + " Hectares</TD>";
contents +=  "<TD>"  + sizeAcres + " Acres</TD>";
contents +=  "</TR>"

contents +=  "<TR VALIGN=TOP>"
contents +=  "<TD>Price:</TD><TD>" + price + "</TD>";
contents +=  "</TR>"
contents +=  "<TR VALIGN=TOP>"
contents +=  "<TD>&nbsp;</TD>";
if ( costPerSquareM == '' )
{
   contents +=  "<TD>&nbsp;</TD>";
}
else
{
   contents +=  "<TD>" + costPerSquareM + " per m<FONT SIZE=-1><SUP>2</SUP></FONT></TD>";
}
contents +=  "</TR>";

contents +=  "<TR><TD COLSPAN=4>A view from the property</TD></TR>";

// Images ---
if ( img1 == '' )
{
   // 
}
else
{
   contents +=  "<TR VALIGN=TOP>";
   contents +=  "<TD COLSPAN=4><IMG SRC='images_prop/" + img1 + "' BORDER=0></TD>";
   contents +=  "</TR>";
}

contents +=  "<TR><TD>&nbsp;</TD></TR>";

// Close Button
contents +=  "<TR VALIGN=TOP><TD COLSPAN=4 ALIGN=RIGHT>";
contents +=  "<form>"; 
contents +=  "<input type='submit' value='Close' onclick='window.close(); return false;'>"; 
contents +=  "</form>"; 
contents +=  "</TD></TR>";


//if ( img2 == '' )
//{
//   // 
//}
//else
//{
//   contents +=  "<TR VALIGN=TOP>";
//   contents +=  "<TD COLSPAN=4><IMG SRC='images_prop/" + img2 + "' BORDER=0></TD>";
//   contents +=  "</TR>";
//}

//// Close linK (not used):
// contents += "<A HREF='#' onclick='window.close(); return false;'>Close</A>"; 

//// Distance holders:
//contents +=  "<TR>"
//contents +=  "<TR><TD WIDTH=65><IMG SRC='../images/distance.gif' WIDTH=65 HEIGHT=1></TD>"
//contents +=  "<TD COLSPAN=3 WIDTH=300><IMG SRC='../images/distance.gif' WIDTH=300 HEIGHT=1></TD>";
//contents +=  "</TR>"

contents +=  "</TABLE>";

contents +=  "</BODY></HTML>";


splashWin.document.writeln(contents);



// Get coordinates
//var e = window.event;
// splashWin.moveTo(e.screenX+20, e.screenY-40);

// Move to top left
splashWin.moveTo(40,40);

// Not big enough, this ignores titlebar, etc: splashWin.resizeTo(250,165);


// Putting the location in the open created a huge window.
/*
splashWin = window.open('', '_data',
    'height=165, width=250,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,screenX=' + e.screenX+20 +',left=' + e.screenX+20 + ',screenY=' + e.screenY-40 + ',top=' + e.screenY-40);
*/


}

/* ------------------------------------------------------------------------------------- */

function myPopupLot(propNo, img1, img2, features, sizeSquareM, sizeAcres, price, costPerSquareM)
{

UnLoadWindows();

splashWin = window.open('', '_data',
    'height=560, width=500, fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');


contents  =  "<HTML>";

contents +=  "<HEAD>";
contents +=  "<TITLE>Lot Information, Vilcabamba Homes</TITLE>";

contents +=  "<link rel='stylesheet' type='text/css' href='css/style.css' />";

contents +=  "</HEAD>";

contents  =  "<BODY BACKGROUND='images/bg_popup.jpg'>";

contents +=  "<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>";
contents +=  "<TR VALIGN=TOP><TD COLSPAN=4><H3>Property: " + propNo + "</H3></TR>";

contents +=  "<TR VALIGN=TOP><TD>Features:</TD><TD COLSPAN=3>"  + features +  "</TD></TR>";

contents +=  "<TR VALIGN=TOP>"
contents +=  "<TD>Size:</TD>";
contents +=  "<TD>"  + sizeSquareM + " m<FONT SIZE=-1><SUP>2</SUP></FONT></TD>";
contents +=  "<TD>"  + sizeAcres + " Acres</TD>";
contents +=  "</TR>"

contents +=  "<TR VALIGN=TOP>"
contents +=  "<TD>Price:</TD><TD>" + price + "</TD>";
contents +=  "</TR>"
contents +=  "<TR VALIGN=TOP>"
contents +=  "<TD>&nbsp;</TD>";
if ( costPerSquareM == '' )
{
   contents +=  "<TD>&nbsp;</TD>";
}
else
{
   contents +=  "<TD>" + costPerSquareM + " per m<FONT SIZE=-1><SUP>2</SUP></FONT></TD>";

}
contents +=  "</TR>";

contents +=  "<TR><TD COLSPAN=4>A view from the property:</TD></TR>";

// Images ---
if ( img1 == '' )
{
   // 
}
else
{
   contents +=  "<TR VALIGN=TOP>";
   contents +=  "<TD COLSPAN=4><IMG SRC='images_prop/" + img1 + "' BORDER=0></TD>";
   contents +=  "</TR>";
}

contents +=  "<TR><TD>&nbsp;</TD></TR>";

// CloseButton
contents +=  "<TR VALIGN=TOP><TD COLSPAN=4 ALIGN=RIGHT>";
contents +=  "<form>"; 
contents +=  "<input type='submit' value='Close' onclick='window.close(); return false;'>"; 
contents +=  "</form>"; 
contents +=  "</TD></TR>";

//// Close linK (not used):
// contents += "<A HREF='#' onclick='window.close(); return false;'>Close</A>"; 

//// Distance holders:
//contents +=  "<TR>"
//contents +=  "<TR><TD WIDTH=65><IMG SRC='../images/distance.gif' WIDTH=65 HEIGHT=1></TD>"
//contents +=  "<TD COLSPAN=3 WIDTH=300><IMG SRC='../images/distance.gif' WIDTH=300 HEIGHT=1></TD>";
//contents +=  "</TR>"

contents +=  "</TABLE>";

contents +=  "</BODY></HTML>";


splashWin.document.writeln(contents);



// Get coordinates
//var e = window.event;
//splashWin.moveTo(e.screenX+20, e.screenY-40);
// Place top Left
splashWin.moveTo(40,40);

// Not big enough, this ignores titlebar, etc: splashWin.resizeTo(250,165);


// Putting the location in the open created a huge window.
/*
splashWin = window.open('', '_data',
    'height=165, width=250,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,screenX=' + e.screenX+20 +',left=' + e.screenX+20 + ',screenY=' + e.screenY-40 + ',top=' + e.screenY-40);
*/


}

// ###############################################################################


function myPopupMusicLink(url)
{

UnLoadWindows();

splashWin = window.open(url, 'mp3',
    'height=200,width=310,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');

}

function myPopunderMusicLink(url)
{

UnLoadWindows();

splashWin = window.open(url, 'mp3',
    'height=200,width=310,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
splashWin.blur();
window.focus();

}

/*
function openpopup(popurl)

{

var winpops=window.open(popurl,"","width=,height=,status,resizable")
winpops.blur()
window.focus()

}
*/

