var ie = IE = (document.all)?true:false;
function sel(elem) {
	if(document.formedit && eval("document.formedit."+elem)) eval("document.formedit."+elem+".checked=true");
}
function video(video,w,h,pre,format) {
	var w=(w)?parseInt(w):320;
	var h=(h)?parseInt(h):240;
	var winV = window.open(pre+"video.php?video="+video+"&format="+format+"&w="+w+"&h="+h+"","winV","width="+(w+20)+",height="+(h+40)+",scrollbars=0,resizable=1,dependent=0,screenX="+parseInt(screen.width-w-20)+",screenY=10,position=absolute,left="+parseInt(screen.width-w-20)+",top=10");
	winV.focus();
}

function bild(pic,weite,hoehe) {
	var weite = parseInt(weite)
	var hoehe = parseInt(hoehe)
	var w = parseInt(weite)+30;
	var h = parseInt(hoehe)+70;
//	var win = window.open(pre+"bild.php?pic="+pic+"&w="+weite+"","win","width="+(w)+",height="+(h)+",scrollbars=no,resizable=1,dependent=1,screenX="+parseInt(screen.width/2)+",screenY="+parseInt(screen.height/12)+",position=absolute left="+parseInt(screen.width/2)+" top="+parseInt(screen.height/12)+" z-index=1");
	var winPic = window.open("","winPic","width="+w+",height="+h+",scrollbars=no,resizable=1,dependent=1,screenX="+parseInt(screen.width/2)+",screenY="+parseInt(screen.height/12)+",position=absolute left="+parseInt(screen.width/2)+" top="+parseInt(screen.height/12)+" z-index=1");
	with(winPic.document) {
		open("text/html")
		write("<html><head></head>")
		write("<body bgcolor=#f7eff7>")
		write("<center><img src='"+pic+"' width="+(weite)+", height="+(hoehe)+" border=0>")
		write("<br /><p />")
		write("<form><input type=button value=' close ' onClick='javascript:self.close()'></form></center>")
		write("</body></html>")
		close()
	}
	winPic.focus()
}
/*
function bildGalerie(pic,weite,hoehe) {
	var w = weite+30;
	var h = hoehe+70;
	var win = window.open("","win","width="+w+",height="+h+",scrollbars=no,resizable=1,dependent=1,screenX="+screen.width/2+",screenY="+screen.height/12+",position=absolute left="+screen.width/2+" top="+screen.height/12+" z-index=1");
	with(win.document) {
		open("text/html");
		writeln("<html><body bgcolor=#990000>");
		writeln("<center><img src='"+pic+"' width="+weite+", height="+hoehe+" border=0>");
		writeln("<br><p>");
		writeln("<form><input type=button value=' close ' onClick='javascript:self.close()'></form></center>");
		writeln("</body></html>");
		close();
		}
	win.focus();
}
*/
function play(s,id_data,pre,mode) {
	if(navigator.appName=="Netscape") {
		var win=window.open(pre+"rm.php?song="+s+"&id_data="+id_data,"win","width=275,height=130,resizable=yes,position:absolute left="+parseInt(screen.innerWidth-300)+" top=10,screenX="+parseInt(screen.width-320)+",screenY=10");
	}
	else {
		var win=window.open(pre+"rm.php?song="+s+"&id_data="+id_data,"win","width=275,height=130,resizable=yes,position:absolute left="+parseInt(screen.width-320)+" top=10");
	}
	win.focus();
}

function closeWin() {
	window.setTimeout("self.close()",5000);
	alert("Sorry, aber die GEMA erlaubt nur 45 Sekunden ...");
	self.close();
}

function zeigMail(str) {
	alert(str);
}

