<?php
if (!defined('IS_DEDI')) die();
include_once($cfg_dedi['dedi_path'].'inc/inc.init_external.php');?>
<html style='width:425px; Height: 230px;'>
<head>
 <?php echo '<meta http-equiv="content-type" content="text/html; charset='.$lang_charset.'">'."\n"; ?>
<title>Marquee Editor</title>
<style> html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; }; </style>
<script language='javascript'>
document.title = "Marquee Editor";

var highlightedText = window.dialogArguments;

function setColors (but) {
   but.style.borderStyle = 'inset';
   var color=showModalDialog('<?php echo $sess->url($cfg_client['htmlpath'].$cfg_client['contentfile'] .'?popup=set_color&view=edit'); ?>',but.style.backgroundColor,'resizable:no;help:no;status:no;scroll:no;');
   if (color == '' || color == null){
     but.innerText = '';
     but.style.background = '';
   } else {
     but.innerText = ' #' + color.toUpperCase();
     but.style.background =  color;
   }
   but.style.borderStyle = 'outset';
   return;
}

function returnSelected() {

		  var text = '<marquee'
		  	  + ' direction="' +document.set.direction.value+ '"'
              + ' behavior="' +document.set.behavior.value+ '"'
              //+ ' valign="' +document.set.valign.value+ '"'
              + ' bgcolor="' +background.style.backgroundColor+ '"'
			  + ' width="' +document.set.width.value + document.set.widthExt.value+ '"'
              + ' height="' +document.set.height.value + document.set.heightExt.value+ '"'
			  + ' scrollamount="' +document.set.scrollamount.value+ '"'
			  + ' scrolldelay="' +document.set.scrolldelay.value+ '">'

 	         		if (document.set.text.value != "") {
			text = text + escape( document.set.text.value );
		}
		else {alert("You must type in some text to scroll"); return true;}

  	     	  text += '</marquee>\n';
	window.returnValue = text;
	window.close();
}

function paste_link() {
	document.set.text.value = highlightedText;
}

</script>
<SCRIPT defer>

function _CloseOnEsc() {
  if (event.keyCode == 27) { window.close(); return; }
}
 document.body.onkeypress = _CloseOnEsc;
 </SCRIPT>
</head>
<body style='background: threedface; color: windowtext; margin: 10px; BORDER-STYLE: none' onload='javascript: paste_link();' scroll=no>
<form method=post name=set>
<fieldset id=fldLayout style='left: 0.50em; top: 0.5em; width: 31.5em; height: 16.4000em;'>
</fieldset>
<div id=divFileName style='left: 1.50em; top: 1.5em; width: 5.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_Direction'] ?></div>
<div id=divFileName style='left: 7.00em; top: 1.4em; width: 7.0em; height: 1.2168em;'>
<select name=direction>
	<option value=""><?php echo $dedi_lang['wys_pop_Left'] ?>
	<option value="right"><?php echo $dedi_lang['wys_pop_Right'] ?>
</select></div>
<div id=divFileName style='left: 17.00em; top: 1.5em; width: 5.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_Behavior'] ?></div>
<div id=divFileName style='left: 23.40em; top: 1.4em; width: 7.0em; height: 1.2168em;'>
<select name=behavior>
	<option value=""><?php echo $dedi_lang['wys_pop_Continuous'] ?>
	<option value="slide"><?php echo $dedi_lang['wys_pop_Slide'] ?>
	<option value="alternate"><?php echo $dedi_lang['wys_pop_Alternate'] ?>
</select></div>
<div id=divFileName style='left: 1.50em; top: 4.1em; width: 5em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_Marquee'] ?></div>
<input style='left: 7.00em; top: 3.8em; width: 23.80em; height: 2.0000em;' name=text type=text value="" size=30>
<div id=divFileName style='left: 1.50em; top: 6.6em; width: 5.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_Color'] ?>:</div>
<DIV name=background id=background style="BORDER-RIGHT: thin outset; BORDER-TOP: thin outset; LEFT: 7.00em; BORDER-LEFT: thin outset; WIDTH: 6.52em; BORDER-BOTTOM: thin outset; TOP: 6.4em; HEIGHT: 1.85em" onclick=setColors(this);></DIV>
<div id=divFileName style='left: 1.50em; top: 9.1em; width: 10.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_width'] ?>:</div>
<input type="text" name="width" value="100" style='left: 7.00em; top: 8.9em; width: 3.0em; height: 2.0000em;' maxlength=4>
<div id=divFileName style='left: 10.5em; top: 9.0em; width: 7.0em; height: 1.2168em;'>
   <select name="widthExt">
    <option value="">Px</option>
    <option value="%" selected>%</option>
   </select></div>
<div id=divFileName style='left: 17.00em; top: 9.1em; width: 10.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_height'] ?>:</div>
<input type="text" name="height" value="" style='left: 21.0em; top: 8.9em; width: 3.0em; height: 2.0000em;' maxlength=4>
<div id=divFileName style='left: 25.0em; top: 9.0em; width: 7.0em; height: 1.2168em;'>
   <select name="heightExt">
    <option value="" selected>Px</option>
    <option value="%">%</option>
   </select></div>
<div id=divFileName style='left: 1.50em; top: 12.0em; width: 30.0em; height: 1.2168em;'><HR><?php echo $dedi_lang['wys_pop_Speed'] ?><HR></div>
<div id=divFileName style='left: 10.80em; top: 13.3em; width: 10.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_ScrollAmount'] ?>:</div>
<input type="text" name="scrollamount" value="" style='left: 18.00em; top: 13.1em; width: 3.0em; height: 2.0000em;' maxlength=4>
<div id=divFileName style='left: 21.6em; top: 13.3em; width: 10.0em; height: 1.2168em;'><?php echo $dedi_lang['wys_pop_ScrollDelay'] ?>:</div>
<input type="text" name="scrolldelay" value="" style='left: 27.80em; top: 13.1em; width: 3.0em; height: 2.0000em;' maxlength=4>
<input style='left: 32.50em; top: 7.0em; width: 6em; height: 2.2000em;' value=OK  type=button onClick='returnSelected()'>
<input style='left: 32.50em; top: 9.5em; width: 6em; height: 2.2000em;' value='<?php echo $dedi_lang['gen_abort'] ?>' type=button onClick='window.close()'>
</form>
</body>
</html>