// Written 2005,2010 by Frank Blechschmitt, FBIS
//

google_ad_client = "pub-9447650963486052";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";

function OpenWindow(url, title, win_width, win_height) {
	var x,y;
	
	if(win_width==0) {
		win_width = 800;
	}
	if(win_height==0) {
		win_height = 600;
	}
	x = (screen.width / 2) - (win_width / 2);
	y = (screen.height / 2) - (win_height / 2);

	window.open(url,title,'resizable,width='+win_width+',height='+win_height+',top='+y+',left='+x+',toolbar=no,status=no');
}
function OpenWindowWithScrollbar(url, title, win_width, win_height) {
	var x,y;
	
	if(win_width==0) {
		win_width = 800;
	}
	if(win_height==0) {
		win_height = 600;
	}
	x = (screen.width / 2) - (win_width / 2);
	y = (screen.height / 2) - (win_height / 2);

	myWindow = window.open(url,title,"resizable,width="+win_width+",height="+win_height+",top="+y+",left="+x+",toolbars=no,scrollbars=yes,status=no");
}

function antispam_decode(text) {
	var dtxt=''; var txtc=0; var txtl=text.length;
	for(var i=0; i<txtl; i+=2) {
		txtc=parseInt(text.substr(i,2),16);
		dtxt+=String.fromCharCode(txtc);
	}
	return dtxt;
}
function RescaleThumbnails() {
	var a = document.getElementsByName('thumbnail');
	var img_w = '120';
	var img_h = '80';
	if(window.document.body.offsetWidth > 900) { img_w = '180'; img_h = '120'; }
	if(window.document.body.offsetWidth > 1200) { img_w = '240'; img_h = '160'; }
	for(var i=0; i<a.length; i++) {
		if(a[i].nodeName == 'IMG') {
			var factor = a[i].height/a[i].width;
			var width = img_h / factor;
			var url = a[i].src;
			var newurl = url.replace(/height=([0-9]+)/g, 'height='+img_h);
			a[i].src = newurl;
			a[i].height = img_h;
			a[i].width = width;
		}
		a[i].style.width = width+'px';
		a[i].style.height = img_h+'px';
	}
}
window.onresize = RescaleThumbnails;
window.onload = RescaleThumbnails;
