<%@ Language="VBScript" %>
<!--#include file="../config.asp"-->

<!--BEGIN-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Aurigma Image Uploader</title>
	<meta http-equiv="MSThemeCompatible" content="yes" />
	<link href="style.css" type="text/css" rel="stylesheet" />

	<script src="../iuembed.js" type="text/javascript"></script>

	<script type="text/javascript">
//<![CDATA[	
var bitBucket = 0;
var desktop = 1;
var myComputer = 2;
var myDocuments = 3;
var myMusic = 4;
var myPictures = 5;
var myVideo = 6;
var network = 7;

function changeView(view){
	getImageUploader("ImageUploader1").setFolderView(view);
}

//Check if appropriate special folder (My Documents, Desktop, etc) exists. 
//If some of these folder is missing, hide appropriate button.
function checkButton(name, folderId){
	if (getImageUploader("ImageUploader1").CanGoToFolder(folderId)){
		document.getElementById(name + "Holder").style.display = "block";
	}
}

//window.onload = function(){
function FullPageLoad(){
	checkButton("Desktop", desktop);
	checkButton("MyDocuments", myDocuments);
	checkButton("MyComputer", myComputer);
	checkButton("MyPictures", myPictures);
	checkButton("MyVideo", myVideo);
	checkButton("Network", network);
}
//]]>
	</script>

</head>
<body>
	<p>
		This demo application shows how to use Image Uploader to build the user interface
		similar to Open File dialog. Also, this application demonstrates the following features:
	</p>
	<ul>
		<li>Folder upload.</li>
		<li>Automatic recovery of broken connection.</li>
	</ul>
	<fieldset>
		<legend>Note</legend>This demo application <strong>deletes all previously uploaded files</strong>.
		Keep in mind that it is a feature of this demo, not of Image Uploader itself. If
		you <strong>do not want to delete uploaded files</strong>, you should modify the
		upload processing page specified by the <strong>Action</strong> parameter.
	</fieldset>
	<table cellpadding="0" cellspacing="3" border="0">
		<tr>
			<td align="right">
				Look in:</td>
			<td>
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td>
							<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed ShellComboBox to the page.z
var sc = new ShellComboBoxWriter("ShellComboBox1", 420, 24);

//For ActiveX control full path to CAB file (including file name) should be specified.
sc.activeXControlCodeBase = "../ImageUploader4.cab";
sc.activeXControlVersion = "4,8,1,0";

//For Java applet only path to directory with JAR files should be specified (without file name).
sc.javaAppletCodeBase = "../";
sc.javaAppletCached = true;
sc.javaAppletVersion = "2.8.1.0";

//Configure appearance.
sc.addParam("BackgroundColor", "#ece9d8");

//Link ShellComboBox with ImageUploader
sc.addParam("AdditionalFolderNavigator", "ImageUploader1");

