function resizeMe(id){
  //find the height of the internal page
  var the_height= document.getElementById(id).contentWindow.document.height || document.getElementById(id).contentWindow.document.body.scrollHeight;
  //change the height of the iframe
  document.getElementById(id).style.height = 0;
  document.getElementById(id).style.height = the_height;
  if (id=='content')
  {ReloadPage();}
}

/* hack um das übergeordnete iframe anzupassen, wenn in einer page des inneren iframes ein weiterer link ausgeführt wird */
function ReloadPage () {
        var obj = top.document.getElementById('page');
        var the_height = document.height || document.body.scrollHeight;
        obj.style.height = 0;
        obj.style.height = the_height;
}


function loadPageIframe(theURL) {
        top.document.getElementById('page').src=theURL;
}

function loadContentIframe(theURL) {
        parent.document.getElementById('content').src=theURL;
}

function loadAdmin()
{
	window.open('php-news/index.php', 'Adminbereich', 'scrollbars=yes,width=850,location=no');
}

function loadAdminSend()
{
	window.open('php-news/index.php?action=news.add', 'Adminbereich', 'scrollbars=yes,width=850,location=no');
}

function loadNewsletter()
{
	window.open('newsletter/admin.php?s=newsletter', 'Adminbereich', 'scrollbars=yes,width=850,location=no');
}

function loadSection(s,t){
       var wert=s.options[s.selectedIndex].value;
         if(wert!=0){
            location.href= t + '_upload.php?section=' + wert;
         }
}

function loadEditSection(s,t){
       var wert=s.options[s.selectedIndex].value;
         if(wert!=0){
            location.href= t + '_upload.php?editsection=' + wert;
         }
}

function loadEditId(sel,page,section){
		var id = sel.options[sel.selectedIndex].value;
         if(id==0)
		 {
            location.href= page + '_upload.php';
         }
		 else
		 {
            location.href= page + '_upload.php?editsection=' + section + '&editid=' + id;
         }
		 resetSelect('edit');
}

function resetSelect(id)
{
	var sel = document.getElementById(id);
	sel.options[sel.selectedIndex].selected = false;
	sel.options[0].selected = true;
}

