
function shownews()
{
	
	element = Builder.node('div',{id: 'singleentry' ,style:'position:absolute;top:29px;left:425px;z-index:4;'});
document.getElementById('yeahbaby').appendChild(element);
Ebenen.push(element); 
 new Ajax.Updater('singleentry', 'news.inc.php?action=singleentry', {asynchronous:true,onComplete:function(){
	window.setTimeout("document.getElementsByTagName('body')[0].style.overflow='auto'",1000);

 	}});
 
element = Builder.node('div',{id: 'shrtnews' ,style:'position:absolute;top:50px;left:220px;z-index:4;'});
document.getElementById('yeahbaby').appendChild(element);
Ebenen.push(element);
Element.hide('shrtnews');
Element.hide('singleentry');
 new Ajax.Updater('shrtnews', 'news.inc.php?action=shrtlst&start=0&end=5', {asynchronous:true});
new Effect.Appear('shrtnews',{queue:'end'});
new Effect.Appear('singleentry',{queue:'end'});

}

function shortnewsprevnext(start) {
 new Ajax.Updater('shrtnews', 'news.inc.php?action=shrtlst&start='+start, {asynchronous:true});
}

function shownewsentry(id)
{
if (document.getElementById('singleentry'))
{
		document.getElementsByTagName('body')[0].style.overflow='auto';
new Ajax.Updater('singleentry', 'news.inc.php?action=singleentry&id='+id, {asynchronous:true,onComplete:function(){
 	document.getElementById("scrollnewsdown").addEventListener("mousemove", scrollNewsDown, false);
	document.getElementById("scrollnewsup").addEventListener("mousemove", scrollNewsUp, false);

 	}});
	}
}

function scrollNewsUp(Event) {
   document.getElementById('newsTextContainer').scrollTop=document.getElementById('newsTextContainer').scrollTop-10;

}
function scrollNewsDown(Event) {
   document.getElementById('newsTextContainer').scrollTop=document.getElementById('newsTextContainer').scrollTop+10;
}

function newsEntryList(value)
{
	if (document.getElementById('newsadminlist')==null) {
		 element = Builder.node('div',{id: 'newsadminlist' ,style:'width:500px;position:absolute;top:50px;left:200px;z-index:4;'});
     document.getElementById('yeahbaby').appendChild(element);
     	adminLayers.push(element);
    }
	new Ajax.Updater('newsadminlist', 'news.inc.php?action=liste&start='+value, {asynchronous:true});
}

function editEntry(entry) {
 if (document.getElementById('entryform')==null) {
 element = Builder.node('div',{id: 'entryform' ,style:'width:560px;position:absolute;top:10px;left:240px;z-index:4;border:4px solid #CCCCCC;background-color:#FFFFFF;'});
 document.getElementById('yeahbaby').appendChild(element);
 	adminLayers.push(element);
 }
 	new Ajax.Updater('entryform', 'news.inc.php?action=entryform&id='+entry, {asynchronous:true});
 	Effect.Appear('entryform');
}

function closeNewseditor(value) {
  Element.hide('entryform');
  new Ajax.Updater('newsadminlist', 'news.inc.php?action=liste&start=0', {asynchronous:true});
}

function addTitlePic() {
	    if (document.getElementById('galleryChooser')==null) {
	    $dimension = getDimension();
 element = Builder.node('div',{id: 'galleryChooser' ,style:'width:560px;position:absolute;top:'+((dimension[1]/2)-200)+'px;height:400px;left:'+((dimension[0]/2)-280)+';z-index:4;border:4px solid #CCCCCC;background-color:#FFFFFF;'});
 document.getElementById('yeahbaby').appendChild(element);
 	adminLayers.push(element);
 }
 	new Ajax.Updater('galleryChooser', 'photo.php?action=galleryChooser&what=newstitlepic', {asynchronous:true});
 	Effect.Appear('galleryChooser');
	}
	
function pictureSelector(gallery,seite,what)
{
  new Ajax.Updater('galleryChooser', 'photo.php?action=pictureSelector&id='+gallery+'&seite='+seite+'&what='+what, {asynchronous:true});
}
function selectImage(id,kind) {
 if (kind == 'newstitlepic') {
    document.getElementById('titlepicvalue').value=id; 
    Effect.Fade('galleryChooser');
  }
 if (kind == 'intextpic') {
 }
}