function popupOpen() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=popupOpen.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win=window.open(url,'win_front','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win.focus();
}

function openPicture() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=openPicture.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win_pic=window.open(url,'win_pic','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win_pic.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win_pic.focus();
}

////// Scrolling ///////
var scroll_speed=16;
var scroll_tid=null;
var last_left=0;
var init=false;
var scroll_width=0;
var start_x=0;

function startScrolling(dir,obj) {
	if (!init) {
		scroll_width=document.getElementById(obj).parentNode.scrollWidth;
		start_x=document.getElementById(obj).offsetLeft;
		init=true;
	}
	if (dir=='right') 
		var speed= scroll_speed;
	else 
		var speed= -scroll_speed;
	scroll_tid=setInterval('_scrollDiv("'+obj+'",'+speed+')', 50);
}
function _scrollDiv(obj,speed) {
	obj=document.getElementById(obj);
	var x=obj.offsetLeft;
	var _x=obj.style.left;
	if (x=='') x=0;
	else {
		if ( x+speed > start_x && speed>0) {
			speed=0;
			stopScrolling();
		}
		if ( -obj.offsetLeft + obj.parentNode.offsetLeft + obj.parentNode.clientWidth - speed > scroll_width && speed < 0) {
			speed=0;
			stopScrolling();
		}
		
	}
	obj.style.left=(last_left+speed)+'px';
	last_left+=speed;
}
function stopScrolling() {
	clearInterval(scroll_tid);
}
