function openNew(url,name,width,height) {
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no";

	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function openNewwithScrollers(url,name,width,height) {
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function openNewCenter(url,name,b,h) {

	var winleft = (screen.width - b) / 2;
	var winUp = (screen.height - h) / 2;

	options = "left="+ winleft +", top=" + winUp + ", width=" + b + ", height=" + h;
	options = options+ ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function TreePopUp(url,name) {

 var winleft = (screen.width) - 220;
 var winheight = (screen.height) - 40;


 options = "left="+ winleft +", top=0, width=" + 210 + ", height=" + winheight;
 options = options+ ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

 new_window = window.open(url, name, options);
 window.self.name = "main";

 window.resizeTo(winleft, screen.height);
 window.moveTo(0,0)

 new_window.focus();

}

function img_popup(pic, width, height){
        var temp = new Image();
        temp.src = pic;
        var head = "<html><head></head><body leftmargin='0' marginwidth='0' topmargin='0' marginheight='0'>";
        var foot = "</body></html>";

        var newWindow = window.open('#','headline_img','height='+(height)+'px, width='+(width)+'px');
        with(newWindow.document){
          open();
          write(head+'<img src="'+pic+'">'+foot);
          close();
        }
}

function fehlerAus(){

 if(document.komment.gal_comment.value.length >=3){
	returnval = true;
  }else{
 // alert(document.komment.gal_comment.value.length);
	document.getElementById('emessage').innerHTML = 'Bitte geben Sie min. 3 Zeichen ein.';
	returnval = false;
  };
return returnval;
}