<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2005-2006 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts EasyCreate 1.1                 |
// +----------------------------------------------------------------------+
// | Authors: jimmy<jimmy.jos@armia.com>        		              	  |
// +----------------------------------------------------------------------+
//Three options are given to the user
//	(i)		He can opt to upload his image
//	(ii)	Select an image from the sites' gallery
//	(iii)	Select an image from the gallery of the user himself
//	(i)		return value is set as uploadimage.php and window closed
//	(ii)	return value is set as ourgallery.php and window closed
//	(iii)	return value is set as usergallery.php and window closed
  include "../../../../../includes/session.php";
  include "../../../../../includes/config.php";
  include "../../../../../includes/function.php";
  $currentloc="../../../../../";
  include "../../../../../includes/applicationheader.php";
  echo '<script type="text/javascript" src="../ajaxfilemanager/jscripts/ajaxfilemanager.js"></script>';
  echo '<script type="text/javascript" src="../ajaxfilemanager/jscripts/for_tinymce.js"></script>';
?>
	<SCRIPT>
		window.name="targ";
	  //user clicking the cancel button 
	  function canceltblpro(){
	  returnValue = new Object();
	  returnValue.url = "";
	        window.close();
	  }
//	(i)		return value is set as uploadimage.php and window closed
//	(ii)	return value is set as ourgallery.php and window closed
//	(iii)	return value is set as usergallery.php and window closed
	  function savetblpro(){
			returnValue = new Object();
			if(document.getElementById("btnuploadtype").value=="Upload"){
				returnValue.url = "uploadimage.php";
				
			}else if(document.getElementById("btnuploadtype").value=="Select From Our Gallery"){
				returnValue.url = "ourgallery.php";	
			}else{
			   returnValue.url = "usergallery.php";
			}
			//selectFile('test');
			window.location=returnValue.url;
			//alert("asdasd here"+returnValue.url);
			//window.close();
			
	  }
	  	    
	  function checkupload(){
	  
		document.getElementById("btnuploadtype").value="Upload";
	  }	
	  function checkourgallery(){
	    document.getElementById("btnuploadtype").value="Select From Our Gallery";
	  }
	  function checkyourgallery(){
	    document.getElementById("btnuploadtype").value="Select From Your gallery";
	  }
	</SCRIPT>
</head>
<body>
<table width="100%" cellpadding=2>
   <tr>
      <td align="center" width="100%">
	                  <FIELDSET>
					      <legend class=maintextbold align="center">Select Image</legend>
						    <table>
							      <form nameimageproper method=post>
							      <tr>
								     <td><input id=uptype name=uptype type=radio class=raiobutton checked onclick="checkupload()"; value="0"></td>
								     <td class=maintext>Upload Your Image</td>
								  </tr>
								  <tr>
								     <td><input id=uptype  name=uptype type=radio class=raiobutton onclick="checkourgallery()"; value="1"></td>
								     <td class=maintext>Select from our gallery</td>
								  </tr>
								  <tr>
								     <td><input id=uptype name=uptype type=radio class=raiobutton onclick="checkyourgallery()"; value="2"></td>
								     <td class=maintext>Select from your gallery</td>
								  </tr>
								
								  <tr>
								    <td colspan=4 align=center><input id=btnuploadtype  name=btnuploadtype class="editorbutton"  type=button value="Upload" onclick="savetblpro();" style="width:144px; ">
									<input  class="editorbutton" type=button value="Cancel" onclick="canceltblpro();"></td>
								  </tr>
								 
								  </form>
							  </table>
						  
						  
					  </FIELDSET>
	  </td>
	</tr>
</table>	  				  	  
<?php
  include "../../../../includes/editorfooter.php";
?> 
