﻿//*****************************************************************************************| General Functions
function CancelAll() {
    window.close();
}

function MsgAndClose(Msg) {
    alert(Msg);
    CancelAll();
}

function CancelPage() {
    window.location = "../Home.aspx";
    return false;
}

function EmailJournalViaOutlook(EmailTo, EmailSubject, EmailBody) {
    window.open("mailto:" + EmailTo + "?subject=" + EmailSubject + "&body=" + EmailBody);
}

function OpenWindow(URL, Name) {
    window.open(URL, Name, "toolbar=0, menubar=0, directories=0, resizable=1, location=0, scrollbars=1");
}

function ContactUs() {
    window.radopen("ContactUs.aspx", "MidSizeDialog");
}

function BuyerInvite(OfferID) {
    window.radopen("../User/BuyerInvite.aspx?OfferID=" + OfferID, "SmallSizeDialog");
}

function HuInfo(GUID, OfferID) {
    if (OfferID) {
        window.radopen("../User/HuInfo.aspx?GUID=" + GUID + "&OfferID=" + OfferID, "SmallSizeDialog");
    }

    else {
        window.radopen("../User/HuInfo.aspx?GUID=" + GUID, "SmallSizeDialog");
    }
}

function PreApprovalToken(GUID) {
    window.radopen("../User/PreApprovalToken.aspx?GUID=" + GUID, "MidSizeDialog");
    return false;
}

function GetPreApprovalTokenDoc(GUID) {
    OpenWindow("../Common/GetPreApprovalTokenDoc.aspx?GUID=" + GUID, "GetPreApprovalTokenDoc");
    return false;
}

function PreApprovalDocTrail(OfferID) {
    window.radopen("../User/PreApprovalDocTrail.aspx?OfferID=" + OfferID, "MidSizeDialog");
}

function PreLoanRating(GUID) {
    window.radopen("../User/PreLoanRating.aspx?GUID=" + GUID, "SmallSizeDialog");
    return false;
}

function Chat(HuGUID, REID, OfferID) {
    window.radopen("Chat.aspx?HuGUID=" + HuGUID + "&REID=" + REID + "&OfferID=" + OfferID, "ChatDialog");
    return false;
}

function Chat2(HuGUID, REID, OfferID) {
    window.radopen("Application/Chat.aspx?HuGUID=" + HuGUID + "&REID=" + REID + "&OfferID=" + OfferID, "ChatDialog");
    return false;
}

//*****************************************************************************************| RE Functions
function ReNew() {
    window.radopen("ReNew.aspx", "SmallSizeDialog");
    return false;
}

function ReFeatureNew(REID) {
    window.radopen("ReFeatureNew.aspx?REID=" + REID, "MidSizeDialog");
    return false;
}

function GetRePhoto(GUID) {
    OpenWindow("../Common/GetRePhoto.aspx?GUID=" + GUID, "GetRePhoto");
    return false;
}

function GetReDoc(GUID) {
    OpenWindow("../Common/GetReDoc.aspx?GUID=" + GUID, "GetReDoc");
    return false;
}

function ReDocs(REID) {
    window.radopen("ReDocs.aspx?REID=" + REID, "LargeSizeDialog");
    return false;
}

function ManageReDocs(OfferID) { //This is a general area for other vendors to upload docs. Must be accessed from an offer prospective
    window.radopen("../User/ReDocs.aspx?OfferID=" + OfferID, "MidSizeDialog");
    return false;
}

function RePhotos(REID) {
    window.radopen("RePhotos.aspx?REID=" + REID, "LargeSizeDialog");
    return false;
}

function PhotoGallery(EncryptedREID) {
    window.radopen("http://tazahomes.com/Common/PhotoGallery.aspx?REID=" + EncryptedREID, "LargeSizeDialog");
}

function ListingDocs(EncryptedREID) {
    window.radopen("http://tazahomes.com/Common/ReDocs.aspx?REID=" + EncryptedREID, "MidSizeDialog");
}

function ListingDocsFromApp(EncryptedREID) {
    window.radopen("../Common/ReDocs.aspx?REID=" + EncryptedREID, "MidSizeDialog");
}

