<!--

///////////////////////////////
// Layout wurde geändert - für Disable der Buttons
function layout_changed() {

  //alert('Layout wurde geändert');

  top.frames['layout_frame'].document.layout_form.document_changed.value='YES';

  if(
  top.frames['layout_frame'].document.layout_form.opened_file.value
  &&
  top.frames['layout_frame'].document.layout_form.opened_file.value != 'NOTITLE.prv'
  ) {

  top.frames['layout_frame'].document.getElementById('save_butt').style.color  = '#000000';
  top.frames['layout_frame'].document.getElementById('save_butt').style.cursor = 'hand';
  if(!document.all) top.frames['layout_frame'].document.getElementById('save_butt').style.cursor = 'pointer';

  top.frames['layout_frame'].document.getElementById('send_butt').style.color  = '#cccccc';
  top.frames['layout_frame'].document.getElementById('send_butt').style.cursor = 'default';

  top.frames['layout_frame'].document.getElementById('prod_butt').style.color  = '#cccccc';
  top.frames['layout_frame'].document.getElementById('prod_butt').style.cursor = 'default';

  top.frames['layout_frame'].document.getElementById('unsaved_disp').style.display = 'inline';
  top.frames['layout_frame'].doc_changed = true;

  }

}



///////////////////////////////
var active_pullout;
var active_menu_butt;

var mouse_over_pullout = false;

////// Pullout zeigen
function show_pullout(pullout_id,elem) {

if(active_menu_butt) active_menu_butt.style.border = 'solid #FFFFFF 1px;';
active_menu_butt = elem;
active_menu_butt.style.border = 'solid #FF8040 1px;';


if(top.frames['layout_frame'].active_pullout) top.frames['layout_frame'].active_pullout.style.display='none';
top.frames['layout_frame'].active_pullout = top.frames['layout_frame'].document.getElementById(pullout_id);

top.frames['layout_frame'].active_pullout.style.left=elem.offsetLeft -(-5);
top.frames['layout_frame'].active_pullout.style.top=top.frames['layout_frame'].document.body.scrollTop -(-1);
top.frames['layout_frame'].active_pullout.style.display='inline';


// Hilfe + Impressum verbergen
//hide_help();
//hide_impressum();
//show_table_center();

// Zum Focussieren des Hauptfensters
close_infowin();
}


// Zum Focussieren des Hauptfensters - infowin_window schließen
function close_infowin() {
if(top.frames['layout_frame'].infowin_window) top.frames['layout_frame'].infowin_window.close();
}


////// Layout Tabelle verbergen
function hide_table_center() {
//top.frames['layout_frame'].document.getElementById('table_center').style.display='none';
top.frames['layout_frame'].document.getElementById('table_center_DIV').style.display='none'; // Mozilla
}

////// Layout Tabelle zeigen
function show_table_center() {

//top.frames['layout_frame'].document.getElementById('table_center').style.display='inline';
top.frames['layout_frame'].document.getElementById('table_center_DIV').style.display='inline';  // Mozilla
}






////// Textseite zeigen
function show_textpage(textsource) {

// Zuerst alle ausblenden
hide_ALL_textpages();

// Dann "textsource"-Tabelle einblenden (show_textpage.inc)
top.frames['layout_frame'].document.getElementById(textsource+'_table').style.display='inline';

// Seite nach oben scrollen und Pullout verbergen
top.frames['layout_frame'].document.body.scrollTop = '0px';
hide_pullout();
}


////// Alle Textseite verbergen
function hide_ALL_textpages() {

// Array "ALL_textpages" wird in layout.php erzeugt - enthält alle Namen der Textseiten
for(i=0;i<ALL_textpages.length;i++) {
  //hide_textpage(ALL_textpages[i]);
  top.frames['layout_frame'].document.getElementById(ALL_textpages[i]+'_table').style.display='none';
}

}


////// Mini-Hilfe zeigen
function show_minihelp(textsource,width,height) {
var minihelp_win = window.open('minihelp.php?textsource='+textsource,'minihelp','width='+width+',height='+height+',toolbar=no,resizable=no,scrollbars=no,menubar=no,status=yes,modal=yes');
minihelp_win.moveTo(screen.width/2 -width/2,screen.height/2 -height/2);
minihelp_win.focus();
}


////// Text-Seite zeigen
function show_page(textsource,width,height) {
var page_win = window.open('show_page.php?textsource='+textsource,'pagewin','width='+width+',height='+height+',toolbar=no,resizable=yes,scrollbars=yes,menubar=no,status=yes,modal=yes');
page_win.moveTo(screen.width/2 -width/2,screen.height/2 -height/2);
page_win.focus();
}

