
function win(pic,title,text) {

	view(pic,title,text)
}

function win_old(pic,title,text) {

	if (title==undefined) title=""
	if (text==undefined) text=""

	pic=escape(pic)
	title=escape(title)
	text=escape(text)


	w=window.open("/main/template.php?pic="+pic+"&title="+title+"&text="+text,"kickerzone","width=50,height=50,scrollbars=yes,resizable=yes")
	w.focus()
	
	/*alert('<img src"'+pic+'">')
	document.images["show_pic"].src=pic
	wh=document.documentElement.innerWidth
	ww=document.documentElement.innerWidth
	
	st=document.documentElement.scrollTop 
	sl=document.documentElement.scrollLeft 
	
	moveIt(document.getElementById("show_div"),st+(ww/2),ws+(wh/2))
	document.getElementById("show_div").style.display=""
	document.getElementById("show_div").stlye.pos
	*/
	
	}


function moveIt(obj, mvTop, mvLeft) {
	obj.style.position = "absolute";
	obj.style.top = mvTop;
	obj.style.left = mvLeft;
}

function video(file,width,height) {
//
//	w=window.open("/main/video.php?file="+file+"&w="+width+"&h="+height,"kickerzone","width="+(width+50)+",height="+(height+80))
//	w.focus()


	video2(file,width,height);
	}

function winpage(page,title,text) {

	if (title==undefined) title=""
	if (text==undefined) text=""

	page=escape(page)
	title=escape(title)
	text=escape(text)


	w=window.open("/main/templatepage.php?page="+page+"&title="+title+"&text="+text,"kickerzone","width=50,height=50,scrollbars=yes,resizable=yes")
	w.focus()
	
	}

function download(file) {
	
	frames["iframe_content"].location.href="/main/filedownload.php?f="+file

//	w=window.open("/main/filedownload.php?f="+file,"kickerzone","width=1,height=1")
//	w.focus()

	
	}

function flipID(id) {
		
	if (document.getElementById(id)) {
		s=document.getElementById(id).style.display
		
		if (s=="none") {
			document.getElementById(id).style.display=""
			
		}else{
			document.getElementById(id).style.display="none"

		}		
	}
}

function setclass (id,classname) {

	document.getElementById(id).setAttribute("class",classname)
	
	}

function getID(id) {
	
	if (document.getElementById(id)) {
		return document.getElementById(id).style.display
	}

}

function auf(id) {		
	displayID(id,"")
}

function zu(id) {
	displayID(id,"none")		
}

function displayID(id,value) {
		
	if (document.getElementById(id)) {
		
		document.getElementById(id).style.display=value
		
	}

}


function c(t,col) {

		t.style.backgroundColor=col
	
	}


function c2(t,col) {

		t.style.backgroundColor=col
	
	}
	
// ausgelagert aus addon.php


function merkeID(id) {

	// merkt sich den display-zustand der Box

	theid=id
	
	if ((!document.getElementById(id)) && (document.getElementById(id)+"_inc")) theid=id+"_inc"
		
		
		//alert(document.getElementById(theid).style.className)
			
		/*if (document.getElementById("tr_"+id).style.className!="rahmen")	 {
			document.getElementById("tr_"+id).style.className="rahmen"
		}else{
			document.getElementById("tr_"+id).style.className=""
		}
			
		*/
		
		top.frames["time.php"].location.href='addondisplaystyle.php?id='+id+"&s="+document.getElementById(theid).style.display	
			
			
}


// ausgelagert aus right.php


function dpy(td_id) {

	td=document.getElementById(td_id)

	if (td) {
		if (td.style.display!="") {
				td.style.display=""
				delDpy(td_id)
			}else{
				addDpy(td_id)
				td.style.display="none"
				
				//alert(td_id)
			}
	
	}

	td=document.getElementById(td_id+"_inc")

	if (td) {
		if (td.style.display!="") {
				td.style.display=""
			}else{
				td.style.display="none"
			}
	
	}

}


