<!DOCTYPE HTML SYSTEM "-//Adobe//DWExtension layout-engine 12.0//dialog">
<!-- MENU-LOCATION=NONE -->
<html>
<head>
<!--

 ADOBE CONFIDENTIAL
 ___________________

 Copyright 2015 Adobe Systems Incorporated
 All Rights Reserved.

 NOTICE:  All information contained herein is, and remains
 the property of Adobe Systems Incorporated and its suppliers,
 if any.  The intellectual and technical concepts contained
 herein are proprietary to Adobe Systems Incorporated and its
 suppliers and are protected by trade secret or copyright law.
 Dissemination of this information or reproduction of this material
 is strictly forbidden unless prior written permission is obtained
 from Adobe Systems Incorporated.

-->
<script type="text/javascript" src="../NDD/scripts/NDD_Constants.js"></script>
<script>
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, maxerr: 50 */
/*global document, dw, DW_NDD_CONSTANTS*/

function onNew() {
	'use strict';
	var dom = dw.getDocumentDOM(),
		nddObj = dw.ndd;

	if (!dom || !nddObj) {
		return;
	}

	var bootStrapFile = nddObj.getLastUsedBootstrapURL();
	if (!bootStrapFile) {
		return;
	}

	var cssLastIndex = bootStrapFile.lastIndexOf("/css");
	if (cssLastIndex === -1) {
		return;
	}

	var basePath = bootStrapFile.substring(0, cssLastIndex),
		bootstrapJS = "<script src=\"" + basePath + DW_NDD_CONSTANTS.BootstrapJS + "\"><\/script>",
		jqueryMinJS = "<script src=\"" + basePath + DW_NDD_CONSTANTS.JQueryMinJS + "\"><\/script>",
		bootstrapLink = "<link href=\"" + bootStrapFile + "\" rel=\"stylesheet\">";

	// Replace the tokens with the values.
	var docStr = dom.documentElement.outerHTML;

	docStr = docStr.replace("<!-- Bootstrap URL-->", bootstrapLink);
	docStr = docStr.replace("<!-- Bootstrap JS URL-->", bootstrapJS);
	docStr = docStr.replace("<!-- JQuery JS URL-->", jqueryMinJS);

	dom.documentElement.outerHTML = docStr;

	dom.setModified(false);
	dom.clearUndos();
	return;
}


</script>
</head>
<body onLoad="onNew()">
</body>
</html>

