Location: PHPKode > projects > Soraxdesign PHP Guestbook > templates/smilies.html
		<script type="text/javascript">
			function createRequestObject()
			{
				var ro;
				var browser = navigator.appName;
				if(browser == "Microsoft Internet Explorer"){
					ro = new ActiveXObject("Microsoft.XMLHTTP");
				}else{
					ro = new XMLHttpRequest();
				}
				return ro;
			}
			
			var smilyReq=createRequestObject();
			
			function SmiliesAnzeigen(form, feld)
			{
				if(document.getElementById('smilies').style.display=='none')
				{
				aktives_form=form;
				aktives_feld=feld
				smilyReq.open("GET", '%PFAD%/functions.inc.php?action=smiliesAnzeigen&pfad=%PFAD%', true);
				smilyReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				smilyReq.onreadystatechange = updateSmilyDiv;
				smilyReq.send(null);
				document.getElementById('smilies').style.display='block';
				document.getElementById('smilies_rahmen').style.display='block';
				document.getElementById('smilies_background').style.display='block';
				}
				else
				{
				document.getElementById('smilies').style.display='none';
				document.getElementById('smilies_rahmen').style.display='none';
				document.getElementById('smilies_background').style.display='none';
				}
			}
			
			function updateSmilyDiv()
			{
			
				if(smilyReq.readyState==3 || smilyReq.readyState==2)
				{
				document.getElementById('smilyDiv').innerHTML = "<center>%SMILIESLADEN%</center>";
				}
				
				if(smilyReq.readyState==4)
				{
			        var response = smilyReq.responseText;
				document.getElementById('smilyDiv').innerHTML = response;
				}
			}

			function SmilieEinfuegen(tag)
			{
				var input = document.forms[aktives_form].elements[aktives_feld];
				input.focus();
				
				document.getElementById('smilies').style.display='none';
				document.getElementById('smilies_rahmen').style.display='none';
				document.getElementById('smilies_background').style.display='none';
				
				if(typeof document.selection != 'undefined')
				{
					var range = document.selection.createRange();
					range.text = tag;
					
					range = document.selection.createRange();

						if (tag.length == 0)
							range.move('character', 0);
						else
							range.moveStart('character', 0);
					
					range.select();
				}
				else if(typeof input.selectionStart != 'undefined')
				{
					/* Einfügen des Formatierungscodes */
					var start = input.selectionStart;
					var end = input.selectionEnd;
					//var insText = input.value.substring(start, end);
					
					input.value = input.value.substr(0, start) + tag +" "+ input.value.substr(end);
					
					/* Anpassen der Cursorposition */
					var pos;
					
						if (tag.length == 0)
							pos = start;
						else
							pos = start + tag.length;
					
					input.selectionStart = pos;
					input.selectionEnd = pos;
				}
				else
				{
					/* Abfrage der Einfügeposition */
					var pos=input.value.length;
					
					/* Einfügen des Formatierungscodes */
					input.value = input.value.substr(0, pos) + tag + " "+ input.value.substr(pos);
				}
			}
		</script>
		<div id="smilies_background" style="position:absolute;display:none;">
		</div>
		<div id="smilies_rahmen" style="filter:Alpha(opacity=40,style=0);position:absolute;display:none;top:50%;left:50%;margin:0px;padding:0px;height:400px;width:320px;margin-left:-160px;margin-top:-200px;z-index:3;background-image:url('%PFAD%/admin/images/images/verwaltung/smile_background_rahmen.png');">
		</div>
		<div id="smilies" style="filter:Alpha(opacity=85,style=0);position:absolute;display:none;top:50%;left:50%;margin:0px;padding:0px;height:380px;width:300px;margin-left:-150px;margin-top:-190px;z-index:4;background-image:url('%PFAD%/admin/images/images/verwaltung/smile_background.png')">
			<p align="right" style="margin:0px;padding-top:5px;padding-right:5px">
				<a href="#" OnClick="javascript:document.getElementById('smilies_background').style.display='none';javascript:document.getElementById('smilies').style.display='none';document.getElementById('smilies_rahmen').style.display='none'"><img src="%PFAD%/admin/images/images/verwaltung/schliessen.gif" border="0" alt="" title=""></a>
			</p>
			<p style="margin:0px;padding:15px;padding-top:0px">
				<span class="titel"><font color="#000000">Smilies</font></span>
			</p>
			<div id="smilyDiv" style="overflow:auto;height:330px;width:300px">
				%SMILIES%
			</div>
		</div>
Return current item: Soraxdesign PHP Guestbook