function openGalleries(AlbumName) { //v2.0
	openDependentScrollWin('/Images/Galleries/' + AlbumName + '/index.html', 'JeffersonPhotoGallery', 650, 550);
}

function openCustomerNotes(CustomerID) { //v2.0
	openDependentScrollWin('/SFA/CRM/CustomerNotes.aspx?CustomerID=' + CustomerID, 'DBINotes', 600, 540);
}

function previewHOAgreement(type, ID) { //v2.0
	openDependentResizableWin('/SFA/Reports/Contracts/HOAgreement.aspx?type=' + type + '&ID=' + ID, 'DBIReport', 640, 480);
}
function testCommunityWebSiteID(WebSiteID) { //v2.0
	if(WebSiteID == '' || WebSiteID == null)
	{
		alert('WebSite ID is blank.');
	}
	else
	{
		window.open('http://www.diyannihomes.com/locations/communitydetails.cfm?id=' +WebSiteID);
	}
}
function openPrivacyPolicy() { //v2.0
	openDependentWin('/Newsletters/PrivacyPolicy.aspx', 'PrivacyPolicy', 244, 379);
}

function openEventDetail(EventID) { //v2.0
	openDependentScrollWin('/Events/EventDetails.aspx?EventID=' + EventID, 'CommunityCalendar', 300, 300);
}

function openGallery(GalleryName, Section, pictureURL) {
    var newwindow = window.open("","myWin","toolbar=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1,height=1");
    with (newwindow){
        var contents="<HTML><HEAD><TITLE>PLAT MAP: "+ GalleryName +"</TITLE></HEAD> \
        <BODY BGCOLOR='#FFFFFF' TEXT='#99CC00' LEFTMARGIN=0 TOPMARGIN=0> \
        <IMG SRC='" + pictureURL + "'onLoad='javascript:if(this.width > 700 || this.height > 500) {window.resizeTo(700,512)} else {window.resizeTo(this.width+30, this.height+30)};'> \
        </BODY></HTML>";
        document.open("text/html");
        document.write(contents);
        document.close();
    }
}

var newwindow;
var wheight = 0, wwidth = 0;

function popitup5(url, title, iwidth, iheight, colour) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+90;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag

function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}