﻿// JScript File

function CopyPage()
{
    var pageName = prompt('Input name of new page', 'default.aspx');
    
    if (pageName == "" || pageName == null)
        return;
    
    //take the front part off of the link
    var sourceURL = location.href.replace("http://" + location.host, '');
    //resolves the default page problem
    if (sourceURL.indexOf(".aspx") == -1)
        sourceURL += "default.aspx";
    
    var copyLink = "/Admin/CopyPage.aspx?copyURL=" + pageName + "&sourceURL=" + sourceURL;
    
    location.href = copyLink;
}