function ContactSeller(EncryptedREID) {
    window.radopen("http://tazahomes.com/Common/ContactSeller.aspx?REID=" + EncryptedREID, "MidSizeDialog");
}

function RePhotoView(PhotoID) {
    window.radopen("RePhotoView.aspx?PhotoID=" + PhotoID, "LargeSizeDialog");
    return false;
}

function RePhotoEdit(PhotoID) {
    window.radopen("RePhotoEdit.aspx?PhotoID=" + PhotoID, "SmallSizeDialog");
    return false;
}

function ReDocEdit(DocID) {
    window.radopen("ReDocEdit.aspx?DocID=" + DocID, "SmallSizeDialog");
    return false;
}

function ReFeatureEdit(ReFeatureID) {
    window.radopen("ReFeatureEdit.aspx?ReFeatureID=" + ReFeatureID, "SmallSizeDialog");
    return false;
}

function ShowChangeStatusForm(id, rowIndex) {
    window.radopen("REOChangeStatus.aspx?REID=" + id, "ChangeStatusDialog");
    return false;
}

function ShowChangeReAcctManForm(id) {
    if (id) {
        window.radopen("ChangeReAcctMan.aspx?REID=" + id, "ChangeReAcctManDialog");
        return false;
    }
}

function ShowCoverImageForm(REID) {
    window.radopen("ShowCoverImage.aspx?REID=" + REID, "CoverImageDialog");
    return false;
}

function ShowOverviewForm(args) {
    window.radopen("Overview.aspx?REID=" + args, "OverviewDialog");
    return false;
}

function ShowReResizePhotos(args) {
    window.radopen("ReResizePhotos.aspx?REID=" + args, "ReResizePhotosDialog");
    return false;
}

function ShowReContacts(args) {
    OpenWindow("ReContacts.aspx?REID=" + args, "ReContacts");
    return false;
}

//*****************************************************************************************| Offers Functions
function GetOfferDoc(GUID) {
    OpenWindow("../Common/GetOfferDoc.aspx?GUID=" + GUID, "GetOfferDoc");
    return false;
}

function ManageOfferDocs(OfferID) { //This is a general area for other vendors to upload docs. Must be accessed from an offer prospective
    window.radopen("../User/OfferDocs.aspx?OfferID=" + OfferID, "MidSizeDialog");
    return false;
}



function ShowOfferInsertForm(id) {
    window.radopen("OfferNew.aspx?REID=" + id, "OfferDialog");
    return false;
}

function ShowOfferEditForm(id) {
    window.radopen("OfferEdit.aspx?OfferID=" + id, "OfferDialog");
    return false;
}

function ShowCounterInsertForm(id) {
    window.radopen("CounterNew.aspx?OfferID=" + id, "CounterDialog");
    return false;
}

function ShowCounterEditForm(id) {
    window.radopen("CounterEdit.aspx?OfferID=" + id, "CounterDialog");
    return false;
}

//*****************************************************************************************| Showings Functions
function ShowingGrantRejectRequest(ShowingID) {
    window.radopen("ShowingGrantRejectRequest.aspx?ShowingID=" + ShowingID, "MidSizeDialog");
    return false;
}

function ShowingFeedback(ShowingID) {
    window.radopen("ShowingFeedback.aspx?ShowingID=" + ShowingID, "MidSizeDialog");
    return false;
}



//*****************************************************************************************| Journals Functions

function EmailOfferJournal(JID) {
    window.radopen("EmailOfferJournal.aspx?JID=" + JID, "MidSizeDialog");
    return false;
}

function OfferJournalNew(OfferID) {
    window.radopen("OfferJournalNew.aspx?OfferID=" + OfferID, "LargeSizeDialog");
    return false;
}


function ShowJournalInsertForm(id) {
    if (id) {
        window.radopen("JournalNew.aspx?REID=" + id, "JournalDialog");
        return false;
    }
    else {
        alert("Please select property first");
    }
}

function ShowJournalEditForm(id) {
    window.radopen("JournalEdit.aspx?JID=" + id, "JournalDialog");
    return false;
}

function EmailJournal(id) {
    if (id) {
        window.radopen("EmailJournal.aspx?JID=" + id, "EmailJournalDialog");
        return false;
    }
    else {
        alert("Please select Journal first");
    }
}