////// Bild zeigen (z.B. Hilfe-Bilder)
function show_pic(picsource) {
//alert(picsource);
var picwin = window.open('show_pic.php?picsource='+picsource,'picwin','width=100,height=100,toolbar=no,resizable=no,scrollbars=no,menubar=no,status=yes,modal=yes');
//picwin.moveTo(screen.width/2 -width/2,screen.height/2 -height/2);
picwin.focus();
}


////// Pullout verbergen
function hide_pullout() {

if(top.frames['menu_frame'].active_menu_butt) {
 top.frames['menu_frame'].active_menu_butt.style.border = 'solid #FFFFFF 1px;';
 top.frames['menu_frame'].active_menu_butt = '';
}

if(top.frames['layout_frame'].active_pullout)   top.frames['layout_frame'].active_pullout.style.display='none';

// Hilfe
//top.frames['layout_frame'].document.getElementById('help_table').style.display='none';


}


/////// Menu MOUSEOVER
function menu_over(elem){
//if(elem != active_menu_butt) elem.style.border = 'outset 1px;';
if(elem != active_menu_butt) elem.style.border = 'solid #CCCCCC 1px;';
}

/////// Menu MOUSEOUT
function menu_out(elem){
if(elem != active_menu_butt) elem.style.border = 'solid #FFFFFF 1px;';
}


/////// Menu Vorschau
function preview(elem){
top.frames['layout_frame'].document.layout_form.save_prew_temp.value='YES';
top.frames['layout_frame'].document.layout_form.submit();

/*
// ausgelagert in save_layout.inc
prev_to_open = top.frames['layout_frame'].document.layout_form.opened_file.value;
prev_to_open = prev_to_open.replace('.wlt','.prv');
if(!prev_to_open) prev_to_open = 'no_titel.prv';


var prew_win = window.open('preview.php?from_admin=yes&prewfile='+prev_to_open,'prew_win','width=550, height=650; fullscreen=0, toolbar=no, resizable=1, scrollbars=no, menubar=no, status=yes');
prew_win.focus();

prew_win.document.location.reload();
*/
}




function high(elem) {
  elem.bgColor = '#FFFF00';
}
function low(elem)  {
  elem.bgColor = '';
}





///////////////////////////
function showMod(source,width,height,vari1,vari2,vari3,vari4,vari5) {

//alert(source);

var dialogWin = new Array();
dialogWin.opener = window;
//dialogWin.parent = parent;
dialogWin.parent = top.frames['layout_frame'];

var dialog_value = showModalDialog('dialog1.php?inc_file='+source+'&vari1='+vari1+'&vari2='+vari2+'&vari3='+vari3+'&vari4='+vari4+'&vari5='+vari5,dialogWin,'dialogWidth:'+width+'px; dialogHeight:'+height+'px; resizable:no; help:no; status:yes; scroll:no; ');

/*
if(dialog_value != null) {
alert(dialog_value);
}
*/

return true;
}





///////////////////////////
function openWin(source,width,height,scroll,resize,vari1,vari2,vari3,vari4,vari5) {

var infowin = window.open('dialog2.php?inc_file='+source+'&vari1='+vari1+'&vari2='+vari2+'&vari3='+vari3+'&vari4='+vari4+'&vari5='+vari5,'infowin','width='+width+',height='+height+',toolbar=no,resizable='+resize+',scrollbars='+scroll+',menubar=no,status=yes,modal=yes');
infowin.moveTo(screen.width/2 -width/2,screen.height/2 -height/2);
infowin.focus();

// Zum Focussieren des Fensters
if(top.frames['layout_frame']) top.frames['layout_frame'].infowin_window = infowin;
}



/////////////////////
if(document.images) {
  prel1 = new Image();
  prel1.src = 'layout/new2.gif' ;
}


/////////////////////
function sw_fix(obj,img) {
 if(img == 'img1') img_src = 'layout/new1.gif';
 if(img == 'img2') img_src = 'layout/new2.gif';
 obj.src=img_src;
}






///////////////////////////// Allgemeine Funktionen

///// Überprüfung ob Element in Array vorhanden
function IN_ARRAY(arr,entry) {
for(var i = 0; i < arr.length; i++) if(arr[i] == entry) return true;
return false;
}

///// Ermittlung der Position eines Elementes in Array
function ARRAY_POS(arr,entry) {
for(var i = 0; i < arr.length; i++) if(arr[i] == entry) return i;
return false;
}

///// Element aus Array entfernen
function ARRAY_REMOVE(arr,entry) {
var new_arr = new Array();
for(var i = 0; i < arr.length; i++) {
    if(arr[i] != entry) {
      new_arr[new_arr.length] = arr[i];
    }
}
return new_arr;
//return false;
}


//-->

