
function jsRot13(sCode) {
	var key ="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	txtRot = new String()
	for(var i = 0; i < sCode.length; i++) {
		var codechar	= sCode.substring(i, i + 1)
		var pos = key.indexOf(codechar.toUpperCase())
		if(pos >= 0) {
			pos = (pos + key.length / 2) % key.length
			codechar = (codechar == codechar.toUpperCase()) ? key.substring(pos, pos + 1) : key.substring(pos, pos + 1).toLowerCase()
		}
		txtRot = txtRot + codechar
	}
	return txtRot;
}

function jsHex(sCode) {
	txtHex = new String();
	for(var i = 0; i < sCode.length; i++) {
		txtHex = txtHex + sCode.charCodeAt(i).toString(16).toUpperCase();
	}
	return txtHex;
}

function jsURL(sLink) {
	var retVal = "";
	retVal = jsHex(jsRot13(sLink));
	document.write(retVal);
}

function jslink(sLink, sText) {
	var retVal = "";
	retVal = '<A href="./open.php?slink=' + jsHex(jsRot13(sLink)) + '" target="_blank">' + sText + '</a>';
	document.write(retVal);
}

function jsmail(sLink, sText) {
	var retVal = "";
	retVal = '<A href="./open.php?smail=' + jsHex(jsRot13(sLink)) + '">' + sText + '</a>';
	document.write(retVal);
}


function jsOpenImg(imgFile) {
	var picture = new Image();
	var imgSize = new String();
	var imgWidth = 0;
	var imgHeight = 0;
	
	imgFile = './images/' + imgFile;
	picture.src = imgFile; 
	//alert(picture.width);
	//alert(picture.height);
	//warten(10);
	imgWidth = picture.width + 20;
	imgHeight = picture.height + 20;
	if (imgHeight == 20) {
		imgHeight = 220;
	}
	if (imgWidth == 20) {
		imgWidth = 320;
	}
	imgSize = 'width=' + imgWidth + ',height=' + imgHeight;
	imgTitle = 'Zoom ' + imgWidth + 'x' + imgHeight;
	//alert(imgSize);
	//alert(imgTitle);
	window.open(imgFile,imgTitle,imgSize);
	//window.open('images/BP06_image1.jpg','BP 2006','width=600,height=200')
	
}


function jsOpenImage(imgFile,imgWidth,imgHeight) {
	/*var picture = new Image();
	var imgSize = new String();
	var imgWidth = 0;
	var imgHeight = 0;
	*/
	
	imgFile = './images/' + imgFile;
	/*picture.src = imgFile; 
	//alert(picture.width);
	//alert(picture.height);
	//warten(10);
	imgWidth = picture.width + 20;
	imgHeight = picture.height + 20;
	if (imgHeight == 20) {
		imgHeight = 220;
	}
	if (imgWidth == 20) {
		imgWidth = 320;
	}*/
	imgWidth += 20;
	imgHeight += 20;
	imgSize = 'width=' + imgWidth + ',height=' + imgHeight;
	imgTitle = 'Zoom';
	//alert(imgSize);
	//alert(imgTitle);
	
	oImgWindow = window.open(imgFile, imgTitle, imgSize);
	oImgWindow.focus();
	
}



