/* BLOG51
   JVS Help-Functions
   lchange 18082004 */


//Create var_tag
function vartag() { txt=prompt("Variable eingeben...","$"); if (txt) { txt = "<?php echo "+txt+"?>"; pshtext(txt); } }

// Unset var_text
var text = "";
function getActiveText(selectedtext) { text = (document.all) ? document.selection.createRange().text : window.getSelection();
if (selectedtext.createTextRange) { selectedtext.caretPos = document.selection.createRange().duplicate();} return true;}

// Push text into document
function pshtext(content) {
if (document.form.txt.createTextRange && document.form.txt.quad) {var quad = document.form.txt.quad;
quad.text = quad.text.charAt(quad.text.length - 1) == ' ' ? content + ' ' : content;} else { document.form.txt.value+=content }
setfocus();}

// Focus document
function setfocus() { document.form.txt.focus(); }

// Enter url to document.form
function url() {
url=prompt("URL eingeben...","http://");
if (url) { url="<a target='_new' href='"+url+"'>";}
txt=prompt("Text eingeben...","Link");
if (txt) { txt=url+txt+"</a>"; pshtext(txt); } }

// Enter searchtag to document.form
function searchtag(content) {
txt=prompt("Suchtext eingeben...\nBsp.: wau+holland+datengarten","");
if (txt) { txt="<A target='_new' href='"+content+txt+"'>"; pshtext(txt); } }

// Enter pic-url to document.form
function pic() {
txt=prompt("Bilddatei eingeben...","[pfadangabe/url]");
if (txt) { txt="<IMG src='"+txt+"' alt='' title='' align=''>"; pshtext(txt); } }

// Enter list to... I think, you get the picture....sure...
function list() {
txt=prompt("Eingabe:\nFeld freilassen, um Liste zu beenden.","");
if (txt) { ul="<ul>"; pshtext(ul); txt="<li>"+txt+"\r"; pshtext(txt); var txt=1; }
while ((txt!="") && (txt!=null)) {
 	txt=prompt("Eingabe:\nFeld freilassen, um Liste zu beenden.","");
 	if(txt) {txt="<li>"+txt+"\r"; pshtext(txt);} } if (txt!=null) { txt="</ul>";  pshtext(txt); } }

// Open scrollable window
function popscroll(url,name,w,h) { var x = window.open(url,name,'width='+w+',height='+h+',toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,menubar=no')}

// Open non-scrollable window
function popnoscroll(url,name,w,h) { var x = window.open(url,name,'width='+w+',height='+h+',toolbar=no,location=no,status=no,scrollbars=no,resizable=no,menubar=no')}





