function getSelText(){
       var txt = '';
       if (window.getSelection){
               txt = window.getSelection();
       }else if (document.getSelection){
               txt = document.getSelection();
       }else if (document.selection){
               txt = document.selection.createRange().text;
       }
       return txt;
}



document.onkeydown  = function(){
	//alert();
       var e = arguments[0] || window.event;
       var code=e.keyCode?e.keyCode:(e.which?e.which:e.charCode);
       if(e.ctrlKey && code==13){
               ShowMsgForm();
       }
}

function ShowMsgForm()
{
	var ifrm = document.getElementById('iframe_errMsg');
	//alert(document.body.scrollTop);
	if(!ifrm){
		var myIframe = document.createElement("iframe");
		myIframe.id="iframe_errMsg";
		//myIframe.style="z-index:100;background:#fff;;padding:20px 16px 6px;:500px;:400px;";
		myIframe.style.position="absolute";
		
		myIframe.style.background="#fff";
		myIframe.style.left="100";
		//myIframe.style.right="400";
		myIframe.style.width="500";
		myIframe.style.height="400";
		myIframe.style.border="1px solid #bbb";
		
		document.body.appendChild(myIframe);
	}
	

	 var text = getSelText();
         txt = text.toString();
         if(txt.length > maxTXT_Length){
             alert(err_maxTXT_Length);
			 return;
          }
		  if(txt.length < 1){
			    alert(err_minTXT_Length);
			 return;
		  }
		
	var seite='<div id="frm_errMsg"><div onclick="return parent.CloseMsgForm()" id="close-form-window" title="close" style="width:12px;height:11px;float:right;cursor:pointer;margin:-14px 10px 0 0;display:inline;">x</div>'
			+'<table><tr><td>'
			+'<h3>'+Lang_Title+'</h3>'
			+'<p>'+Lang_Description+'</p>'
			+'</td></tr></table>'
			+'<br />'
			+'<form action="'+form_action+'" method="post">'
			+'<table class="form-table data-table"><tbody>'
			+'<tr><td>'+Lang_SiteAdresse+'</td>'
			+' <td>'+Server_url+'<input type="hidden" value="'+Server_url+'" name="server_url"/></td></tr>'
			+'<tr><td>'+Lang_Text_mit_Fehler+'</td>'
			+'<td><textarea name="form_textarea_30" id="frm_err_str" cols="30" rows="5" class="inputtextarea" >'+txt+'</textarea></td></tr>'
			+'<tr><td>'+Lang_Kommentar+'</td>'
			+'<td><textarea name="form_textarea_31" cols="30" rows="5" class="inputtextarea"></textarea></td></tr>'
			+'</tbody><tfoot><tr><th colspan="2">'
			+'<input type="submit" name="web_form_apply" value="'+Lang_Submit+'" /><input type="reset" value="'+Lang_Reset+'" />'
			+'</th></tr></tfoot></table></form></div>'
			+''
			+''
			+''
			+''
			+''
			+''
			+''
			+''
			+''
			+''
			+''
			+''
	;
	var ifrm = document.getElementById('iframe_errMsg');
		ifrm.style.display = "block";
		ifrm.style.top=document.body.scrollTop+100;
        ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument;
        ifrm.document.open();
        ifrm.document.write(seite);
        ifrm.document.close();
}

function CloseMsgForm()
{
   var div = document.getElementById("iframe_errMsg");
   if (!div)
      return;

   div.style.display = "none";
   return false;
}

