function go(url) {

	document.location.href = url;

}

function showContent(contentid, lang) {

	var popup = window.open('/' + lang + '/content/?contentid=' + contentid, 'content', 'width=1024,height=768');
	popup.focus();

}

function showVodContent(contentid, lang) {

	var popup = window.open('/' + lang + '/vod_content/?contentid=' + contentid, 'content', 'width=1024,height=768');
	popup.focus();

}

function showCamContent(contentid, lang) {

	var popup = window.open('/' + lang + '/cam_content/?contentid=' + contentid, 'content', 'width=1024,height=768');
	popup.focus();

}

function showCoinkauf(lang, kundenid) {

	var popup = window.open('http://paygate.local/' + lang + '/coinkauf?kundenid=' + contentid, 'content', 'width=800,height=600');
	popup.focus();

}

function showImpressum(lang) {

	var popup = window.open('/' + lang + '/impressum/', 'impressum', 'width=520,height=600');
	popup.focus();

}

function showPwReminder(lang) {

	var popup = window.open('/' + lang + '/pwreminder/', 'impressum', 'width=520,height=350');
	popup.focus();

}

function OpenFoto(img){
foto= new Image();
foto.src=(img);
ControlFoto(img);
}

function ControlFoto(img){
if((foto.width!=0)&&(foto.height!=0)){
ViewFoto(img);
}
else{
interval_a="ControlFoto('"+img+"')";
interval_b=setTimeout(interval_a,20);
}
}
function ViewFoto(img){
width=foto.width+20;
height=foto.height+24;

try {
if (output.closed == false) throw "offen";
}
catch (e) {
if (e=="offen") {
output.close();
}
}
output=window.open("","output","left=40,top=40,width="+width+",height="+height+",location=no,toolbar=no,menubar=no,status=no,scrol lbars=no,resizable=no");
output.document.writeln("<html><head><title>..:: Foto ::..<\/title><\/head>");
output.document.writeln("<body bgcolor=\"white\" text=\"white\" link=\"white\" vlink=\"white\" alink=\"white\" leftmargin=\"0\" marginwidth=\"0\" topmargin=\"0\" marginheight=\"0\">");
output.document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">");
output.document.writeln("<tr><td width=\"100%\" height=\"100%\" align=\"left\" valign=\"top\"><p><a href=\"javascript:self.close()\"><img src=\""+img+"\" width=\""+foto.width+"\" height=\""+foto.height+"\" border=\"10\" alt=\"Klick hier um das Fenster zu schliessen\"></a><\/p><\/td><\/tr>");
output.document.writeln("<\/table><\/body><\/html>");
output.focus();
}

var stopslide = '';
function changepic(id, src, ahref){
	if (document.getElementById(id) != null)
		document.getElementById(id).src = src;
	if (document.getElementById('link'+id) != null)
		document.getElementById('link'+id).href = ahref.href;
	if (stopslide.indexOf(id) == -1)
		stopslide += id + ';';
}

function slideshow(id, images, index){
	imgarray = images.split(';');
	if (index >= imgarray.length)
		index = 0;

	if (index != 0)
		document.getElementById(id +''+ index).className = '';
	else
		document.getElementById(id +''+ (imgarray.length)).className = '';

	if (stopslide.indexOf(id) != -1)
		return;

	if (document.getElementById(id) != null){
		document.getElementById(id).src = imgarray[index];
	}

	if (document.getElementById('link'+id) != null && document.getElementById(id +''+ (index + 1)) != null){
		document.getElementById('link'+id).href = document.getElementById(id +''+ (index + 1)).href;
		document.getElementById(id +''+ (index + 1)).className = 'found';
	}
	
	setTimeout('slideshow("'+ id +'", "'+ images +'", '+ (index + 1) +')', 5*1000);
	
}