<?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>        		              	  |
// +----------------------------------------------------------------------+
//Insert a link for external address in the editable area.
//It inserts a link for external address using javascript.
include "../includes/session.php";
include "../includes/config.php";
$currentloc="../";	  
include "../includes/applicationheader.php";
?>
<script>
var used_space = 0; 
var quota = 10; 
var sUploadsList = new Array(); 

var hyper_mode = 1;

//sets the value of the text box to the value passed in to the window through 
//dialogArguments.url
 onload = function(){
 	try{
	if(dialogArguments.url.length > 0)
	txtAnchor.value=dialogArguments.url;
	}
	catch(e){}
 }
//sets the returnvalue.url as the external address entered in the text box
//and close the window.
 function sInsertLink(){
   	
	linkSource = 'http://' + txtAnchor.value.replace(/http:\/\//ig, '');
	if(linkSource) { 
	returnValue = new Object();
	if(linkSource.length > 0) {
   returnValue = new Object();
   returnValue.url = linkSource;
   }

   window.close();
  }else{
   alert("Enter an address for creating an anchor.");
   focus();
  }
 }

</script>
<body>
<table width=260 cellspacing=0 cellpadding=0>
<tr>
  <td width="15">&nbsp;</td>
  <td width="243">&nbsp;</td>
</tr>
<tr>
  <td>&nbsp;</td>
  <td height="60">
 <fieldset><legend class="maintext"><b>External Link</b></legend><div class="maintext">Enter link to external resource <br>(e.g. http://www.iscripts.com).</div><img src=../images/spacer.gif width=1 height=20><input type=text size=36 id=txtAnchor>
 <br><div align="center"><input type=button id=hypOK value="&nbsp;&nbsp;&nbsp; OK &nbsp;&nbsp;&nbsp;" onclick="sInsertLink();"  class="editorbutton"> <input type=button value=Cancel onclick="javascript: window.close();" class="editorbutton"></div>
 </fieldset>
</td></tr>
<tr>
  <td align=center></td>
  <td align=center></td></tr>
</table>
<?php
  include "./includes/editorfooter.php";
?> 