// ----------------------------------------------------
//
<!--
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2006 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 may be covered by U.S. and Foreign Patents,
* patents in process, 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.
**************************************************************************/
-->

// ----------------------------------------------------
//
// Insert_As_PDF.js
//
// ----------------------------------------------------

// ----------------------------------------------------
// public functions
// ----------------------------------------------------

function isDOMRequired() 
{ 
	return true;
}

function isAsset() 
{
	return true;
}

function canInsertObject()
{
	return true;
}

function insertObject(assetArgs)
{
	// Return the html tag that should be inserted

	/*const*/ var warnUserIfNotAvailable = true;
	if (!isAcroElementsAvailable(warnUserIfNotAvailable))
	{
		return '';
	}
	
	//gsrupdate hitch - blow is elements convertible list 
	
	//var extensions = "*.doc;*.xls;*.ppt;*.rtf;*.bmb;*.rle;*.dib;*.gif;*.indd;*.jdf;*.mid;*.jpg;*.jpeg;*.jpe;*.jpf;*.jpx;*.jp2;*.j2k;*.j2c;*.jpc;*.pcx;*.png;*.ps;*.eps;*.prn;*.txt;*.text;*.tif;*.tiff;*.xps;"
	
	//however we are using pdfmaker so we restrict it to office doc
	
	var extensions = "*.doc;*.docx;*.xls;*.xlsx;*.xlsm;*.ppt;*.pptx;*.rtf;";
		if (extensions == null)
		extensions = "";

	var filter = LABEL_PDF_CONVERTIBLE_DOCUMENTS + "|" + extensions + "|*|";

	var sourceURL = dw.browseForFileURL("open", "", false, false, new Array(filter));
	if (sourceURL == null || sourceURL == '') 
	{
		return '';
	}
	
	
		
	var rememberPrefs = true;
	var showPDFSettings = false;
	var dropResult = '';
	dw.runCommand("DropAsPDF.htm",sourceURL,dropResult,rememberPrefs);		
	return '';
	
	
}