//*****************************************************************************************| BPOs Functions

function ShowBPOInsertForm(id) {
    window.radopen("BPONew.aspx?REID=" + id, "BPODialog");
    return false;
}


function ShowBPOEditForm(id) {
    window.radopen("BPOEdit.aspx?BPOID=" + id, "BPODialog");
    return false;
}

//*****************************************************************************************| Hu Functions

function GetHuFile(GUID) {
    OpenWindow("../Common/GetHuFile.aspx?GUID=" + GUID, "GetHuFile");
    return false;
}

function ShowResetUserPasswordForm(id) {
    window.radopen("ResetUserPassword.aspx?EmpID=" + id, "ResetUserPasswordDialog");
    return false;
}

//*****************************************************************************************| Evaluation Functions
function ShowEvaluationSwitchboardForm(id) {
    OpenWindow("EvaluationSwitchboard.aspx?EvalID=" + id, "EvaluationSwitchboard");
    return false;
}

function ShowEvaluationValidationForm(id) {
    OpenWindow("../User/EvaluationValidation.aspx?ValidationCheckID=" + id, "EvaluationValidation");
    return false;
}

function ShowAcceptEvaluationForm(id) {
    window.radopen("AcceptEvaluation.aspx?EvalID=" + id, "AcceptEvaluationDialog");
    return false;
}

function ShowMyEvaluationReviews() {
    OpenWindow("MyEvaluationReviews.aspx", "ShowMyEvaluationReviews");
    return false;
}

function ShowEvaluations() {
    OpenWindow("Evaluations.aspx", "Evaluations");
    return false;
}

function ShowMyEvaluations(id) {
    OpenWindow("Evaluations.aspx?EmpID=" + id, "Evaluations");
    return false;
}

function ShowEvaluationReport(id) {
    OpenWindow("../Common/EvaluationReport.aspx?EvalID=" + id, "EvaluationReport");
    return false;
}

function GetPdfReport(id) {
    OpenWindow("../Common/GetPdfReport.aspx?EvalID=" + id, "GetPdfReport");
    return false;
}

function ShowEvaluationReviewEditForm(id) {
    window.radopen("EvaluationReviewEdit.aspx?EvalID=" + id, "EvaluationReviewEditDialog");
    return false;
}

function ShowRejectEvaluationByClientForm(id) {
    window.radopen("RejectEvaluationByClient.aspx?EvalID=" + id, "RejectEvaluationByClientDialog");
    return false;
}

function ShowCancelEvaluationForm(id) {
    window.radopen("CancelEvaluation.aspx?EvalID=" + id, "CancelEvaluationDialog");
    return false;
}

function ShowGetPhotoForm(id) {
    OpenWindow("../User/GetPhoto.aspx?PhotoID=" + id, "GetPhoto");
    return false;
}

function ShowReAgentProfileForm(id) {
    window.radopen("../User/ReAgentProfile.aspx?ReAgentID=" + id, "ReAgentProfileDialog");
    return false;
}

function GetReAgentFile(id) {
    OpenWindow("../Common/GetReAgentFile.aspx?FileID=" + id, "GetReAgentFile");
    return false;
}

function ShowZipCoverage(id) {
    OpenWindow("ZipCoverage.aspx?zip=" + id, "ZipCoverage");
    return false;
}

function ShowCheckZipCoverage() {
    window.radopen("CheckZipCoverage.aspx", "CheckZipCoverageDialog");
    return false;
}

function ShowEvalFeeForm(ID) {
    window.radopen("EvalFee.aspx?EvalID=" + ID , "EvalFeeDialog");
    return false;
}

//*****************************************************************************************| Contact Functions
function ContactEdit(ContID) {
    window.radopen("ContactEdit.aspx?ContID=" + ContID, "MidSizeDialog");
    return false;
}

function ContactNew() {
    window.radopen("ContactNew.aspx", "MidSizeDialog");
    return false;
}
//*****************************************************************************************| Zip Territory Functions
function ZipTerritoryNew() {
    window.radopen("ZipTerritoryNew.aspx", "SmallSizeDialog");
    return false;
}

