﻿function GetContentWnd(){ 
	return parent; 
}

function OpenEmail(description)
{
	var currentWindow = GetContentWnd();
	var oDoc = currentWindow.document;
	var strDescription = ((description == null) || (description == "")) ? oDoc.title : description;	
	if(oDoc.title == "")
		currentWindow.location.href = "mailto:?body="+BuildEmailDescription(strDescription, AddParamToURL(currentWindow.location.href, strEmailString));
	else
		currentWindow.location.href = "mailto:?subject=RemoteDepositCapture.com - "+description.replace("&","%26")+"&body="+BuildEmailDescription(strDescription, currentWindow.location.href);
	return true;
}

function BuildEmailDescription(strDescription,hRef){
	return escape("Here's an article on RemoteDepositCapture.com that you might be interested in:" +
				String.fromCharCode(13)+ String.fromCharCode(13) + strDescription + String.fromCharCode(13) + "URL: " + hRef);
}

function OpenEventEmail(description) {
    var currentWindow = GetContentWnd();
    var oDoc = currentWindow.document;
    var strDescription = ((description == null) || (description == "")) ? oDoc.title : description;
    if (oDoc.title == "")
        currentWindow.location.href = "mailto:?body=" + BuildEventEmailDescription(strDescription, AddParamToURL(currentWindow.location.href, strEmailString));
    else
        currentWindow.location.href = "mailto:?subject=RemoteDepositCapture.com - " + description.replace("&", "%26") + "&body=" + BuildEventEmailDescription(strDescription, currentWindow.location.href);
    return true;
}

function BuildEventEmailDescription(strDescription, hRef) {
    return escape(" Here's an event on RemoteDepositCapture.com that you might be interested in :" +
				String.fromCharCode(13) + String.fromCharCode(13) + strDescription + String.fromCharCode(13) + "URL :    " + hRef);
}