function addDpy(name) {

	//auslesen des cookie
	cookie_dpy=readCookie("dpy")
	
	// suche name, ob schon vorhanden
	p=cookie_dpy.indexOf(name)
	
//	writeCookie()

	if (p>-1){
	
		e=cookie_dpy.substr(p).indexOf(":")
		
		if (e>-1){
//			alert(">"+name+"< "+"anfang: "+p+" ende: "+e)
		}else{
			// nur ein cookie gespeichert
			cookie_dpy=name+":"
		}
	}else{
		if (cookie_dpy=="") {
			cookie_dpy=name+":"
		}else{
			cookie_dpy=cookie_dpy+name+":"
		}
	}

	writeCookie("dpy",cookie_dpy,1000)
	
}

function delDpy(name) {


//auslesen des cookie
	cookie_dpy=readCookie("dpy")
	
	// suche name, ob schon vorhanden
	p=cookie_dpy.indexOf(name)
	
//	writeCookie()

	if (p>-1){
	
		len=cookie_dpy.substr(p).indexOf(":")
		
		if (len>-1){
			//alert(" lösche >"+name+"< "+"anfang: "+p+" ende: "+(p+len))
			
			anfang=cookie_dpy.substr(0,p)
			ende=cookie_dpy.substr(p+len+1)
			
			cookie_dpy=anfang+ende
			
		}else{
			// nur ein cookie gespeichert
			cookie_dpy=name+":"
		}
	}else{
		if (cookie_dpy=="") {
			cookie_dpy=name+":"
		}else{
			cookie_dpy=cookie_dpy+name+":"
		}
	}

	writeCookie("dpy",cookie_dpy,1000)

}


function getDpy(name) {

	cookie_dpy=readCookie("dpy")
	
	// suche name, ob schon vorhanden
	p=cookie_dpy.indexOf(name)
	
//	writeCookie()

	if (p>-1){
		dpy(name);
	}
	
}



function view(pfad, title, text) {

	// anzeigen der bilder integriert per DIV auf der Seite
	// nicht aktiviert!


	if (typeof(title)=="undefined") title=""
	if (typeof(text)=="undefined") text=""


  if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;

  } else if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
	

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    
	//IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  
//  alert(myHeight)
 // alert(td_body_leftHeight)
  
	document.getElementById("div_view").style.width =myWidth
	document.getElementById("div_view").style.height =myHeight
	
	auf("div_view")
	
	
//	alert(window.innerWidth+" "+window.innerHeight)
	
	xy=getScrollXY()
	px=xy[0]
	py=xy[1]


	//document.getElementById("div_content").style.width =window.innerWidth-100
	//document.getElementById("div_content").style.height =window.innerHeight-50

		
		top.document.getElementById("div_content").style.width =500
		top.document.getElementById("div_content").style.height =60
		top.document.getElementById("div_content").style.left =(top.window.innerWidth/2)-(250)+px
		top.document.getElementById("div_content").style.top =((top.window.innerHeight-150)/2)-(20)+py
		
		if (top.document.getElementById("div_content").style.top<50) top.document.getElementById("div_content").style.top=50
		
	top.document.getElementById("div_content").innerHTML='<table width=100% border=0 class="font10" cellpadding=4 cellspacing=0><tr><td width=50><img src="http://www.kickerzone.de/pixs/busy.gif" align="right"></td><td nowrap class="grau">'+title+'<br><b class="hellgrau">wird geladen...</b></td><td width=1 nowrap><a href=\'javascript:closewin()\'><img src="/pixs/close.gif"></a></td></tr></table>'
	
	//top.document.getElementById("div_view").style.position="fixed"
	
	auf("div_content")


//	flipID("")

	frames["iframe_content"].location.href="/main/template2.php?pic="+pfad+"&title="+title+"&text="+text
	
	//top.document.getElementById("iframe_content").style.position="fixed"
	
	
	//frames["iframe_content"].width=window.innerWidth
	//frames["iframe_content"].height=window.innerHeight
	
	
	//document.getElementById("div_content").style.left =window.innerWidth/2
	//document.getElementById("div_content").style.top =window.innerHeight/2
	
	

}

function closewin() {
	
	zu("div_view");zu("div_content");window.stop()
	
	top.frames["iframe_content"].location.href="/leer.html"
	
	}

