function ArtGalSwitch(img, width, height) {
    document.getElementsByName("galeriebild")[0].width = width;
    document.getElementsByName("galeriebild")[0].height = height;
    document.getElementsByName("galeriebild")[0].src = img;
}

function OpenVideoPlayer(url, id) {
	var VideoPlayer;
	var pageW = 352+20;
	var pageH = 288+20;
	if (!VideoPlayer) {
		VideoPlayer = window.open(url+'videoplayer.php?id='+id, "", 'menubar=0,location=0,resizable=0,scrollbars=0,status=0,width='+pageW+',height='+pageH+'')
	}
	myWindow.focus();
}

function GotoURL(url) {
    window.location.href = url;
}

function ShowDetails(url) {
	var myWindowDetails;
	var width = 700;
	var height = 485;
	if (!myWindowDetails) {
		myWindowDetails = window.open(url, "", 'menubar=0,location=0,resizable=0,scrollbars=1,status=0,width='+width+',height='+height+'')
	}
	myWindowDetails.focus();
}


function newWindow(url, width, height) {
	var myWindow;
	if (!myWindow) {
		myWindow = window.open(url, "", 'menubar=0,location=0,resizable=0,scrollbars=1,status=0,width='+width+',height='+height+'')
	}
	myWindow.focus();
}

function popup_adjust() {
    var w, h, fixedW, fixedH, diffW, diffH;
    if (document.all) {
        fixedW = document.body.clientWidth;
        fixedH = document.body.clientHeight;
        window.resizeTo(fixedW, fixedH);
        diffW = fixedW - document.body.clientWidth;
        diffH = fixedH - document.body.clientHeight;
    } else {
        fixedW = window.innerWidth;
        fixedH = window.innerHeight;
        window.resizeTo(fixedW, fixedH);
        diffW = fixedW - window.innerWidth;
        diffH = fixedH - window.innerHeight;
    }
    w = fixedW + diffW;
    h = fixedH + diffH;
    if (h >= screen.availHeight) w += 16;
    if (w >= screen.availWidth)  h += 16;
    w = Math.min(w,screen.availWidth);
    h = Math.min(h,screen.availHeight);
    window.resizeTo(w,h);
    window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}