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 showCamPreviewContent(contentid, lang) {

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

}
function showAmateurContent(contentid, lang) {

	var popup = window.open('/' + lang + '/amateur_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 showSetCardUpd(contentid, amateurid) {

	var popup = window.open('/content/amateur_files/update_setcard.php?content_id=' + contentid + '&amateur_id=' + amateurid, 'SetCard', 'width=600,height=600');
	popup.focus();

}

function openSetCardUpd(contentid) {

	var popup = window.open('/content/amateur_control/update_setcard.php?content_id=' + contentid, 'SetCard', 'width=500,height=450');
	popup.focus();

}

function showAmateurProfilTodo(amateurid, action, email1, email2) {

	var popup = window.open('/medien_files/amateure/content_check/todo_profil.php?amateur_id=' + amateurid + '&action=' + action + '&email1=' + email1 + '&email2=' + email2, 'Todo', 'width=50,height=50');
	popup.focus();

}

function showAmateurContentTodo(contentid, action) {

	var popup = window.open('/medien_files/amateure/content_check/todo_content.php?content_id=' + contentid + '&action=' + action, 'Todo', 'width=50,height=50');
	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 showPmsModul(uri) 
{ 
    var Name = "PMS"; 
    var Fensteroptionen = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0"; 
    var Breite = 400; 
    var Hoehe = 250; 
    window.open(uri, 'Name', Fensteroptionen + ',width=' + Breite + ',height=' + Hoehe); 
} 

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);
	
}

//Mouseover-Effekt für ProfilBild
function changeProfilPic(elem,pic) { 
  document.images[elem].src = pic; 
}

//Regi-Check (Prüfung der eingebenen Daten bei der Anmeldung)
var lastdata = '';
//var datamsg_CHECK = '<font color="#002166">Eingabe wird geprueft, bitte warten.</font>';
function liveRegiCheck( field, outdivname ){
	var data = field.value;
	if( lastdata != data ){
		lastdata = data;
		var outDIV = $(outdivname);
			//outDIV.innerHTML = datamsg_CHECK;
		var url = 'di='+outdivname+'&data='+data+'&typ='+(field.id);
		var ajax = new Ajax.Updater(outdivname,'/ext_modules/regi_check.php', { method: 'get', evalScripts: true, parameters: url } );
	}
}