function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }

var skatFenster;

function win(url,name,what) {
	window.onerror = meinError;
	var scroll = "";
	if (what==1) {
		w = 360;
		h = 510;
	}
	else if (what==3) {
		//Infofenster
		w = 400;
		h = 400;
		scroll = ",scrollbars=yes";
	}
	else {
		w = 800;
		h = 600;
	}
	if (skatFenster!=undefined) skatFenster.close();
	skatFenster = window.open(url,name,"width="+w+",height="+h+",menu=no,status,location=no,directories=no,copyhistory=no,resizable=yes,menubar=no,top=0,left=0"+scroll);  
	//centerWindow (skatFenster,w,h);
	//skatFenster.defaultStatus="skat spielen";
	//skatFenster.focus();
}

function meinError() {
	var Fehler = "Fehler: Bitte überprüfe die Javascript-Einstellungen deines Browsers und deaktiviere ggf. aktive Pop-Up-Blocker.";
	alert(window.Fehler);
	return true;
}

function centerWindow (targetWin,winw,winh) {
	var ha = screen.availHeight;
	var h = screen.height;
	var wa = screen.availWidth;
	var w = screen.width;
	if (ha > 0 && wa > 0) {
			var ww = wa;
			var wh = ha;
	}
	else {
			var ww = w-30;
			var wh = h-40;
	}
	var posx = (ww - winw) / 2;
	var posy = (wh - winh) / 2;
	targetWin.moveTo(posx,posy);
}

