// init funktion für allem möglichen schmarrn
function init()
{
	setGalleryTableHeight();
}

/* SETTINGS für wallpaper */
var adlWallPaperLeft = 995;
/* ENDE SETTINGS für wallpaper */

function machsuche () {

    document.newssuche.suchtext.value = "";
   // document.newssuche.mzsuchs.style.display="inline";
}


// Open new Window
function Neufenster(URL, name, newWidth, newHeight) {
        win=open(URL,name,'status=no,resizable=no,menubar=no,toolbar=no,resize=no,scrollbars=no,height=' + newHeight + ',width=' + newWidth);
        win.focus();
}


function openWindow(URL, name, newWidth, newHeight) {
        win=open(URL,name,'status=no,resizable=yes,menubar=no,toolbar=no,resize=yes,scrollbars=yes,height=' + newHeight + ',width=' + newWidth);
        win.self.focus();
}

function newscrollwin(url,wname,wheight,wwidth)
{
var windowtop = ((screen.height - wheight) /2) -20;
var windowleft = (screen.width - wwidth) /2;
var browserName=navigator.appName;
var browserVer=parseInt(navigator.appVersion);
if(browserName=="Netscape")
{
   if(browserVer>4)
   {
   wwidth=wwidth+15;
   wheight=wheight+5;
   }
}
wname=window.open(url+'\046dummy='+Math.random(),wname,"toolbar=0,width=" + wwidth  + ",height=" + wheight + ",location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,left=" + windowleft + ",top=" + windowtop);
wname.focus();

}



function ChangeAnsichtBild(DerBildName) {
        document.images.AnsichtBild.src = DerBildName;
}

function bildtext(bildnr) {
if (document.all) document.all.bildtext.innerText = mzbildtext[bildnr]
else if (document.getElementById) document.getElementById("bildtext").firstChild.nodeValue = mzbildtext[bildnr]
else alert("Ihr Browser ist f&uuml;r solche tollen Seiten wie kult.de leider viel zu alt!");
}

 function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
} 

/* MS / Funktionen zum auslesen und setzn der Bildgröße bei Galerien */
function setGalleryTableHeight()
{ 	
	if(document.getElementById("InvisibleImage"))
	{
		var maxheight = document.getElementById("InvisibleImage").height;
		document.getElementById("DetailImageTable").height = maxheight;	
		document.getElementById("LoadingImage").style.display = 'none';
		document.getElementById("GalleryDetailImage").style.display = 'block';	
	}
}

/* MD / Diverse Gruppen-Funktionen */
function MM_KLT_ClubRating(pk,id) { MM_window('/_misc/community/rating/clubs.cfm?pk=' + pk + '&id=' + id ,'Bewertung','width=550,height=150,resizable=no,scrollbars=no'); }

function MM_ClubNotify(pk) { MM_window('/_misc/community/clubs/notify.cfm?pk=' + pk,'Meldung','width=630,height=300,resizable=no,scrollbars=no'); }

function MM_ClubImage(pk) { MM_window('/_misc/community/clubs/imagepopup.cfm?pk=' + pk,'Image','width=520,height=710,resizable=no,scrollbars=no'); }

function MM_ClubsMyClubs(pk) { MM_window('/_misc/community/clubs/clubs_get_myClubs.cfm?pk=' + pk,'ClubList','width=540,height=500,resizable=yes,scrollbars=yes'); }

function MM_ClubBlogpreview()
{
	if(document.ClubCommentsForm.comment.value != '')
	{
		var tmpWindow = MM_window('/_misc/community/blogs/blogpreview.cfm','blogpreview','width=470,height=470,resizable=yes,scrollbars=yes');
		document.BlogPreviewForm.PreviewContent.value = document.ClubCommentsForm.comment.value;
		document.BlogPreviewForm.submit();
		tmpWindow.focus();
	}
}

function MM_window(theURL,wname,features) { return window.open(theURL,wname,features);	}

function MM_preloadStyles() { var d=document; if(d.Styles){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadStyles.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Style; d.MM_p[j++].src=a[i];}}}