function inline(pfad, title, text) {

	// anzeigen der bilder integriert per DIV auf der Seite
	// nicht aktiviert!
	
	if (typeof(title)=="undefined") title=""
	if (typeof(text)=="undefined") text=""


	doc=top.document
	topframe=top.frames["iframe_content"]
	topwin=top.window

	if (doc.location.href=="http://www.kickerzone.de/main/setedit.php") {
		
			doc=this.document
			topframe=this.frames["iframe_content"]
			topwin=this.window		

		}

	//Hintergrund ausblenden
	doc.getElementById("div_content").style.display=""

  if( doc.documentElement && ( doc.documentElement.clientWidth || doc.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = doc.documentElement.clientWidth;
    myHeight = doc.documentElement.clientHeight;

  } else if( typeof( topwin.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = topwin.innerWidth;
    myHeight = topwin.innerHeight;
	

  } else if( doc.body && ( doc.body.clientWidth || doc.body.clientHeight ) ) {
    
	//IE 4 compatible
    myWidth = doc.body.clientWidth;
    myHeight = doc.body.clientHeight;
  }
  
  
 // alert(myHeight)
 // alert(td_body_leftHeight)
  
	doc.getElementById("div_view").style.width =myWidth
	doc.getElementById("div_view").style.height =myHeight
		
	doc.getElementById("div_view").style.display=""
//	auf("div_view")
	
	
//	alert(window.innerWidth+" "+window.innerHeight)
	
	xy=getScrollXY()
	px=xy[0]
	py=xy[1]


	//document.getElementById("div_content").style.width =window.innerWidth-100
	//document.getElementById("div_content").style.height =window.innerHeight-50

		
		doc.getElementById("div_content").style.width =500
		doc.getElementById("div_content").style.height =60
		doc.getElementById("div_content").style.left =(topwin.innerWidth/2)-(250)+px
		doc.getElementById("div_content").style.top =((topwin.innerHeight-50)/2)-(20)+py
		
		if (doc.getElementById("div_content").style.top<50) doc.getElementById("div_content").style.top=50
		
	doc.getElementById("div_content").innerHTML='<table width=100% border=0 class="font10" cellpadding=4 cellspacing=0><tr><td width=50><img src="http://www.kickerzone.de/pixs/busy.gif" align="right"></td><td nowrap class="grau">'+title+'<br><b class="hellgrau">wird geladen...</b></td><td width=1 nowrap><a href=\'javascript:closewin()\'><img src="/pixs/close.gif"></a></td></tr></table>'
	

	
//auf("div_content")
		
		topframe.location.href=pfad
	
	
		doc.getElementById("div_iframe_content").style.width =((top.window.innerWidth/4)*3)+10
		doc.getElementById("div_iframe_content").style.height =((top.window.innerHeight/4)*3)
		doc.getElementById("div_iframe_content").style.left =parseInt(top.window.innerWidth/8)-10
		doc.getElementById("div_iframe_content").style.top =parseInt(((top.window.innerHeight)/8))+(20)+py
		
		
		doc.getElementById("iframe_content").style.width =((top.window.innerWidth/4)*3)-20
		doc.getElementById("iframe_content").style.height =((top.window.innerHeight/4)*3)-20
		
		
			doc.getElementById("div_content").style.display="none"
				doc.getElementById("iframe_content").style.display=""
				
	//	zu ("div_content")
	//	auf("iframe_content")



		// Titel ausrichten
		
		doc.getElementById("div_title").innerHTML='<table border="0" cellspacing="0" cellpadding="4" width="100%"><tr> <td width="1" nowrap class="font">&nbsp;</td><td width="1" nowrap class="tablecolor">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td class="font" bgcolor="#eeeeee"> <table border="0" cellspacing="0" cellpadding="0" ><tr><td nowrap><b><div style="width:100%;overflow:hidden" class="font10">'+title+'</div></b></td></tr><tr> <td><img src="../redblock.jpg" width="100%" height="2"></td></tr></table></td></tr></table>'
		
		doc.getElementById("div_title").style.width=doc.getElementById("div_iframe_content").style.width
		doc.getElementById("div_title").style.height=34
				
		doc.getElementById("div_title").style.left =parseInt(doc.getElementById("div_iframe_content").style.left)
		doc.getElementById("div_title").style.top = parseInt(doc.getElementById("div_iframe_content").style.top)-40
		
		
		
		// Buttons ausrichten 
		doc.getElementById("div_buttons").innerHTML='<table width=100%><tr><td>&nbsp;</td><td width=100% class="grau font">'+text+'</td><td align="right" width=1><img src="/pixs/close.gif"></td><td align="left" class="font"><a href="javascript:fensterzu()">Schließen</a></td><td align="right" width=100%>&nbsp;</td></tr></table>'
		
		doc.getElementById("div_buttons").style.width=doc.getElementById("div_iframe_content").style.width
		doc.getElementById("div_buttons").style.height=30
		
		doc.getElementById("div_buttons").style.left =parseInt(doc.getElementById("div_iframe_content").style.left)
		doc.getElementById("div_buttons").style.top = parseInt(doc.getElementById("div_iframe_content").style.top)+parseInt(doc.getElementById("div_iframe_content").style.height )+8
	
	
	doc.getElementById("div_title").style.display=""
		doc.getElementById("div_buttons").style.display=""


//	flipID("")



//frames["iframe_content"].width=window.innerWidth
	//frames["iframe_content"].height=window.innerHeight
	
	
	//document.getElementById("div_content").style.left =window.innerWidth/2
	//document.getElementById("div_content").style.top =window.innerHeight/2

}

function video2(file, width, height) {

	// anzeigen der bilder integriert per DIV auf der Seite
	// nicht aktiviert!


	if (typeof(title)=="undefined") title=""
	if (typeof(text)=="undefined") text=""


	fensterzu()
	// falls noch fenster irgendwie offen sind, alle schliessen


  if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;

  } else if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
	

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    
	//IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  
//  alert(myHeight)
 // alert(td_body_leftHeight)


	document.getElementById("div_view").style.width =myWidth
	document.getElementById("div_view").style.height =myHeight
	
	auf("div_view")
	
	
//	alert(window.innerWidth+" "+window.innerHeight)
	
	xy=getScrollXY()
	px=xy[0]
	py=xy[1]


	//document.getElementById("div_content").style.width =window.innerWidth-100
	//document.getElementById("div_content").style.height =window.innerHeight-50

		
		top.document.getElementById("div_content").style.width =500
		top.document.getElementById("div_content").style.height =60
		top.document.getElementById("div_content").style.left =(top.window.innerWidth/2)-(250)+px
		top.document.getElementById("div_content").style.top =((top.window.innerHeight-50)/2)-(20)+py
		
		if (top.document.getElementById("div_content").style.top<50) top.document.getElementById("div_content").style.top=50
		
	top.document.getElementById("div_content").innerHTML='<table width=100% border=0 class="font10" cellpadding=4 cellspacing=0><tr><td width=50><img src="http://www.kickerzone.de/pixs/busy.gif" align="right"></td><td nowrap>'+file+'<br><b class="hellgrau">wird geladen...</b></td><td width=1 nowrap><a href=\'javascript:closewin()\'><img src="/pixs/close.gif"></a></td></tr></table>'
	
	auf("div_content")
//	auf("div_buttons")

//	flipID("")


	frames["iframe_content"].location.href="/main/video2.php?file="+file+"&w="+width+"&h="+height
	
	//template2.php?pic="+pfad+"&title="+title+"&text="+text
	
	//frames["iframe_content"].width=window.innerWidth
	//frames["iframe_content"].height=window.innerHeight
	
	
	//document.getElementById("div_content").style.left =window.innerWidth/2
	//document.getElementById("div_content").style.top =window.innerHeight/2

}


// funktionen für den bildanzeiger view()
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function fensterzu() {
	
	doc=top.document

	if (doc.location.href=="http://www.kickerzone.de/main/setedit.php") {
		
			doc=this.document	

		}
		
		

	doc.getElementById("div_content").style.display="none"
	doc.getElementById("div_view").style.display="none"

//	zu("div_content")
//	zu("div_view")

//zu("div_title")
	//zu("div_buttons")
		
	doc.getElementById("div_title").style.display="none"
	doc.getElementById("div_buttons").style.display="none"

	doc.getElementById("iframe_content").style.display="none"
	
	top.frames["iframe_content"].location.href="/leer.html"

	}