function getBandMsg(text) {
	var w = 400;
	var h = 220;
	var winMsg = window.open("","winMsg","width="+w+",height="+h+",scrollbars=yes,resizable=1,dependent=1,screenX="+screen.width/2+",screenY="+screen.height/12+",position=absolute left="+screen.width/2+" top="+screen.height/12+",status:0");
	with(winMsg.document) {
		open("text/html");
		writeln("<html><head><style type='text/css'>body{font-family:arial,verdana;font-size:12px;}a{text-decoration:none;color:#ff0;}a:hover{text-decoration:underline;}</style></head><body bgcolor=#990000 text=#ffffff>");
		writeln("<center>nur Demos an Postadresse (keine mp3-files):<P>Ackerstrasse 169<br>10115 Berlin<p>Brozeit Di 20.00-22.00 Uhr<br>Tel: 030-24628619<br>Konzerte nur Freitag und Sonnabend  m glich<br>von 21.00-24.00 Uhr<br>keine Festgagen<br>PDF zur GEMA kommt noch<p>");
		writeln("<a href='#' onClick='javascript:self.close();status:\"\";return true;' onMouseOver:'status:\"\";return true;'><b>schliessen</b></a></center>");
		writeln("</body></html>");
		close();
	}
	winMsg.focus();
}
function getFlashWin() {
	var w = 800;
	var h = 600;
	var winFlash = window.open("flash/show.htm","winFlash","width="+w+",height="+h+",scrollbars=0,resizable=1,dependent=1,screenX="+parseInt(screen.width-w-20)+",screenY=10,position=absolute,left="+parseInt(screen.width-w-20)+",top=10");
	winFlash.focus();
}
function flashLayer(swf,left,top,w,h,fVars,div) {
	var wFlashTableH = wFlash = wFlashTable = parseInt(w);
	var hFlashTable = (IE) ? parseInt(h)+30 : parseInt(h);
	var hFlashTableH = 22
	var hFlash = (hFlashTable-hFlashTableH)
	var closeText = "close me"
	var wK = 16
	var hK = 16
	var closeKreuzHTML = "<img src='pics/misc/kreuz.gif' alt='schliessen' name='schliessen' id='schliessen' title='schliessen' width=16 height=16 hspace=0 vspace=0 border=0>";
	var out = '<table bgcolor=#880000 width='+w+' height='+parseInt(h+hFlashTableH)+' cellpadding=0 cellspacing=0 border=0>'
		if(openlayer==1) {
			out += '<tr /><td height='+hFlashTableH+' align=left valign=middle style="border:1px solid #700;cursor:move;color:#eee;font-weight:bold;" />&nbsp;&nbsp;&nbsp;move me'
			out += '<tr height='+h+' /><td height='+h+' width='+w+' bgcolor=#990000 valign=top bgcolor=#990000 />'
			out += '<object data="'+swf+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width='+w+' height='+h+'>'
			out += '<param name="movie" value="'+swf+'">'
			out += '<param name="flashVars" value="'+fVars+'">'
			out += '<param name="quality" value="high">'
			out += '<embed src="'+swf+'" flashVars="'+fVars+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width='+w+' height='+h+'></embed>'
			out += '</object>'
		}
		else {
			out += '<tr /><td height='+hFlashTableH+' align=left valign=middle style="border:1px solid #700;cursor:move;color:#500;font-weight:bold;" />&nbsp;&nbsp;&nbsp;click me'
			hFlashTable = 22;
		}
		out += '</table>'
	var flLayer		= DynAPI.document.addChild(new DynLayer(div,left,top,wFlashTable,hFlashTable,"#990000",null,null,null,out));
	var flClose		= flLayer.addChild(new DynLayer('closeX',(wFlash-wK-3),3,wK,hK,null,null,null,null,closeKreuzHTML));
	var flCloseTxt	= flLayer.addChild(new DynLayer('closeTxt',(wFlash-90),4,60,16,null,null,null,null,closeText));
	flLayer.setZIndex(1000);
	flLayer.setOverflow(true)
	flClose.setOverflow(true)
	flClose.setZIndex(0);
	DragEvent.enableDragEvents(flLayer)
	var eflClose=new EventListener(flClose)
	flClose.addEventListener(eflClose)
	eflClose.onclick=function(e){
		flLayer.setVisible(false);
	}
	eflClose.onmouseover=function(e){
		flCloseTxt.setVisible(true);
	}
	eflClose.onmouseout=function(e){
		flCloseTxt.setVisible(false);
	}
}
function video(video,w,h,pre,format) {
	var w=(w)?w:320;
	var h=(h)?h:240;
	var winV = window.open(pre+"video.php?video="+video+"&format="+format+"&w="+w+"&h="+h+"","winV","width="+(w+20)+",height="+(h+40)+",scrollbars=0,resizable=1,dependent=0,screenX="+parseInt(screen.width-w-20)+",screenY=10,position=absolute,left="+parseInt(screen.width-w-20)+",top=10");
	winV.focus();
	var r = counter(video,"stat_video");
	//getWin(r);
}
function clearElem() {
	if(document.frmFan.fanmail && document.frmFan.fanmail.value=="Deine Mail-Adresse") {
		document.frmFan.fanmail.value="@";
	}
}
function getMap() {
	var winMap = window.open("map.php","winMap","width=600,height=600,scrollbars=0,menubar=1,toolbar=0,statusbar=0")
	winMap.focus()
}
function myradio() {
	var w=220;
	var h=345;
	var winR = window.open("radio/index.php","BlogRadio","width="+(w)+",height="+(h)+",scrollbars=0,resizable=0,dependent=0,screenX="+parseInt(screen.width-w-20)+",screenY=10,position=absolute,left="+parseInt(screen.width-w-20)+",top=10");
	winR.focus();
}
function nextBands() {
	var w=220;
	var h=345;
	var winR = window.open("next/index.php","next Bands","width="+(w)+",height="+(h)+",scrollbars=0,resizable=0,dependent=0,screenX=200,screenY=10,position=absolute,left=200,top=10");
	winR.focus();
}
function setText(elem,val) {
	if(ie && eval("document.all['"+elem+"']")) eval("document.all['"+elem+"'].outerHTML = '"+val+"'");
	else if(eval("document.getElementById('"+elem+"')")) eval("document.getElementById('"+elem+"').innerHTML = '"+val+"'");
}
function getText(elem) {
	if(ie && eval("document.all['"+elem+"']")) return eval("document.all['"+elem+"'].outerHTML=''");
	else if(eval("document.getElementById('"+elem+"')"))  return eval("document.getElementById('"+elem+"').innerHTML");
}
function setStyle(elem,attr,val) {
	if (ie && eval("document.all['"+elem+"']")) eval("document.all['"+elem+"'].style."+attr+" = '"+val+"'");
	else if(eval('document.getElementById("'+elem+'")')) eval('document.getElementById("'+elem+'").style.'+attr+' = "'+val+'"');
}
function getStyle(elem,attr) {
	if (ie && eval("document.all['"+elem+"']")) return eval("document.all['"+elem+"'].style.getAttribute('"+attr+"','false')");
	else if(eval('document.getElementById("'+elem+'")')) return eval('document.getElementById("'+elem+'").style.'+attr);
}
function toggleLayer(elem,txt) {
	(getText(elem)=="")?setText(elem,txt):setText(elem,"");
}
function rsshelp() {
	var w=320;
	var h=320;
	var winH = window.open("rss_help.html","winH","width="+(w+20)+",height="+(h+40)+",scrollbars=0,resizable=1,dependent=0,screenX="+parseInt(screen.width-w-20)+",screenY=10,position=absolute,left="+parseInt(screen.width-w-20)+",top=10");
	winH.focus();
}
function getStat(name) {
	var w = 400;
	var h = 220;
	var winMsg = window.open("../inc/stat.php?name="+name,"winMsg","width="+w+",height="+h+",scrollbars=yes,resizable=1,dependent=1,screenX="+screen.width/2+",screenY="+screen.height/12+",position=absolute left="+screen.width/2+" top="+screen.height/12+",status:0");
	winMsg.focus();
}
function getWin(txt) {
	var w = 400;
	var h = 220;
	var winMsg = window.open("","winMsg","width="+w+",height="+h+",scrollbars=yes,resizable=1,dependent=1,screenX="+screen.width/2+",screenY="+screen.height/12+",position=absolute left="+screen.width/2+" top="+screen.height/12+",status:0");
	with(winMsg.document) {
		open("text/html");
		writeln("<html><head><style type='text/css'>body{font-family:arial,verdana;font-size:12px;}a{text-decoration:none;color:#ff0;}a:hover{text-decoration:underline;}</style></head><body bgcolor=#ffffff text=#444444>");
		writeln(txt);
		writeln("<hr><center><a href='#' onClick='javascript:self.close();status:\"\";return true;' onMouseOver:'status:\"\";return true;'>schliessen</a></center>");
		writeln("</body></html>");
		close();
	}
	winMsg.focus();
}
function js() {
	var breite = screen.width;
	var hoehe = screen.height;
	var name = navigator.appName;
	var version = parseInt(navigator.appVersion);
 	var namestr = name.replace(/ /g,"%20");
 	var client = breite+"x"+hoehe+"~"+namestr+"~"+version;
	return client;
}
function counter(file,tab) {
	var client = js();
	new Ajax.Request('inc/counter.php',{
		onSuccess:function(r) {return r.responseText},
		onFailure:function(r) {return r.responseText},
		parameters:"client="+client+"&sess="+file+"&start=1&table="+tab
	});
}