function VideoPopup(pid,pk) {
	  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
	  var popwin = window.open('/_misc/videoplayer/videoplayer_big.cfm?pid=' + pid + '&pk=' + pk,'Videoplayer','toolbar=no,width=520,height=610,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

function VideoPopupBig(pid,pk) {
	  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
	  var popwin = window.open('/_misc/videoplayer/videoplayer_big.cfm?pid=' + pid + '&pk=' + pk,'Videoplayer','toolbar=no,width=560,height=610,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

function VideoPopupMedium(pid,pk) {
	  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
	  var popwin = window.open('/_misc/videoplayer/videoplayer_365x325.cfm?pid=' + pid + '&pk=' + pk,'Videoplayer','toolbar=no,width=400,height=500,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}


/*mr / 31.01.2008 / GalleryPopup */
/*========================================== */
function GalleryPopup(pid,pk,fk,bTopImages) {
	  var LeftPosition = (screen.width) ? (screen.width-690)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-800)/2 : 0;
	  var popwin = window.open('/_misc/galleries/popup_gallerypic.cfm?pid=' + pid + '&pk=' + pk + '&fk=' + fk + '&top=' + bTopImages,'Galerie','toolbar=no,width=690,height=800,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=yes,resizable=yes,menubar=no');	  	
	  
      popwin.focus();
}
/* wenn client mit uebergeben wird */
function GalleryPopup(pid,pk,fk,bTopImages,client) {
	  var LeftPosition = (screen.width) ? (screen.width-707)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-800)/2 : 0;
	  if (client == null || client == 0){
	  	client = "";
	  }
	  popwin = window.open(client + '/_misc/galleries/popup_gallerypic.cfm?pid=' + pid + '&pk=' + pk + '&fk=' + fk + '&top=' + bTopImages,'Galerie','toolbar=no,width=707,height=800,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=yes,resizable=no,menubar=no,copyhistory=no,location=no');	  	
	  
      popwin.focus();
}

function openerWindow(adresse){
	opener.location.href = adresse;
	window.opener.focus();
	
	return true;
}

/*========================================== */

/* mr / popupfunktion fuer adbuttons */
function openmzad(URL, name, newWidth, newHeight) {
    win=open(URL,name,'status=no,resizable=yes,menubar=no,toolbar=no,resize=yes,scrollbars=yes,height=' + newHeight + ',width=' + newWidth);
    win.self.focus();
}



 
function searchLoc() {
	
 var text = document.getElementById("loctext").value;
 
 if(text.length > 2){
 	
 var rnd = Math.round(Math.random()*100000);
 // make request
 	if (window.XMLHttpRequest) {
 		myXmlreq = new XMLHttpRequest();
 	}
 	else if (window.ActiveXObject) {
 		try { myXmlreq = new ActiveXObject("Msxml2.XMLHTTP"); }
 		catch (e1) {
 		try { myXmlreq = new ActiveXObject("Microsoft.XMLHTTP"); }
 		catch (e2) {}
 		}
 	}
	
 	if ( myXmlreq ) {
 		myXmlreq.open('GET', 'http://'+window.location.hostname+'/_misc/events/locationsearch.cfm?text='+text+'&cacheconfuse='+rnd, false);
		//myXmlreq.open('GET', 'http://www.kult.de/_misc/events/locationsearch.cfm?text='+text+'&cacheconfuse='+rnd, false);
 		myXmlreq.send(null);
 		if ( myXmlreq.status == 200 ) {
					
			var txt = "<table>";
						
			if(myXmlreq.responseXML.documentElement.childNodes.length > 0){						
										
				var tmp = myXmlreq.responseXML.documentElement.childNodes.length;
				tmp = tmp / 2;				
																		
	 			for(i=0;i<tmp;i++){
		 			var pklocations= myXmlreq.responseXML.getElementsByTagName("pklocations")[i].childNodes[0].nodeValue;
		 			var title = myXmlreq.responseXML.getElementsByTagName("title")[i].childNodes[0].nodeValue;
					txt = txt + '<tr><td><input type="radio" name="locids" value="' + pklocations +'" onclick="setID('+ pklocations +')">'+ title +'</td></tr>';								
				}
			
			}else{
				
				txt = txt + '<tr><td colspan="2">Keine Ergebnisse gefunden!</td></tr>';
				
			}			
			
			txt = txt + "</table>";
			
 		document.getElementById("locresults").innerHTML = txt;
 		}
		
		
 }
 
 }else{
 	document.getElementById("locresults").innerHTML = "";
 }
}

// Funktion für die Tooltipps der Icons z.B. in den Visitgenkarten
function icontooltip(Text, TTWidth)
{
	return overlib(Text, BGCOLOR, '#7E171A', FGCOLOR, '#EBEBEC', TEXTCOLOR, '#7E171A');
}

