function showbild(bild,arpos)
{
var all=pics.length;
last=arpos-1;
next=arpos+1;


var pagination="Bild "+Math.round(arpos+1)+" von "+all+" &nbsp;&nbsp;&nbsp;";
if(arpos>0)pagination=pagination+" <a href='' onclick='showbild(\""+pics[last]+"\","+last+"); return false;'>&lt;&lt; Vorheriges Bild</a>";
if(arpos>0 && arpos<Math.round(all-1))pagination=pagination+" :: ";
if(arpos<Math.round(all-1))pagination=pagination+"<a href='' onclick='showbild(\""+pics[next]+"\","+next+"); return false;'> Nächstes Bild &gt;&gt;</a>";


content="<div style='margin:5px; font-weight:bold; border-bottom:1px dotted black;'>"+pagination+"<div style='float:right'><a href='' onclick='hidebild(); return false;'>Schließen [X]</a></div></div><br clear=all><img src='"+bild+"' border='0' onclick='hidebild();' style='margin:0px 5px 5px 5px;'>"; 	


$("#imglayer").css("visibility","visible");	
$("#imgbox").bind("click","hidebild");
$("#imgbox").html(content);
var scroll=$("body").scrollTop();
if($.browser.msie){
	if (document.documentElement && !document.documentElement.scrollTop)var scroll=0;
	if(document.body && document.body.scrollTop)var scroll=document.body.scrollTop;
	if(document.documentElement && document.documentElement.scrollTop)var scroll=document.documentElement.scrollTop;
	} else {var scroll=window.pageYOffset;} 

$("#imgbox").css("top",scroll+20+"px");
$("#imglayer").css("top",scroll+"px");
$("#imgbox").css("visibility","visible");


}

function showvideo(video,typ)
{
	
if(typ=="yt"){	
var content="<div style='float:right'><a href='' onclick='hidebild(); return false;'>Schließen [X]</a></div><br clear=all><object width='640' height='530'><param name='movie' value='http://www.youtube.com/v/"+video+"?hl=de&fs=1&color1=0x95B795&color2=0x6AB67C&autoplay=1&border=0'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/"+video+"?hl=de&fs=1&color1=0x95B795&color2=0x6AB67C&autoplay=1&border=0' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='640' height='530'></embed></object>"; 
}

if(typ=="fp"){
var content="<div style='float:right'><a href='' onclick='hidebild(); return false;'>Schließen [X]</a></div><br clear=all><div id='fp' style='width:640px; height:530px;'></div>";
}


$("#imglayer").css("visibility","visible");	
$("#imgbox").bind("click","hidebild");
$("#imgbox").html(content);
if($.browser.msie){
	if (document.documentElement && !document.documentElement.scrollTop)var scroll=0;
	if(document.body && document.body.scrollTop)var scroll=document.body.scrollTop;
	if(document.documentElement && document.documentElement.scrollTop)var scroll=document.documentElement.scrollTop;
	} else {var scroll=window.pageYOffset;} 
$("#imgbox").css("top",scroll+50+"px");
$("#imglayer").css("top",scroll+"px");
$("#imgbox").css("visibility","visible");
if(typ=="fp"){
$f("fp","/flowplayer/fp.swf",{
    clip:{
        url:video,
        scaling: 'orig',
        autoPlay: true,
        provider: 'foppstream'
    },
    plugins: { 
        foppstream: { 
            url: '/flowplayer/flowplayer.stream.swf',
            queryString: escape('?start=${start}') 
        } 
    } 
    
});
}

}

function hidebild()
{
$("#imgbox").empty();
$("#imgbox").unbind();
$("#imglayer").css("visibility","hidden");
$("#imgbox").css("visibility","hidden");	
}

function pic_admin(pic,domid)
{

$.get("/ajax/admin.php", { sub: "pics", domid: domid, pic: pic },
  function(data){
    
    eval(data);
    

  });

}


$(document).ready(function () {
	
		$("a[rel=picgal]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'inside',
		'cyclic'			: true,
		'changeSpeed'		: 50,
		'overlayOpacity'	: 0.7,
		'overlayColor'		: '#000000',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Bild ' +  (currentIndex + 1) + ' von ' + currentArray.length + ' :: ' + title + '</span>';
		}
	});

	
	
    

});

  
    
    
    




