<!--
function MM_swapImgRestore() {
  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() {
  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 MM_findObj(n, d) {
  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 MM_swapImage() {
  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];}
}

var newWin;
function OpenApp() {
	newWin = window.open('https://secure.resiteit.com/apps/?cid=1407','App','toolbar=no, location=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=640 ,height=400');
}

function PopupLink(obj, features)
{
    /*
    This function opens a hyperlink in a new window with the specifications in features
    Paramaters:
                obj - DOM object representing the hyperlink
                features - string with specified features
                
    returns false if the window opens suscessfully
    
    ex: "<asp:HyperLink ID="lnkCoupon" CssClass="lnk_coupon" NavigateUrl="~/" onclick="javascript:return lnkCoupon_Click(this);" Target="_blank" runat="server">"
    */
    
    var retVal = true;
    
    if(!features) { features = ''; }
    
    if(obj && obj.href && obj.href != '')
    {
        window.open(obj.href,name,features); 
        
        retVal = false;
    }
    else
        retVal = true;
        
    return retVal;
}

//window.onload = function () { Blanker.scan(); };

function liAECLink_Click(obj)
{
    //window.open('http://www.whitefence.com/WebObjects/WhiteFence.woa/wa/cm?id=1009341','');
    
    var features = 'width=700,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes';
    
    return PopupLink(obj, features);
}

function liPaymentLink_Click(ePayID)
{
    //alert('liPaymentLink_Click(' + ePayID + ')');
    window.open('https://payments.nwpsc.com/ConsumerConsole/PaymentAuthentication.aspx?MID=' + ePayID,'');
}

function liWhiteFenceLink_Click(href)
{
    //alert(href);
    window.open(href, '');
}

function lnkPrint_Click(webroot)
{
    var url = ((webroot)? webroot : '') + 'printable.aspx';
    var name = '';
    var features = 'width=700,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes';
    
    window.open(url,name,features); 
}

function FPNameLnk_Click(fpid)
{
    var url = 'floorplandetail.aspx?fpid=' + fpid;
    var name = '';
    var features = 'width=700,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes';
    
    window.open(url,name,features); 
}

function lnkApp_Click(obj)
{
    //var url = ((webroot)? webroot : '') + 'AEC_Rental_Application.pdf';
    //var name = '';

    var features = 'width=900,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes';
    
    return PopupLink(obj, features);   
}

function lnkOpenPhotos_Click()
{
    if(pnlPhotosPopup)
    {
        //Effect.Appear(pnlPhotosPopup, { duration: 0.5 });
        $('#' + pnlPhotosPopup).fadeIn('slow');
    }
}

function lnkClosePhotos_Click()
{
    if(pnlPhotosPopup)
    {
        //Effect.Fade(pnlPhotosPopup, { duration: 0.5 });
        $('#' + pnlPhotosPopup).fadeOut('slow');
    }
}

function lnkSitePlan_Click()
{
        $('#' + pnlSitePlansPopup).fadeIn('slow');
}

function lnkCloseSitePlans_Click()
{
        $('#' + pnlSitePlansPopup).fadeOut('slow');
}

function lnkOpenTours_Click()
{
    if(pnlToursPopup)
    {
        //Effect.Appear(pnlToursPopup, { duration: 0.5 });
        $('#' + pnlToursPopup).fadeIn('slow');
    }
}

function lnkCloseTours_Click()
{
    if(pnlToursPopup)
    {
        //Effect.Fade(pnlToursPopup, { duration: 0.5 });
        $('#' + pnlToursPopup).fadeOut('slow');
    }
}

function ChangeTour(tourID)
{
    if(txtSelectedTour && btnReloadTour && $get(btnReloadTour) && $get(txtSelectedTour) && tourID)
    {
        //$(txtSelectedTour).value = tourID;
        $get(txtSelectedTour).value = tourID
        
        var btnName = $get(btnReloadTour).name;

        __doPostBack(btnName, '');
    }
}

function lkbContactMaintenance_Click()
{
//    if(pnlContactMaint)
//    {
//        //Effect.Appear(pnlContactMaint, { duration: 0.5 });
//        $('#' + pnlContactMaint).fadeIn('slow');
//    }

    OpenMaintEmailPopup();
}

function lkbCloseConatctMaint_Click()
{
    if(pnlContactMaint)
    {
        //Effect.Fade(pnlContactMaint, { duration: 0.5 });
        $('#' + pnlContactMaint).fadeOut('slow');
    }
}

function lnkEmail_Click()
{
    if(btnResetEmailForm_UniqueID)
    {
        //$(pnlLeasingEmail).show();
        //__doPostBack(btnResetEmailForm_UniqueID, '');
        //$(btnResetEmailForm).click();
        //Effect.Appear(pnlLeasingEmail_ClientID, { duration: 0.5 });
        
        /*
         *The logic to display the div is in pageLoaded function
         * it checks after each postback to determine if the form should be displayed
        */
        __doPostBack(btnResetEmailForm_UniqueID, '');
        
    }
}

function ResetLeasingEmail()
{
    
    __doPostBack(btnResetEmailForm_UniqueID, '');
}

function lnkLeasingEmailClose_Click()
{
    if(pnlLeasingEmail_ClientID)
    {
        //$(pnlLeasingEmail).hide();
        //Effect.Fade(pnlLeasingEmail_ClientID, { duration: 0.5 });
        $('#' + pnlLeasingEmail_ClientID).fadeOut('slow');
    }
}


function lnkMaintEmail_Click()
{
    OpenMaintEmailPopup();
}

function lnkCloseMaintEmail_Click()
{
    $('#' + pnlMaintenanceEmail_ClientID).fadeOut('slow');
}

function ResetLeasingEmail()
{
    if(btnResetMaintEmailForm_UniqueID)
    {
        /*
         *The logic to display the div is in pageLoaded function
         * it checks after each postback to determine if the form should be displayed
        */
        __doPostBack(btnResetMaintEmailForm_UniqueID, '');
    }
}

function OpenMaintEmailPopup()
{
    ResetLeasingEmail();
}


function CloseErrorBox(id) 
{
    if(id && (id != ''))
        $('#' + id).fadeOut();
}

function Body_Load()
{
    //** this registers a event after any postback
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
}

function pageLoaded(sender, args) 
{
    //** This function fires every time the page loads from a post
    //** add specific postback code here for all pages
    
    //** check if the post was async, use this if block for all async postbacks
    if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) 
    {
        if(udpLeasingEmail_ClientID)
        {
            //** if the panel that is upadated is the leasing email panel then display the email form
            //** this does a compelete comparison of the divs, may need to change to looping IDs if there is a problem
            if (Array.contains(args.get_panelsUpdated(), $get(udpLeasingEmail_ClientID))) 
            {
                //Effect.Appear(pnlLeasingEmail_ClientID, { duration: 0.5 });
                $('#' + pnlLeasingEmail_ClientID).fadeIn('slow');
            }
        }
        
        if(udpMaintenanceEmail_ClientID)
        {
            //** do the same logic for the maintenance email
            if (Array.contains(args.get_panelsUpdated(), $get(udpMaintenanceEmail_ClientID))) 
            {
                //Effect.Appear(pnlLeasingEmail_ClientID, { duration: 0.5 });
                $('#' + pnlMaintenanceEmail_ClientID).fadeIn('slow');
            }
        }
    }
}

function lnkCoupon_Click(obj)
{
   var features = 'width=800,height=700,location=no,menubar=yes,status=no,titlebar=no,toolbar=yes,scrollbars=yes';
   
   return PopupLink(obj, features);
}

function lnkChat_OnClick()
{
    if(pnlLev1Status_ClientID && pnlLev1Status_ClientID!='')
    {
        //Effect.Grow(pnlLev1Status_ClientID, { duration: 0.3, direction: 'top-left' });
        $('#' + pnlLev1Status_ClientID).show("slow");

    }
    return false;
}

function pnlLev1Status_OnClick()
{
    if(pnlLev1Status_ClientID && pnlLev1Status_ClientID!='')
    {
        //Effect.Shrink(pnlLev1Status_ClientID, { duration: 0.3, direction: 'top-left' });
        $('#' + pnlLev1Status_ClientID).hide("slow");
    }
}

function isDefined(variable)
{
    return (typeof(window[variable.toString()]) == "undefined")?  false: true;
}

function js_DisableOnClick(obj)
{
    obj.disabled = true;
}


//-->
