﻿// JScript File

function tellAMate(nodeId, aliasPath, targetPath, nodePath, currentPageIndex, hdnImgID)
{
    var imgGuid = document.getElementById(hdnImgID);
    window.open(aliasPath + '.aspx?Imglink=' + imgGuid.value,'','width=400px,height=400px,scrollbars=1,menubar=0,location=0,resizable=0');
}

function tellAMatePageOnly(aliasPath, targetPath)
{
    window.open(aliasPath + '.aspx?targetPath=' + targetPath,'','width=400px,height=500px,scrollbars=1,menubar=0,location=0,resizable=0');
}

function tellAMateEmailClient(nodeId, aliasPath, targetPath, nodePath, currentPageIndex, hdnImgID)
{
    var imgGuid = document.getElementById(hdnImgID);
    emailWindow = window.open(aliasPath + '.aspx?Imglink=' + imgGuid.value,'','width=400px,height=200px,scrollbars=1,menubar=0,location=0,resizable=0');
    emailWindow.moveTo(100,100);
}

function tellAMatePageOnlyEmailClient(aliasPath, targetPath)
{
    window.open(aliasPath + '.aspx?targetPath=' + targetPath,'','width=400px,height=200px,scrollbars=1,menubar=0,location=0,resizable=0');
}


function setControlFocus(ctrlId)
{
    var ctrl = document.getElementById(ctrlId);
    if (typeof(ctrl) != 'undefined')
    {
        try
        {
            ctrl.focus();
        }
        catch(e)
        {
        }
    }
}

function sendEmail(emailClientID, url)
{
    if(Page_ClientValidate("test")){
        var email = document.getElementById(emailClientID).value;
        location.href = "mailto:"+email+"?subject=Check This Out!&body="+url;
        window.close();
    }
}