sfHover = function() {
	var tag = "LI";
	var sfEls = document.getElementsByTagName(tag);
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
function init() {
	return;
/*
	if(!document.frm) return;
	if($("titel")) {
		Event.observe("titel","keydown",function(e){updateMyList(e)},false);
	}
*/
}
function updateMyList(e) {
	var l,o,txt,li=null;
	var el = Event.element(e);
	if(el.nodeName!='INPUT') return;
	var field = el.name;
	Event.stop(e);
	if($$("ul#vorschlag li")) {
		$A($$("ul#vorschlag li")).each(function(l) {
			$("ul#vorschlag").removeChild(l);
		});
		if($("ul#vorschlag")) $("ul#vorschlag").style.display="none";
	}
	new Ajax.Request("aj.php",{
		method:"post",
		parameters:"field="+field+"&data="+eval('document.frm.'+field+'.value'),
		onSuccess: function(r) {
			//alert(eval('document.frm.'+field+'.value'));
			eval(r.responseText);
			var htm = "";
			for(o in Data) {
				li=document.createElement("li");
				txt=document.createTextNode(o.d);
				htm=o.d+"\n";
				li.appendChild(txt);
				$("ul#vorschlag").apppendChild(li);
			}
//			alert(htm)
			$("ul#vorschlag").style.display="block";
			$("ul#vorschlag").style.left="100px";
			$("ul#vorschlag").style.top="100px";
		},
		onFailure:function(r) {alert(r.responseText)}
	});
}
if (window.attachEvent) window.attachEvent("onload",sfHover);

