<html dir="rtl">
<head>
<body  bgcolor="#CCCCFF" background="look/images/backgrounds/33.gif">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>{$lang['Program_coordinator_of_the_Poems']}</title>
<style>
 table, select, input, textarea { font-size:8pt; font-family:tahoma;}
</style>
<script language="javascript" src="includes/js/poem.js"></script>
<script language="javascript">
if (window.navigator.userAgent.search(/MSIE/)==-1) {
	document.write("<table align=center><tr><td><br><font face=arial color=red size=5>{$lang['Explorer_browser_only']}</font><br>");
	document.write("</td></tr></table>");
	document.write("</div>");
}
  var timerID;
  var sep = "|||";
  function getCurrentSettings() {
    var s = "";
    s += fname[0].value.replace(sep,"") + sep + fsize.selectedIndex + sep + fstyle.selectedIndex + sep + fcolor.selectedIndex;
    s += sep + bkimage[0].value.replace(sep,"") + sep + bkcolor.selectedIndex;
    s += sep + bstyle.selectedIndex + sep + bsize.selectedIndex + sep + bcolor.selectedIndex;
    s += sep + pnumcolor.selectedIndex + sep + pnumstart.value;
    s += sep + ptype.selectedIndex + sep + pline.selectedIndex + sep + palign.selectedIndex + sep + puse.selectedIndex;
    return s;
  }

  function showCurrentSettings() {
    showModalDialog("index.php?page=misc&poem_template=1", getCurrentSettings(), "help:no; status:no; dialogHeight:170px; dialogWidth:300px");
  }

  function loadTemplate(i) {
    if (i<=0) return;
	if (i>=templates.options.length) return;
    var s = templates.options[i].value.split(sep);
    templates.selectedIndex = 0;
    fname[0].text = "(" + s[0] + ")"; fname[0].value = s[0];
    fsize.selectedIndex = s[1];
    fstyle.selectedIndex = s[2];
    fcolor.selectedIndex = s[3];
    bkimage[0].value = s[4]; bkimage.selectedIndex = 0;
    bkcolor.selectedIndex = s[5];
    bstyle.selectedIndex = s[6];
    bsize.selectedIndex = s[7];
    bcolor.selectedIndex = s[8];
    pnumcolor.selectedIndex = s[9];
	s[10] = parseInt(s[10]);
	if (isNaN(s[10]))
		s[10] = 0;
    pnumstart.value = s[10];
	if (pnumstart.value == 0)
		pnum.selectedIndex = 0;
	else
		pnum.selectedIndex = 1;
    ptype.selectedIndex = s[11];
    pline.selectedIndex = s[12];
    palign.selectedIndex = s[13];
    puse.selectedIndex = s[14];
	showNumBlock();
  }

  function initializeTemplates(s) {
    var oOption = document.createElement("OPTION");
    templates.options.add(oOption);
    oOption.innerText = "{$lang['Template_numr']}" + (templates.length - 1);
    oOption.value = s;
  }

</script>
</head>

<body bgcolor="#FFE1CE" onload="showPoem(1)">
<div align="center">
  <center>
<table border="0" cellpadding="2" cellspacing="0" style="color:brown;margin-right:10px;margin-top:10px" width="540px">
  <tr>
	<td width="100%" align="center"valign="top" bgcolor="white">
	<font color="red">
{$lang['Example_for_the_coordination_of_the_poem']}
	</font>
	</td>
  </tr>
  <tr>
  <img id="testImage" onload="clearInterval(timerID);loadingMsg.style.display='none'" width="100%" height="60">

    <td width="100%" align="center" height="115px" valign="top" bgcolor="#f7f7f7">
