function spmail(name, domain, suffix, text) {
	var address = name + "\u0040" + domain + "." + suffix;
	var url = "mai" + "lto:" + address;
	if (!text) text = address;
	document.write('<a href="' + url + '">' + text + '</a>');
}

function printwin(url) {
	window.open(url,'printwin','width=700,height=500,scrollbars=yes');
}

// enlargement for accomodations
function popupImageJS(strImg) {
	var pic = new Image();
	pic.src = strImg;
	pic.onload = function () {
		if (pic.width > 0) {
			popupopen(strImg,pic.width,pic.height);
		} else {
			popupopen(strImg,500,500);
		}
	};
/*
	if (pic.complete) {
		alert(strImg);
		if (pic.width > 0) {
			popupopen(strImg,pic.width,pic.height);
		} else {
			popupopen(strImg,500,500);
		}
	}else{
		popupopen(strImg,500,500);
	}
*/
}

function popupopen () {
	var args = popupopen.arguments;
	var name   = typeof(args[0]) == "undefined" ? "images/spacer.gif" : args[0];
	var width  = typeof(args[1]) == "undefined" ? 100 : args[1];
	var height = typeof(args[2]) == "undefined" ? 100 : args[2];
	var title  = typeof(args[3]) == "undefined" || args[3] == ''  ? "Details" : args[3];
	var wname  = typeof(args[4]) == "undefined" || args[4] == '' ? "win" : args[4];
	var leftpos= typeof(args[5]) == "undefined" ? false : args[5];
	var toppos = typeof(args[6]) == "undefined" ? false : args[6];
	var closes = typeof(args[7]) == "undefined" ? true : false;
	var printable = typeof(args[8]) == "undefined" ? false : true;
	
	if (!leftpos || !toppos) {
		var leftpos = (screen.height - height)/2;
		var toppos  = (screen.width - width)/2;
	}
	
	if (!printable) {
		win = window.open("","" + wname + "","width=" + width + ",height=" + height + ",left=" + toppos + ",top=" + leftpos);
	}else{
		win = window.open("","" + wname + "","width=" + width + ",height=" + (height + 24) + ",left=" + toppos + ",top=" + leftpos);
	}
	win.document.open();
	win.document.write('<html><head><title>' + title + '</title><link rel="stylesheet" type="text/css" href="css/styles.css" /><meta http-equiv="imagetoolbar" content="no" /></head>');
	if (closes) {
		win.document.write('<body style="margin:0;" onblur="self.close();">'); 
	}else{
		win.document.write('<body style="margin:0;">'); 
	}
	win.document.write('<div align="center">');

	if (name.substr(name.length - 3, 3) == "swf") {
		win.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + width + '" height="' + height + '">');
		win.document.write('<param name="movie" value="' + name + '">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="menu" value="false">');
		win.document.write('<embed src="' + name + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		win.document.write('</object>');
	}else{
		var alt = (title != "Details") ? title : "";
		//win.document.write('<img src="' + name + '" width="' + width + '" height="' + height + '" alt="' + alt + '">'); 
		win.document.write('<img src="' + name + '" alt="' + alt + '">'); 
	}
	
	win.document.write('</div>');
	if (printable) win.document.write('<div style="text-align:right;padding:5px;"><a class="printlink" href="javascript:self.print();">Seite drucken / print page</a></div>');
	win.document.write('</body></html>');
	win.document.close();
	win.focus();
}

function popuppage() {
	var args	= popuppage.arguments;
	var url		= typeof(args[0]) == "undefined" ? "index.htm" : args[0];
	var width	= typeof(args[1]) == "undefined" ? 100 : args[1];
	var height	= typeof(args[2]) == "undefined" ? 100 : args[2];
	var	features= typeof(args[3]) == "undefined" || args[3] == '' ? 'scrollbars=yes' : args[3];
	var name	= typeof(args[4]) == "undefined" ? '' : args[4];
	if (features != '') features = "," + features;
	window.open(url,name,'width=' + width + ', height=' + height + features);
}

function openevents(strLang) {
	window.open('http://feratel.concentrator.net/tosc.asp?OC=SC-SLTG&RG=DN&ID=81001109&FN=SRCH&FC=EV&LG=' + strLang + '','','menubar=yes,scrollbars=yes,width=760,height=400');
}