var popup_name;
var p_title_value;
var p_titletext_value;
var p_text_value;
var p_date_begin_value;
var p_sort_value;
var p_url_value;
var p_email_value;
var p_offline_value;
var p_image_value;
//var hidden_textde;

function MM_openBrWindow(theURL,winName,features,posx,posy){
	features = features + ',left=' + posx + ',top=' + posy;
  popup_name = window.open(theURL,winName,features);
  self.name = "popup"
  if (popup_name.opener == null)
  	popup_name.opener = self
}
function close_popup(){
  popup_name = window.open("", "fern", "height=190,width=650")
  if (popup_name && !popup_name.closed)
    popup_name.close()
  self.name = "main"
}

function AllFrames(frame1, url1, frame2, url2, frame3, url3)
{
	frame1.location.href = url1;
	if (frame2)
		frame2.location.href = url2;
	if (frame3)
		frame3.location.href = url3;
}

function senddata(button){
	if(button == "delete") {
		Check = confirm("Wollen Sie diesen Eintrag endgültig löschen?\nBitte beachten Sie, dass die Daten nicht wieder hergestellt werden können.");
		if(Check == false) button = "cancel";
	}
  document.form.button.value = button;
//	  hidden_textde = document.form.textde.value;
//		window.alert(hidden_textde);
}

function savedata(url){
  p_title_value = document.form.title.value;
  p_titletext_value = document.form.titletext.value;
  p_text_value = document.form.text.value;
	if (url != "touristform")
	  p_date_begin_value = document.form.date_begin.value;
	else
	  p_sort_value = document.form.sort.value;
  p_url_value = document.form.url.value;
  p_email_value = document.form.email.value;
  p_image_value = document.form.image.value;
  p_offline_value = document.form.offline.value;
}

function savedata_url(url){
//  document.form.p_title.value = document.form.title.value;
  p_title_value = document.form.title.value;
//	window.alert("title: "+document.form.title.value+" p_title_value: "+document.form.p_title.value)
	window.alert("title: "+document.form.title.value+" p_title_value: "+p_title_value);
	MM_openBrWindow("images.php<?php include ('../php/rmlib/sent_fields.php'); ?>&url=url&p_title='+p_title_value+'&newsnumber=<?php echo $number ?>","fern","toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=0,dependent=yes,width=650,height=400")
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function websPopup(URL, width, height, bar, scroll, resize) {
	window.open(URL,"popup","width=" + width + ",height=" + height + ",menubar=" + bar + ",scrollbars=" + scroll + ",resizable=" + resize);
}