//Tell the ShellComboBox writer object to generate all necessary HTML code to embed 
//it to the page.
sc.writeHtml();
//]]>
							</script>

						</td>
						<td align="right">
							<button onclick="getImageUploader('ImageUploader1').GoToPreviousFolder();" title="Back"
								class="SmallButton">
								<img src="Images/Back.gif" alt="Back" class="Icon" /></button>
							<button onclick="getImageUploader('ImageUploader1').GoToParentFolder();" title="Up"
								class="SmallButton">
								<img src="Images/Up.gif" alt="Up" class="Icon" /></button>
							<button onclick="changeView(0);" title="Thumbnails" class="SmallButton">
								<img src="Images/Thumbnails.gif" alt="Thumbnails" class="Icon" />
							</button>
							<button onclick="changeView(3);" title="Details" class="SmallButton">
								<img src="Images/Details.gif" alt="Details" class="Icon" /></button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top" class="LeftPanel">
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td class="ShortcutPanel" valign="top">
							<table>
								<tr id="DesktopHolder">
									<td>
										<button title="Desktop" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(desktop);">
											<img src="Images/Desktop.gif" alt="Desktop" class="Icon" /><br />
											Desktop
										</button>
									</td>
								</tr>
								<tr id="MyComputerHolder">
									<td>
										<button title="My Computer" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myComputer);">
											<img src="Images/MyComputer.gif" alt="My Computer" class="Icon" /><br />
											My&nbsp;Computer
										</button>
									</td>
								</tr>
								<tr id="MyDocumentsHolder">
									<td>
										<button title="My Documents" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myDocuments);">
											<img src="Images/MyDocuments.gif" alt="My Documents" class="Icon" /><br />
											My&nbsp;Documents
										</button>
									</td>
								</tr>
								<tr id="MyPicturesHolder">
									<td>
										<button title="My Pictures" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myPictures);">
											<img src="Images/MyPictures.gif" alt="My Pictures" class="Icon" /><br />
											My&nbsp;Pictures
										</button>
									</td>
								</tr>
								<tr id="MyVideoHolder">
									<td>
										<button title="My Video" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(myVideo);">
											<img src="Images/MyVideo.gif" alt="My Video" class="Icon" /><br />
											My&nbsp;Video
										</button>
									</td>
								</tr>
								<tr id="NetworkHolder">
									<td>
										<button title="Network" class="IconButton" onclick="getImageUploader('ImageUploader1').GoToFolder(network);">
											<img src="Images/Network.gif" alt="Network" class="Icon" /><br />
											Network
										</button>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table>
								<tr>
									<td>
										<button title="Select All" onclick="getImageUploader('ImageUploader1').SelectAll();"
											class="Button">
											Select All</button>
									</td>
								</tr>
								<tr>
									<td>
										<button title="Upload" onclick="getImageUploader('ImageUploader1').Send();" class="Button">
											Upload</button>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
			<td>

				<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 550, 490);

//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../ImageUploader4.cab";
iu.activeXControlVersion = sc.activeXControlVersion;

//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase = "../";
iu.javaAppletCached = true;
iu.javaAppletVersion = sc.javaAppletVersion;

iu.showNonemptyResponse = "off";

//Configure appearance and behaviour.
iu.addParam("PaneLayout", "TwoPanes");
iu.addParam("FolderView", "Thumbnails");
iu.addParam("UploadView", "Details");
iu.addParam("PreviewThumbnailSize", "100");
iu.addParam("ShowButtons", "false");
iu.addParam("ShowSubfolders", "true");
iu.addParam("ShowDescriptions", "false");
iu.addParam("ShowContextMenu", "false");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("AllowMultipleRotate", "true");

//Configure colors.
iu.addParam("PaneBackgroundColor", "#ffffff");
iu.addParam("BackgroundColor", "#ffffff");
iu.addParam("PreviewThumbnailActiveColor", "#f8b330");
iu.addParam("PreviewThumbnailInactiveColor", "#eeeeee");

//Hide tree pane.
iu.addParam("TreePaneWidth", "-1");

//Allow upload not only files, but also entire folders.
iu.addParam("AllowFolderUpload", "true");

//Single or multiple file selection.
//iu.addParam("AllowMultipleSelection", "false");

//Link ImageUploader with ShellComboBox.
iu.addParam("AdditionalFolderNavigator", "ImageUploader1");

//Configure file mask to display images only.
iu.addParam("FileMask", "*.jpg;*.jpeg;*.jpe;*.gif;*.png;*.tif;*.tiff;*.psd");

//Configure thumbnail settings.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "120");
iu.addParam("UploadThumbnail1Height", "120");
iu.addParam("UploadThumbnail1JpegQuality", "60");

//Configure upload settings.
iu.addParam("Action", "<%=GetUploadUrl()%>");
iu.addParam("FilesPerOnePackageCount", "1");
iu.addParam("AutoRecoverMaxTriesCount", "10");
iu.addParam("AutoRecoverTimeOut", "10000");

//Configure URL where to redirect after upload.
iu.addParam("RedirectUrl", "<%=GetGalleryUrl()%>");

iu.fullPageLoadListenerName = "FullPageLoad";

//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
				</script>

			</td>
		</tr>
	</table>
</body>
</html>
<!--END-->