﻿function InsertListingMailToTag(){

    var MLS = gup('MLS_Acct');
    var emailMessage;
    var emailSubject;

    emailSubject = "SoldByFred Property"
    emailBody = "I wanted to share this SoldByFred.com listing with you.  " + "http://www.soldbyfred.com/Our-Listings-Details.aspx?MLS_Acct=" + MLS

    window.open("mailto:" + '?subject=' + emailSubject + '&body=' + emailBody, '_self');
 
}

function InsertMultiFamilyMailToTag() {

    var MLS = gup('MLS_Acct');
    var emailMessage;
    var emailSubject;

    emailSubject = "SoldByFred Property"
    emailBody = "I wanted to share this SoldByFred.com listing with you.  " + "http://www.soldbyfred.com/Our-MultiFamily-Details.aspx?MLS_Acct=" + MLS

    window.open("mailto:" + '?subject=' + emailSubject + '&body=' + emailBody, '_self');

}



function InsertLandMailToTag() {

    var MLS = gup('MLS_Acct');
    var emailMessage;
    var emailSubject;

    emailSubject = "SoldByFred Property"
    emailBody = "I wanted to share this SoldByFred.com listing with you.  " + "http://www.soldbyfred.com/Our-Land-Details.aspx?MLS_Acct=" + MLS

    window.open("mailto:" + '?subject=' + emailSubject + '&body=' + emailBody, '_self');

}

function InsertOpenHouseMailToTag() {

    var MLS = gup('MLS_ACCT');
    var emailMessage;
    var emailSubject;

    emailSubject = "SoldByFred Property"
    emailBody = "I wanted to share this SoldByFred.com open house with you.  " + "http://www.soldbyfred.com/Open-House-Details.aspx?MLS_Acct=" + MLS

    window.open("mailto:" + '?subject=' + emailSubject + '&body=' + emailBody, '_self');

}


function InsertRentalMailToTag() {

    var Rental_ID = gup('RentalID');
    var emailMessage;
    var emailSubject;

    emailSubject = "SoldByFred Rental Property"
    emailBody = "I wanted to share this SoldByFred.com rental with you.  " + "http://www.soldbyfred.com/Rental-Details.aspx?RentalID=" + Rental_ID

    window.open("mailto:" + '?subject=' + emailSubject + '&body=' + emailBody, '_self');

}



function gup(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null)
        return "";
    else
        return results[1];
}