<div id="poemExample" style="display:none">لغة الكلامِ كما رأيتَ على فمي = خجلى ولولا الحبُّ لم أتكلـمِ</div>
<div id="poemPreview"></div>
	</td>
  </tr>
  <tr><td align="right">
	<!-- start of format box -->
		<table border="0" cellpadding="2" cellspacing="0" width="450px" style="color:brown">
			<tr>
			<td width="100%" nowrap>
				<font size="2" color="#000000">{$lang['Type']}:</font>
				{$lang['النوع']}
				<select dir="ltr" size="1" onchange="selectFont(this);showPoem(1)" name="fname">
				  <option value="Simplified Arabic">(Simplified Arabic)
				  <option>Custom ...
				  <option>Andalus
				  <option>Arabic Transparent
				  <option>Arial
				  <option>Courier
				  <option>Courier New
				  <option>MS Dialog
				  <option>MS Sans Serif
				  <option>Simplified Arabic
				  <option>Tahoma
				  <option>Times New Roman
				  <option>Traditional Arabic
				</select>&nbsp; الحجم <select size="1" name="fsize" onchange="showPoem(1)">
				  <option value="1">1&nbsp;&nbsp;
				  <option value="2">2
				  <option value="3">3
				  <option selected value="4">4
				  <option value="5">5
				  <option value="6">6
				  <option value="7">7
				</select> الشكل <select size="1" name="fstyle" onchange="showPoem(1)">
				   <option value="normal,normal" selected>عادي
				   <option value="bold,normal">سميك
				   <option value="normal,italic">مائل
				   <option value="bold,italic">كلاهما
				</select> اللون <select size="1" name="fcolor" style="width:50" onchange="document.body.focus(); showPoem(1)">
					<option style="background-color:black; color:black" selected>
					<option style="background-color:white">
					<option style="background-color:skyblue">
					<option style="background-color:royalblue">
					<option style="background-color:blue">
					<option style="background-color:darkblue">
					<option style="background-color:orange">
					<option style="background-color:tomato">
					<option style="background-color:coral">
					<option style="background-color:orangered">
					<option style="background-color:crimson">
					<option style="background-color:red">
					<option style="background-color:firebrick">
					<option style="background-color:darkred">
					<option style="background-color:green">
					<option style="background-color:limegreen">
					<option style="background-color:seagreen">
					<option style="background-color:deeppink">
					<option style="background-color:purple">
					<option style="background-color:indigo">
					<option style="background-color:burlywood">
					<option style="background-color:sandybrown">
					<option style="background-color:sienna">
					<option style="background-color:chocolate">
					<option style="background-color:teal">
					<option style="background-color:silver">
					<option style="background-color:gray">
				</select></td>
		  </tr>
		  <tr>
			<td width="100%">
				<font size="2" color="#000000">الخلفية:</font> الصورة
				<select size="1" onchange="selectImage(this);showPoem(1);" name="bkimage">
				  <option value="">...
				  <option selected>بلا
				  <option>رابط...
				</select>&nbsp;اللون <select size="1" name="bkcolor" style="width:50" onchange="document.body.focus();showPoem(1)">
					<option style="background-color:transparent; color:black" selected>بلا
					<option style="background-color:black">
					<option style="background-color:white">
					<option style="background-color:skyblue">
					<option style="background-color:royalblue">
					<option style="background-color:blue">
					<option style="background-color:darkblue">
					<option style="background-color:orange">
					<option style="background-color:tomato">
					<option style="background-color:coral">
					<option style="background-color:orangered">
					<option style="background-color:crimson">
					<option style="background-color:red">
					<option style="background-color:firebrick">
					<option style="background-color:darkred">
					<option style="background-color:green">
					<option style="background-color:limegreen">
					<option style="background-color:seagreen">
					<option style="background-color:deeppink">
					<option style="background-color:purple">
					<option style="background-color:indigo">
					<option style="background-color:burlywood">
					<option style="background-color:sandybrown">
					<option style="background-color:sienna">
					<option style="background-color:chocolate">
					<option style="background-color:teal">
					<option style="background-color:silver">
					<option style="background-color:gray">
				</select>&nbsp;&nbsp;<span id="loadingMsg" style="color:blue"> </span></td>
		  </tr>
		  <tr>
			<td width="100%">
				 <font color="#000000" size="2">الإطار:</font>النوع
				 <select size="1" name="bstyle" onchange="showPoem(1)">
					<option value="none" selected>بلا
					<option value="solid">مصمت
					<option value="double">مزدوج
					<option value="groove">أخدود
					<option value="ridge">تل
					<option value="inset">مغروز
					<option value="outset">مرتفع
				 </select> الحجم <select size="1" name="bsize" onchange="showPoem(1)">
					<option>1
					<option>2
					<option>3
					<option selected>4
					<option>5
					<option>6
					<option>7
					<option>8
					<option>9
					<option>10
				 </select> اللون <select size="1" style="width:50" name="bcolor" onchange="document.body.focus();showPoem(1);">
					<option style="background-color:black; color:black">
					<option style="background-color:white">
					<option style="background-color:skyblue">
					<option style="background-color:royalblue">
					<option style="background-color:blue">
					<option style="background-color:darkblue">
					<option style="background-color:orange">
					<option style="background-color:tomato">
					<option style="background-color:coral">
					<option style="background-color:orangered">
					<option style="background-color:crimson">
					<option style="background-color:red">
					<option style="background-color:firebrick">
					<option style="background-color:darkred">
					<option style="background-color:green">
					<option style="background-color:limegreen">
					<option style="background-color:seagreen">
					<option style="background-color:deeppink">
					<option style="background-color:purple">
					<option style="background-color:indigo">
					<option style="background-color:burlywood">
					<option style="background-color:sandybrown">
					<option style="background-color:sienna">
					<option style="background-color:chocolate">
					<option style="background-color:teal">
					<option style="background-color:silver">
					<option style="background-color:gray" selected>
				</select></td>
		  </tr>
		  <tr>
			<td width="100%">
				 هل تريد إظهار أرقام الأبيات ؟
				 <select size="1" name="pnum" onchange="showNumBlock();showPoem(1)">
				   <option selected value="0">لا
				   <option value="1">نعم
				 </select>
				 <span id="numblock">تبدأ الأرقام من <input type="text" value="1" side="2" size="4" name="pnumstart" onblur="showPoem(1)" onkeydown="if (event.keyCode == 13) showPoem(1);">
				  لون الأرقام <select size="1" name="pnumcolor" onchange="document.body.focus(); showPoem(1)">
					<option style="background-color:black; color:black" selected>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<option style="background-color:white">
					<option style="background-color:skyblue">
					<option style="background-color:royalblue">
					<option style="background-color:blue">
					<option style="background-color:darkblue">
					<option style="background-color:orange">
					<option style="background-color:tomato">
					<option style="background-color:coral">
					<option style="background-color:orangered">
					<option style="background-color:crimson">
					<option style="background-color:red">
					<option style="background-color:firebrick">
					<option style="background-color:darkred">
					<option style="background-color:green">
					<option style="background-color:limegreen">
					<option style="background-color:seagreen">
					<option style="background-color:deeppink">
					<option style="background-color:purple">
					<option style="background-color:indigo">
					<option style="background-color:burlywood">
					<option style="background-color:sandybrown">
					<option style="background-color:sienna">
					<option style="background-color:chocolate">
					<option style="background-color:teal">
					<option style="background-color:silver">
					<option style="background-color:gray">
				</select></span></td>
		  </tr>
		  <tr>
			<td width="100%">
			<div align="center">
			  <center>
			  <table border="1" cellspacing="0" bordercolor="#818B89" style="border-collapse: collapse;">
					  <tr>
						<td width="25%" align="center" bgcolor="#F7F7F7">
						<font color="#8B0000">هيئة القصيدة</font></td>
						<td width="25%" align="center" bgcolor="#F7F7F7">
						<font color="#8B0000">المسافة بين الأبيات</font></td>
						<td width="25%" align="center" bgcolor="#F7F7F7">
						<font color="#8B0000">جهة القصيدة</font></td>
						<td width="25%" align="center" bgcolor="#F7F7F7">
						<font color="#8B0000">طريقة التنسيق</font></td>
					  </tr>
					  <tr>
						<td width="25%" align="center">
					<select size="1" name="ptype" onchange="showPoem(1)">
					  <option selected value="0">عمودان
					  <option value="1">منحدر
					  <option value="2">متداخل
					  <option value="3">عمود
					</select></td>
						<td width="25%" align="center"> <select size="1" name="pline" onchange="showPoem(1)">
					  <option value="0" selected>متقاربة
					  <option value="1">متباعدة
					</select></td>
						<td width="25%" align="center"> <select size="1" name="palign" onchange="showPoem(1)">
					 <option value="right">يمين
					 <option value="center" selected>وسط
					 <option value="left">يسار
				   </select></td>
						<td width="25%" align="center"> <select size="1" name="puse" onchange="showPoem(1)">
					  <option value="sp">بتباعد الكلمات
					  <option value="ex" selected>بامتداد الكلمات
				   </select></td>
					  </tr>
					</table>
			  </center>
			</div>
			</td>
		  </tr>
		  <tr>
			<td width="100%" align="left">
		  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;color:brown" bordercolor="#111111" width="100%">
			<tr>
			  <td width="50%" nowrap>تصاميم جاهزة
				 <select size="1" name="templates" onchange="loadTemplate(this.selectedIndex);showPoem(1)">
				 <option selected>اختر تصميم جاهز
				 </select></td>
			  <td width="50%" align="left" nowrap>
			  <input type="button" value="حفظ (للإدارة)" onclick="showCurrentSettings()">
			  <input type="button" id="accept" value="اعتمد" onclick="showPoem(0)">
			  <input type="button" value="إلغاء" onclick="window.returnValue=''; window.close()"></td>
			</tr>
		  </table>
			</td>
		  </tr>
		  <tr><td><font color="#FF0000">ملاحظة : </font><font color="#0000FF">لكتابة القصيدة افصل شطري كل بيت بعلامة المساوة ( = ) </font>
		  </td></tr>
		  </table>
	<!-- end of format box -->

  </td></tr>
