function transfer()
{

document.myform["frmContent"].value = document.getElementById("innerContent").innerHTML;

}



function sizer(myvar,scr)
{document.execCommand('FontSize','true',myvar); document.all["innerContent"].focus();}

function kolor(myvar,scr)
{document.execCommand('ForeColor','false',myvar); document.all["innerContent"].focus();}

function fonter(myvar,scr)
{document.execCommand('FontName','false',myvar); document.all["innerContent"].focus();}















var countdown;
var varCountDownplus = 1;
var varCountDownminus = 140;

function refreshStatus(varCountup)
{

varCountDownplus = varCountDownplus + varCountup;
countdown = "<div style=\"background-color:#0079B0; margin-top:1px; height:13px; width:"+varCountDownplus+"px;\"></div>";

document.getElementById("boxRefreshStatus").innerHTML = countdown;

if(varCountDownplus == 136)
{
document.myformActivate.submit();
}
}



function refreshStatusEnd(varCountup)
{

varCountDownminus = varCountDownminus - varCountup;
countdown = "<div style=\"background-color:#0079B0; margin-top:1px; height:13px; width:"+varCountDownminus+"px;\"></div>";

document.getElementById("boxRefreshStatus").innerHTML = countdown;



if(varCountDownminus == 1)
{
document.myformActivate.submit();
}

}

function startStatus()
{
setInterval("refreshStatus(1)",72)
}



function endStatus()
{
setInterval("refreshStatusEnd(1)",72)
}













function clearImage(mydiv)
{

window.document.myform.frm_bild.value = '';
document.getElementById(mydiv).innerHTML = "";

  
}


function translater()
{

VarUrlText = document.myform.frm_content.value



breite = 410;
hoehe = 200;
// Errechnet Koordinaten, um das Popup zentriert zu platzieren
      links = (screen.width/2)-(breite/2);
      oben = (screen.height/2)-(hoehe/2);

window.open("http://translate.google.com/translate_t?text="+VarUrlText+"&langpair=de|fr","mywin","height="+hoehe+",width="+breite+",status = yes,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars = no,fullscreen = no,top ="+oben+",left ="+links)
//http://translate.google.com/translate_t?text=apple&langpair=en|de

}




function dialog(mytype,myname, myurl,mystatus)
{
if(mytype == 0)
 {

if(mystatus == 1)
{
abfrage=confirm("Soll «"+ myname + "» ausgeblendet werden ?")
 }
else
 {
abfrage=confirm("Soll «"+ myname + "» eingeblendet werden?")
 
 }
 }
else

{
abfrage=confirm("Soll «"+ myname + "» gelöscht werden?")
}
if(!abfrage)
{return (false)}
else{location.href=myurl;
}
}


var win;
function winOpen(url,wt,ht) {
lt=(screen.width/2)-(wt/2);
tp=(screen.height/2)-(ht/2);


win=window.open(url, "id","status=yes, scrollbars=yes,menubars=no,resizable=yes,toolbars=no,height="+ht+",width="+wt+",top="+tp+",left="+lt)
win.focus;

}




/////////////////////// 
///////////////////////
///////////////////////
///////////////////////
////CHeckboX FUNCZION
function checkAll(elm,name){
 for (var i = 0; i < elm.form.elements.length; i++)
  	if (elm.form.elements[i].name.indexOf(name) == 0)
	    elm.form.elements[i].checked = elm.checked;
}


/////////////////////// 
///////////////////////
///////////////////////
///////////////////////
////SEND NEWSLETTER
function sender(mytype,myname, myurl,mystatus)
{

abfrage=confirm("Soll der Newsletter «"+ myname + "» jetzt versandt werden ?")


if(!abfrage)
{return (false)}
else{location.href=myurl;
}


}





function myCopy(a, b)
	{
if(document.myform[b].value != "")
{
document.myform[a].value = document.myform[b].value;
}
}




/////////////////////// 
///////////////////////
///////////////////////
///////////////////////
////DOK FUNCZION
function mydok(myid,name, dat_name)
	{
	
		if (window.opener && !window.opener.closed)
{
if(myid == "hl")
{
			window.opener.document.myform.frm_dokumente.value = dat_name;
			window.close();

}
	}
		}


/////////////////////// 
///////////////////////
///////////////////////
///////////////////////
////Bild FUNCZION


function mybild(myid, name)
	{
	
	
		if (window.opener && !window.opener.closed)
{
if(myid == "hl")
{

window.opener.document.getElementById("adminBoxImage").innerHTML = "<img src=\"../img/up/"+name+"\">";

			window.opener.document.myform.frm_bild.value = name;
			window.close();
}
	}
		}








/////////////////////// 
///////////////////////
///////////////////////
///////////////////////
////VERWEIS FUNCZION
function mylink(myid, name,il, realname,ref)
	{
	
if(myid == "single")

{
eingabe=prompt("Bitte Name des Verweises eingeben - default ist link",realname)

old = window.opener.document.myform[ref].value + "\n" 



if(eingabe ==""  || eingabe == null)
{
eingabe = "link"
}

if(il == "dl")
{
notold = "[dlk="+ name +"]"+ eingabe +"[/dlk]";
}
else if(il == "il")
{
notold = "[ilk="+ name +"]"+ eingabe +"[/ilk]";
}
else
{
notold = "[lk="+ name +"]"+ eingabe +"[/lk]";
}

window.opener.document.myform[ref].value = old + notold
	window.close();


}
}


/////////////////////// BOLD
///////////////////////
///////////////////////
///////////////////////
function bold(myvar)
{
old=document.myform[myvar].value
eingabe=prompt("Bitte hier den zu bearbeitenden Text eingeben (Fett)","")

if(eingabe)

{ if(eingabe!="")
{
fett="[b]"+eingabe+"[/b]";
document.myform[myvar].value=old+ " "+ fett
}
}}



/////////////////////// ITALIC
///////////////////////
///////////////////////
///////////////////////
function italic(myvar)
{
old=document.myform[myvar].value
eingabe=prompt("Bitte hier den zu bearbeitenden Text eingeben (Italic)","")

if(eingabe)

{ if(eingabe!="")
{
fett="[i]"+eingabe+"[/i]";
document.myform[myvar].value=old+ " "+ fett
}
}}



/////////////////////// URL LINK
///////////////////////
///////////////////////
///////////////////////
function link(myvar)
{
old=document.myform[myvar].value
eingabe=prompt("Bitte hier die URL( z.b. www.sbb.ch)  eingeben","")
eingabel=prompt("Bitte hier den Namen eingeben (Optional)","")

if(eingabe)
{

if(eingabe.substr(0,7) == "http://")
{
eingabe = eingabe.substr(7,22222)
alert(eingabe)
}


if (eingabel == "")
{eingabel = eingabe}
fett="[url="+eingabe+"]"+eingabel+"[/url]";
document.myform[myvar].value=old+ " "+ fett
}}





////DELETE FUNCZION
function dialog3(dest,mytext,destfalse)
{

abfrage=confirm(mytext)

if(!abfrage)
{

location.href=destfalse
}
else{location.href=dest
}
}



