function neues()
	{
        var fensterbr = window.innerWidth;
        var fensterhe = window.innerHeight;

var ua = navigator.userAgent;
if(ua.indexOf("MSIE") >=0) {
        var fensterbr = parseInt(window.document.documentElement.clientWidth);
        var fensterhe = parseInt(window.document.documentElement.clientHeight);
}

	fenster=window.open("","NeuesFenster",+"toolbar=0"+",location=0"+",directories=0"+",status=0"+",menubar=0"+",scrollbars=1"+",resizable=1"+",width="+fensterbr+"px,height="+fensterhe+"px");
	fenster.location.href="http://sms16.de/ads/ad_frame.php";
}

function payment_window()
	{
        var fensterbr = window.innerWidth;
        var fensterhe = window.innerHeight;
	fenster=window.open("","NeuesFenster",+"toolbar=0"+",location=0"+",directories=0"+",status=0"+",menubar=0"+",scrollbars=1"+",resizable=1"+",width=800px,height=800px");
	fenster.location.href="http://sms16.de/ads/ad_frame.php";
}

function status(siteto)
	{
	fenster1=window.open("","NeuesFenster",+"toolbar=0"+",location=0"+",directories=0"+",status=0"+",menubar=0"+",scrollbars=1"+",resizable=1"+",width=800"+",height=600");
	fenster1.location.href=siteto;
}

function goTo(url){
  location.href = url;
}

function error_call(sx,sd){
 document.getElementById("errorcall").innerHTML = "Danke, wir kümmern uns darum.";
}

	function CheckLen(Target) {
		StrLen = Target.value.length;

		if (StrLen > 160) 
		{
			Target.value = Target.value.substring(0, 160);
			CharsLeft = 0; 
		}
		else {
			document.getElementById('ch125').innerHTML = 160 - StrLen; 

		
		}
	}

function CheckForm(Target){

if (Target.empfaenger.value.length < 1) {alert("Bitte Rufnummer eingeben."); document.smsform.empfaenger.focus(); return false; }
else if (Target.nachricht.value.length == 0) {alert("Bitte Nachricht eingeben."); document.smsform.nachricht.focus(); return false; }else {document.smsform.submit(); return true;}

}

function ereg(txt, search) {
	for(i = 0; i < txt.length; i++) {
		if (txt.substr(i,1) == search) return true;
	}
	return false;
}

function compress (txt) {
 var Ausdruck = /(.+)\s(.+)/;
 
 while (txt.search(Ausdruck) != -1){
	Ausdruck.exec(txt);
	txt = RegExp.$1 + RegExp.$2.charAt(0).toUpperCase() + RegExp.$2.substring(1, 1600);
 }

document.smsform.nachricht.value = txt;
CheckLen(document.smsform.nachricht);
}


function openWindow(URL,windowName,features) {
  var PathToStoreFront=null;
  if(openWindow.arguments.length>3) {
      PathToStoreFront=openWindow.arguments[3];
  }
  if(features=="PopUp") {
    features="width=1000, height=730, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="PopUpPrint") {
    features="width=790, height=580, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="RTE" || windowName=="RTE") {
    features="width=800, height=600, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="HelpWindow") {
    features="width=1000, height=730, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
    windowName="WWHFrame";
   }
  if(features=="StylePreview") {
    features="width=470, height=310, toolbar=no, status=no, resizable=no, menubar=no, location=no, scrollbars=yes";
    windowName="StylePreview";
   }
  if(features=="DetailedImageView") {
    features="width=1000, height=730, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
    windowName="StylePreview";
   }
  if(features=="CheckLink") {
    if(URL.indexOf("?") != 0) {
      splittedString = URL.split('//');
      if(splittedString.length ==1){
        URL ="http://"+URL;
      }
    } else if(PathToStoreFront!=null){
        URL = PathToStoreFront+URL;
    }
    features="toolbar=yes, status=yes, resizable=yes, menubar=yes, location=yes, scrollbars=yes";
  }

  newwin=window.open(URL,windowName,features);
  if(newwin) {
    newwin.focus();
  }

  return newwin;
}

function movesms(sid){
 var od = document.getElementById(sid);
 var nd = document.getElementById("main_smse1");
 nd.innerHTML = '<div id="main_smse1_entry'+sid+'">'+od.innerHTML+'</div><br />';
}



function isdefined(variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}


function fb_login(val){
 if(val){
  document.location='/user/account.php?facebook=1';
 }
}