</table>

  </center>
</div>

<script language="javascript" src="includes/js/poem_settings.js"></script>

<script language="javascript">

  for (seli = 1; seli <= imageCount; seli++) {
    var oOption = document.createElement("OPTION");
    bkimage.options.add(oOption);
    oOption.innerText = seli;
    oOption.value=seli;
  }

  function selectImage(ob) {
    var i = ob.selectedIndex, img;
    if (i == 0)
      img = ob[0].value;
    else if (i == 1)
      img = "";
    else if (i == 2) {
      img = window.prompt("أدخل هنا رابط الصورة :", (ob[0].value)?ob[0].value:"http://");
      if (img == null)
        img = ob[0].value;
      ob.selectedIndex = 0;
    }
    else {
	  clearInterval(timerID);
      img = "look/images/backgrounds/" + ob[i].value + ".gif";
	  loadingMsg.innerHTML = "جارى تحميل الخلفية ، الرجاء الانتظار ...";
	  loadingMsg.style.display = "inline";
	  timerID = setInterval("blink()", 500);
	  testImage.src = (img);

	}
    ob[0].value = img;
  }

  function blink() {
	if (loadingMsg.style.display == 'inline')
		loadingMsg.style.display = "none";
	else
		loadingMsg.style.display = "inline";
  }

  function selectFont(ob) {
    var i = ob.selectedIndex, f;
    if (i == 0)
      return;
    else if (i == 1) {
      f = window.prompt("أدخل هنا اسم الخط :", ob.options(0).text.replace(/\(/g,"").replace(/\)/g,""));
      if (f == null) {
        ob.selectedIndex = 0;
        return;
      }
    }
    else
      f = ob.options(i).text;
    ob.options(0).text = "(" + f + ")";
    ob.options(0).value = f;
    ob.selectedIndex = 0;
  }

  function setFontStyle(i) {
    fbold = 0;
    fitalic = 0;
    if (i == 1 || i == 3) fbold = 1;
    if (i == 2 || i == 3) fitalic = 1;
  }

  function getColor(o) {
    return (o.options[o.selectedIndex].style.backgroundColor);
  }

  function getValue(o) {
    return (o.options[o.selectedIndex].value);
  }

  function getText(o) {
    return (o.options[o.selectedIndex].text);
  }

  function imageBrowse() {
    var img = showModalDialog("backgrounds.htm", imageCount , "help:no; status:no; dialogHeight:460px; dialogWidth:600px");
    if (img!="") {
      bkimage.selectedIndex=parseFloat(img)+2;
      img = "look/images/backgrounds/" + img + ".gif";
      bkimage[0].value = img;
    }
  }

  function showPoem(preview) {
    var arg = "";
	arg += "font='" + fname[0].value + "," + getValue(fsize) + "," + getColor(fcolor) + "," + getValue(fstyle) + "'";
    arg += " bkcolor='" + getColor(bkcolor) + "' bkimage='" + ((preview) ? '../':'')+ bkimage[0].value + "'";
    arg += " border='" +  getValue(bstyle) + "," + getText(bsize) + "," + getColor(bcolor) + "'";
    arg += " type=" + getValue(ptype) + " line=" + getValue(pline) + " align=" + getValue(palign) + " use=" + getValue(puse);
	arg += " num='" + pnumstart.value + "," + getColor(pnumcolor) + "'";
    arg = arg.replace(/'/g,'"');
	if (preview) {
		poemExample.tag = arg;
		doPoem(1);
	} else {
		window.returnValue = arg;
		window.close();
	}
  }

  function showNumBlock() {
	if (pnum.value == 0)
		numblock.style.display = "none";
	else
		numblock.style.display = "inline";
	pnumstart.value = pnum.value
  }

  showNumBlock();

</script>
</body>


</html>